How sktech0/virtualclassroom works
Project type and purpose
• This is a full-stack, real-time virtual classroom application.
• Frontend: Angular 17 single-page application (“live-study-room”).
• Backend: .NET 8.0 Web API (“VirtualClassroom.Backend”) exposing REST endpoints and a SignalR hub.
• Purpose: enable live study rooms, chat, Pomodoro timer, leaderboards, and secure authentication.
File structure
• Top level:
• VirtualClassroom.sln (Visual Studio solution)
• VirtualClassroom.Backend/ (API project)
• live-study-room/ (Angular client)
• Backend folders:
• Controllers (Auth, Room, Pomodoro) → HTTP entry points
• Hubs (RoomHub) → SignalR real-time channel
• Services/Interfaces → business logic layer
• Data/ApplicationDbContext + Migrations → EF Core persistence layer
• Models & DTOs → domain entities and data contracts
• Frontend folders:
• core (guards, interceptors, ApiService, SignalRService, AuthService)
• features (auth, room, chat, pomodoro, leaderboard, landing)
• shared (reusable components, pipes, models)
• app.routes.ts → route definitions
Key architectural insights from README
• Uses JWT for authentication.
• Implements real-time communication with SignalR.
• EF Core-backed SQL Server (LocalDB) for persistence.
• Angular HTTP + SignalR client for API calls and live updates.
a. Main components
1) Angular SPA (UI):
– Core modules: routing, guards, interceptors
– Feature modules: Auth, Room, Chat, Pomodoro, Leaderboard
– SignalR client service
2) .NET Core Web API:
– Controllers (AuthController, RoomController, PomodoroController)
– SignalR Hub (RoomHub)
– Services (AuthService, RoomService, PomodoroService, JwtTokenService)
– EF Core DataContext (ApplicationDbContext)
– Models + DTOs
3) Database: SQL Server / LocalDB
4) External: Browser clients; optional CDN or hosting environment
b. Relationships & interactions
– UI → Backend via HTTPS REST (Auth, Room, Pomodoro endpoints)
– UI ↔ Backend via WebSocket (SignalR hub for room events and chat messages)
– Backend Services ↔ EF Core DbContext → Database
– Auth flow: user logs in/registers → JwtTokenService issues JWT → Angular interceptor attaches JWT to HTTP/SignalR calls
– Real-time flow: Angular SignalRService connects to RoomHub → receive/send chat messages, join/leave room notifications
c. Architectural patterns & principles
– Layered architecture in backend (Presentation: Controllers/Hubs → Business: Services → Data: EF Core)
– Modular Angular structure (Core vs Features vs Shared)
– Separation of concerns, single responsibility for controllers vs services
– DTOs for mapping between domain models and API contracts
– Dependency injection throughout (.NET Core DI, Angular providers)
– Real-time event-driven communication via SignalR
d. Key technologies & frameworks
– Frontend: Angular 17, TypeScript, Angular Router, HTTPClient, SignalR client, RxJS
– Backend: .NET 8.0, ASP.NET Core Web API, SignalR, Entity Framework Core, JWT Bearer Authentication, SQL Server