How willvillegas/proyecto-ds-equipo5 works
Main Components
• Frontend (Client):
• Contains the React application (pages, components, context providers, and API routing).
• Handles user interfaces, authentication views (login, password recovery, etc.), and different pages for managing content (activities, comments, plan work, etc.).
• Backend (Server):
• Implements REST APIs with Express.
• Organized into DAOs (data access objects) for database interaction, controllers for request handling, models including visitors and interfaces, and middleware.
• Utilizes helper utilities for tasks like generating tokens (jsonwebtoken), sending emails (nodemailer), and server time management.
• Database:
• MS-SQL is the central data store for user records, activity details, plan information, and notifications.
• External Services and Libraries:
• Express (for routing and server logic)
• nodemailer (for sending emails)
• Tailwind CSS (on the frontend for styling)
• Vite (for fast frontend builds)
• Netlify (cloud service for deployment of the client)
• MS-SQL (database engine to store and manage data)
Relationships and Interactions
• Frontend to Backend Communication:
• Use API calls (likely via REST routes defined in Client/apiRoutes.js) where user actions (login, registration, activity submissions, etc.) trigger HTTP requests to the backend.
• Server Internal Flow:
• Requests hit the appropriate routes (organized in the Server/routes folder).
• Routes call corresponding controllers (located in Server/controllers) which then delegate to DAOs (in Server/DAOs) for data interaction.
• Controllers incorporate middleware (from Server/middleware) for authentication and role-based access control.
• Database Layer:
• DAOs interact directly with the MS-SQL database (as evidenced by scripts.sql and the connection requirements).
• External Utilities:
• Usage of nodemailer for email notifications and utilities handling JSON web tokens for security.
Architectural Patterns and Design Principles
• MVC-like Structure:
• Clearly separated concerns (models, views on the client, controllers, and DAOs on the server).
• RESTful API design:
• Each resource (activities, professors, students, etc.) has its own route and controller.
• Modular Code Organization:
• Granularity in the code (multiple small components, context providers, and helper modules) promotes maintainability.
• Security Practices:
• User authentication (login, password recovery) as well as data encryption for passwords.
• Scalability:
• The separation between frontend and backend along with API-based communication makes it easier to extend functionalities without affecting system stability.
• At the top, include a “User Interface” block representing the end user interacting with the Client.
• A block for the React application, which includes sub-blocks such as “Pages”, “Components”, “Routes”, and “Context Providers”.
• Server:
▪ Top layer: “Routes” which then link to “Controllers”.
▪ Middle layer: “Controllers” calling logic for respective modules (e.g., Activity, Usuario, Profesor, etc.).
▪ Lower Layer: “DAOs” communicating with the “MS-SQL Database”.
• An additional middleware block intercepting incoming requests for authentication or role validation.
• From Client to Server: Show API calls.
• Inside Server: Show the flow from routes → controllers → models/DAOs → database.
• From Server back to Client: Response flows.
• External Tools:
• A note or separate block for “Deployment on Netlify” associated with the Client, and mention “Node.js (Express)” on the server side.