Architecture
Understand how XyraPanel is built, how its components interact, and the technology decisions that power the platform.System Overview
XyraPanel follows a modern full-stack architecture with clear separation of concerns:Core Components
Frontend Application
Technology Stack:- Nuxt 4: Vue 3 meta-framework with SSR/SSG capabilities
- Vue 3.5: Progressive JavaScript framework with Composition API
- TypeScript 5.9: Static type checking and enhanced IDE support
- Tailwind CSS 4: Utility-first CSS framework
- Nuxt UI: Pre-built component library
Backend API
Framework:- Nitro: Universal server engine for Nuxt
- H3: HTTP framework for event handlers
Database Layer
PostgreSQL Schema: XyraPanel uses Drizzle ORM for type-safe database access. Key tables include:users
User accounts, authentication, roles, and suspension status
sessions
Active user sessions with device and IP tracking
wingsNodes
Wings daemon configurations and connection details
servers
Game server definitions, resource limits, and state
serverAllocations
IP addresses and ports assigned to servers
eggs
Server templates with startup commands and variables
schedules
Automated task schedules with cron expressions
backups
Backup metadata and storage locations
activityLogs
Audit trail of all panel actions
server/database/schema.ts:
Redis Cache
Redis provides high-performance caching and session storage: Configuration: Fromnuxt.config.ts:
- Rate Limiting: Track API request counts per IP
- Session Storage: Distributed session management
- HTTP Caching: Cache API responses for performance
- Resource Metrics: Store real-time server statistics
Security Architecture
Authentication Flow
XyraPanel uses Better Auth for modern authentication: Features:- Password hashing with bcryptjs
- JWT tokens for API authentication
- Session tokens with expiration
- TOTP-based two-factor authentication
- Password reset via email tokens
Authorization Model
Permissions are checked at multiple levels:- Route-Level: Middleware checks user authentication
- Resource-Level: Verify ownership/access to specific resources
- Action-Level: Check permissions for specific operations
Rate Limiting
Multi-layer rate limiting protects against abuse:Rate Limiter ConfigurationXyraPanel uses different rate limits for different endpoints:
- Authentication: 5 requests per 10 minutes
- Password Reset: 5 requests per 15 minutes
- General API: 150 requests per 5 minutes
- Admin API: 300 requests per minute
nuxt.config.ts:
Content Security Policy
Strict CSP headers prevent XSS and injection attacks:Wings Communication
Protocol
XyraPanel communicates with Wings nodes via HTTP API: Wings Client Implementation: Fromserver/utils/wings/client.ts:
WebSocket Connections
Real-time console access uses WebSocket proxying:- Client connects to panel WebSocket endpoint
- Panel authenticates user and validates server access
- Panel establishes WebSocket to Wings node
- Messages are proxied bidirectionally
- Console output streams to client in real-time
Background Tasks
Scheduled Jobs
Nitro’s experimental tasks feature handles background processing: Fromnuxt.config.ts:
- scheduler:process: Execute user-defined server schedules
- monitoring:collect-resources: Gather CPU/memory/disk metrics from Wings
- maintenance:prune-*: Clean up old records for database health
Deployment Architecture
Single-Server Deployment
Simplest setup for small deployments:Multi-Server Deployment
Scalable architecture for production:Docker Deployment
XyraPanel includes Docker Compose configuration:Performance Optimizations
Code Splitting
Automatic chunking reduces initial load time: Fromnuxt.config.ts:
HTTP Caching
Intelligent cache headers reduce database load:Build Optimization
- Lightning CSS: Fast CSS minification and processing
- Tree Shaking: Remove unused code from bundles
- Rolldown Vite: Experimental faster bundler (via pnpm override)
- Build Cache: Reuse builds across deployments
Technology Stack Summary
Frontend
- Nuxt 4.3
- Vue 3.5
- TypeScript 5.9
- Tailwind CSS 4
- Nuxt UI 4.5
Backend
- Nitro (Nuxt Server)
- H3 Event Handlers
- Drizzle ORM 0.45
- Better Auth 1.4
Database
- PostgreSQL (primary)
- Redis (cache + sessions)
- Drizzle Kit (migrations)
Infrastructure
- Pterodactyl Wings
- Docker containers
- PM2 process manager
- Nginx/Caddy (reverse proxy)
Security
- bcryptjs (password hashing)
- jose (JWT tokens)
- nuxt-security (headers)
- Turnstile/reCAPTCHA
Developer Tools
- oxlint (linting)
- oxfmt (formatting)
- Vitest (testing)
- TSX (TypeScript execution)
Next Steps
Now that you understand XyraPanel’s architecture:- Installation - Deploy your own instance
- Configuration - Configure environment variables
- Development - Set up local development
- API Reference - Explore the API endpoints