How richardktran/elteam works
Project Type and Purpose
• The project is a full-stack web application built on the Laravel PHP framework.
• Its purpose is to manage course-related functionalities—evident from controllers like CourseController, GroupController, TaskController, CurriculumController, and more.
• The frontend is organized in resources/js, containing components, pages, state management (store), routing, and API services, suggesting interactive user interfaces and SPA behavior.
Key Components
a. Client (Frontend):
• The browser acting as the client.
• Frontend application assets located in public/assets and resources/js.
• SPA modules (components, pages, layout) along with routing (resources/js/src/router/Router.js) and state management (store).
• Asset management using Laravel Mix (webpack.mix.js) for compiling CSS and JavaScript.
b. Web Server / Load Balancer:
• The Nginx container (under docker/nginx) which serves the application.
• Its reverse proxy role for routing HTTP requests to the Laravel backend and serving static assets.
c. Application Server (Laravel Backend):
• All core application logic is encapsulated in the app directory.
• Controllers (including Auth, Course, Group, Task, etc.) handle the incoming HTTP requests.
• Middleware, Exception Handling, and Request validation (located in app/Http/Middleware and app/Http/Requests) indicate the use of the MVC pattern.
• The event-driven architecture using Events, Listeners, and Console Commands (e.g., app/Console, app/Events, app/Listeners) is utilized for background job processing and notifications.
• Supporting services, Utilities, and response formatting (app/Services, app/Supports) round out the business logic.
• Console commands and scheduling for tasks like processing student invitations or task creation.
d. Database:
• Managed by MySQL (docker/mysql) as configured in config/database.php.
• Migrations (database/migrations) and Factories/Seeders for initial data setup.
e. Queue/Message Broker:
• RabbitMQ container (docker/rabbitmq) for background jobs and real-time event broadcasting.
• Events and Listeners (such as EmailCourseInvitationListener and GenerateGroupsEvent) that may interact asynchronously.
f. External Integrations:
• Third-party authentication from Google (app/Http/Controllers/Auth/GoogleController.php) indicating integration with external OAuth services.
• Email services (app/Mail) used to send course invitations and notifications.
Relationships and Interactions
• The web client makes HTTP/HTTPS requests (AJAX calls or form submissions) routed through Nginx to the Laravel backend.
• The backend uses controllers within the MVC pattern to process requests, utilizing Models, Services, and supporting utilities.
• Events triggered in the backend cause asynchronous processing via the message broker (RabbitMQ) and scheduled console commands.
• The backend communicates with the MySQL database for persistent storage.
• The frontend interacts indirectly with backend APIs through the resources/js/api modules that wrap Axios or similar HTTP clients.
• Frontend state management (using Redux or similar in resources/js/src/store) manages user interaction and updates from API responses.
Architectural Patterns and Principles
• MVC architectural pattern is used on the backend; separation of concerns is maintained between Controllers, Models, and Views.
• The application leverages event-driven design with event broadcasting, listeners, and background queue processing.
• Clear separation between frontend and backend logic ensures maintainability and scalability.
• Docker is used for containerization of services like PHP, Nginx, MySQL, and RabbitMQ to ensure consistent deployments.