How inkithai/online-learning-platform works
Main Components
• Frontend: Built in Angular using Angular Material. This layer is responsible for the user interface, including components such as login, dashboard, course management, and various dialogs (e.g., change-password, product confirmation). It resides under the “frontend/src/app” directory and includes dedicated modules and routing for different “features” (like home, dashboard, material-component, login, and signup).
• Backend: Developed with Node.js and Express.js. It handles server-side logic, authentication (with JWT tokens), API routing (with files in “backend/routes”) and services (business logic in “backend/services”). The backend also configures middleware for authentication and role checking.
• Database: MySQL-based system with the SQL schema file provided in the “database/academy_db.sql”. This layer is in charge of persisting course, user, and enrollment information.
• External Services & Middleware: Although not explicitly depicted as separate external services, the use of JWT tokens for authentication and the modular service files (like authentication.js and checkRole.js) implies a middleware architecture for request handling.
Relationships and Interactions
• Within the Backend, routes (such as bill.js, course.js, dashboard.js, user.js) map HTTP requests to service logic, ensuring that business rules (like authentication and role-based access) are enforced.
• The authentication mechanism using JWT tokens should be highlighted to show how secure communication is maintained between the client and server.
Architectural Patterns and Design Principles
• Modular Architecture: Both UI (Angular modules and separate material-component, dashboard, etc.) and backend layers are segmented for maintainability.
• MVC-like Pattern on the Backend: The routing files can be thought of as “controllers”, while service files encapsulate the “model” and business logic.
• Separation of Concerns: Clearly delineated sections (frontend, backend, and database) underline the layered architecture.
• UI Responsiveness: Use of Angular Material indicates a design focused on a responsive and dynamic user interface.
• Stateless Authentication: Emphasize the use of JWT tokens for secure, stateless user sessions.
Relevant Technologies
• Frontend: Angular, Angular Material.
• Backend: Node.js, Express.js.
• Database: MySQL.
• Additional Tools: npm for package management, and Sequelize (if using an ORM as indicated in the design decisions) even though it isn’t explicitly in the file tree.