This document provides a comprehensive overview of the Cyber Training Platform's architecture.
┌─────────────────┐ ┌──────────────┐ ┌─────────────────┐
│ Frontend │────▶│ Backend │────▶│ Database │
│ (React) │ │ (FastAPI) │ │ (PostgreSQL) │
└─────────────────┘ └──────────────┘ └─────────────────┘
│
│
┌─────▼─────┐
│ VirtualBox │
│ API │
└───────────┘
The platform is built on a modern, scalable architecture with four main components:
- Frontend: React-based SPA with TypeScript
- Backend: FastAPI application
- Database: PostgreSQL for data persistence
- VM Management: VirtualBox API integration
frontend/
├── src/
│ ├── components/ # Reusable UI components
│ ├── pages/ # Route-based page components
│ ├── hooks/ # Custom React hooks
│ ├── services/ # API integration
│ ├── store/ # State management
│ └── utils/ # Helper functions
└── public/ # Static assets
- React with TypeScript for type safety
- Redux for state management
- React Router for navigation
- Material-UI for consistent styling
- WebSocket integration for real-time updates
backend/
├── app/
│ ├── api/ # REST endpoints
│ ├── core/ # Core business logic
│ ├── models/ # Database models
│ ├── services/ # External service integration
│ └── utils/ # Helper functions
└── tests/ # Test suite
- FastAPI for high-performance async operations
- SQLAlchemy for ORM
- Pydantic for data validation
- JWT-based authentication
- Role-based access control
-- Core Tables
users
├── id (PK)
├── username
├── email
└── role
labs
├── id (PK)
├── name
├── user_id (FK → users.id)
├── status
└── created_at
vms
├── id (PK)
├── lab_id (FK → labs.id)
├── name
└── status
-- Association Tables
lab_templates
├── id (PK)
├── name
└── config
user_labs
├── user_id (FK → users.id)
└── lab_id (FK → labs.id)┌────────────────┐ ┌───────────────┐
│ VM Manager │────▶│ VirtualBox │
└────────────────┘ └───────────────┘
│
│
┌───────▼────────┐
│ VM Templates │
└────────────────┘
- Isolated network environments
- Resource management
- Snapshot capabilities
- Template management
┌──────────┐ ┌──────────┐ ┌──────────┐
│ Client │────▶│ JWT │────▶│ Resource │
└──────────┘ └──────────┘ └──────────┘
- User authentication via JWT
- Role-based access control
- Resource isolation
- Network security
┌────────────┐ ┌─────────────┐ ┌──────────┐
│ Public Net │────▶│ Firewall │────▶│ Lab Net │
└────────────┘ └─────────────┘ └──────────┘
- Isolated lab networks
- Firewall rules
- VPN access (optional)
- HTTPS enforcement
┌─────────────┐
│ Load │
│ Balancer │
└─────────────┘
│
┌─┴─┐
┌───┴─┐ ├───┐
│ App │ │App │
└─────┘ └───┘
- Container-based deployment
- Load balancing
- Database replication
- Caching strategy
- Dynamic resource allocation
- Auto-scaling capabilities
- Resource quotas
- Performance monitoring
Client Request
│
▼
Load Balancer
│
▼
API Gateway
│
▼
Authentication
│
▼
Business Logic
│
▼
Database/VM
Client
│
▼
WebSocket Server
│
▼
Event Handler
│
▼
VM Status Updates
- Prometheus metrics
- Grafana dashboards
- Resource utilization
- Performance metrics
- Centralized logging
- Error tracking
- Audit trails
- Performance monitoring
┌─────────────┐ ┌─────────────┐
│ CI/CD │────▶│ Production │
└─────────────┘ └─────────────┘
│
┌─────┴─────┐
│ Staging │
└───────────┘
- Containerized deployment
- Blue-green deployment
- Automated testing
- Rolling updates
- Multiple availability zones
- Database replication
- Failover mechanisms
- Backup strategies
- Authentication providers
- Storage services
- Monitoring services
- Backup services
- REST API
- WebSocket API
- VirtualBox API
- Management API
- Microservices architecture
- Kubernetes orchestration
- Enhanced monitoring
- AI-powered assistance
- Multi-region support
- Enhanced caching
- Improved resource management
- Advanced analytics
-
Frontend: React + TypeScript
- Type safety
- Component reusability
- Rich ecosystem
-
Backend: FastAPI
- Async support
- High performance
- OpenAPI documentation
-
Database: PostgreSQL
- ACID compliance
- Rich feature set
- Reliability
-
VM Management: VirtualBox
- Open source
- Rich API
- Cross-platform support
This architecture is designed to be:
- Scalable
- Maintainable
- Secure
- Performance-oriented
The modular design allows for future improvements and modifications while maintaining system stability and security.