How tkuimwd/finaltermproject works
Main System Components
• Frontend Client:
• “Frontend” module as the client-side component.
• That it is a React application (with Vite as the build tool, TypeScript for static typing, and various components such as NavBar, LoginModal, ReservationFilter, etc.).
• Role: handling user interactions, rendering views (pages like Landing, AddReservation, Reservations, etc.), and making API calls.
• API Gateway/Communication:
• A label for “API Endpoints” that correlate with the routes defined in the Backend (AuthRoute, AdminRoute, UserRoute, CommonRoute, pageRoute).
• Backend Server:
▸ Routers – which map HTTP endpoints to their corresponding Controllers.
▸ Controllers – that manage incoming requests, validate data (possibly using common middlewares such as the logging middleware), and delegate business logic to Services.
▸ Services – dedicated modules (e.g., AuthService, UserService, PageService, etc.) that encapsulate business logic.
▸ Utility Modules – including token management, data validation (e.g., deepValid), response formatting, and MongoDB connection (in the utils folder).
• You may also note that the Backend follows an architectural pattern that separates abstract classes (base Controller, Route, Service) from concrete implementations.
• Database:
• MongoDB database as a separate component.
• Collections to be created and used (admins, dish_washers, reservations, users) which are configured via MongoDB schemas.
• Connection from the Backend to MongoDB (using the MongoDB utility and the ORM schemas under the “orm/schemas” folder).
Relationships & Data Flow
• From the Frontend → API (HTTP/REST calls).
• From the API to the Backend’s Controller → Service layers.
• Finally, from the Backend to the MongoDB database (and vice versa for responses).
• That the Frontend consumes APIs defined in the Backend’s API documentation (API.md) and that any authentication or session management is managed via the token utils.
Architectural Patterns & Design Principles
• MVC-like design pattern implemented in the Backend (Controllers manage routes, while Services encapsulate business logic).
• Component-based architecture on the Frontend (utilizing React components and context hooks for state management).
• Mention the use of environment configurations (via .env files in both Frontend and Backend) which allow the system to adapt to different environments.
• Separation of concerns: UI rendering is cleanly separated from server-side data processing, and further, server-side business logic is separated into distinct service modules.
Relevant Technologies & Frameworks
• Frontend: React, Vite, TypeScript, and CSS (for style management).
• Backend: Node.js, TypeScript, Express-style routing, and industry-standard middlewares.
• Database: MongoDB (including its collections and JSON-based configuration).
• Utilities and Build tools: Webpack and custom scripts for development, along with configuration files like tsconfig.json.
Implementation
• The main UI components and context providers (e.g., DishWashersContext, ReservationsContext, UserContext).
• The routing module (ProtectedRoute, router configuration).
• Routers – mapping URLs to controllers.
• Controllers – for handling different domain functions (Auth, Admin, User, Page, etc.).
• Services – encapsulating business logic.
• Utilities & ORMs – showing the connection modules to MongoDB and utility functions.
• Optional: