How jossuejativa/proyectocapstone works
Project Type and Purpose
• This project is a full-stack web application designed to manage users, dishes, tables, allergens, ingredients, and orders.
• The backend is built with Django and Django REST Framework, exposing a RESTful API, while the frontend (in the “frontend” folder) is a client-side app built with TypeScript and Vite that communicates with the backend.
• A dedicated WebSocket service exists (in the “websocket” directory) that uses socket.io for real-time communication.
• Docker and Docker Compose are used to manage the database (PostgreSQL) and other services.
File Structure
• The “admincontroller” directory contains the Django project and applications (e.g., authAPI, dishesAPI). It includes typical Django project files such as settings, urls, and WSGI/ASGI, as well as migrations, tests, and static files.
• The “frontend” directory holds the client application code, assets, components, and pages. It is set up with TypeScript and Vite, and it uses modern React patterns (or similar).
• The “websocket” directory includes server-side WebSocket implementation with a clear structure – configurations, database initialization, models, and socket logic implemented in TypeScript.
• Configuration files such as Dockerfiles (for admincontroller and websocket) and docker-compose.yml show how various services are containerized.
a. Main Components to Include:
• Client (Frontend): Displays pages, handles client-side routing and interacts with the backend API. Differentiate between admin routes and web routes.
• Backend API (Admin Controller): A Django app exposing RESTful endpoints to manage users, dishes, tables, allergens, ingredients, and orders.
• Breakdown the Django portion into its core apps (authAPI, dishesAPI, etc.) if needed.
• WebSocket Service: A separate service running on Node/TypeScript with socket.io to handle real-time communication (order updates, notifications, etc.).
• Database: The PostgreSQL instance running via Docker Compose.
• Docker & Deployment Components: Containerization setup that integrates the backend, WebSocket service, and database.
b. Relationships and Interactions:
• The Frontend interacts with the Backend API via HTTP requests (secure endpoints using JWT tokens) and with the WebSocket server for live updates (using socket.io-client).
• The Backend communicates with the PostgreSQL database for persistent storage.
• The WebSocket service may also interact with the database if needed or with the backend service indirectly for order events.
• Docker Compose orchestrates the interconnections between containers (database, backend, WebSocket, potentially frontend for local development).
c. Architectural Patterns and Design Principles:
• Separation of Concerns: Clearly separate the frontend, backend API, and WebSocket service. Use RESTful API design principles on the backend.
• Microservices/Modularization: Even though the backend is monolithic (Django project), the segmentation into separate apps (authAPI, dishesAPI, etc.) helps modularize the business logic.
• Containerization: Emphasize use of Docker for replication and isolated environments.
• Client-Server Communication: Illustrate both stateless HTTP requests and stateful WebSocket communication.
d. Relevant Technologies:
• Django, Django REST Framework, and Python on the backend.
• PostgreSQL as the relational database.
• Docker and Docker Compose for orchestration.
• TypeScript, Vite, and React (or similar framework from the “frontend” folder) for the client.
• Socket.io for WebSockets in the “websocket” service.
Instructing the Principal Software Engineer
• Backend with the Database, and outline relationships (e.g., “saves user data”, “fetches orders”).
• Optionally, subdivide the backend into its constituent apps (authAPI, dishesAPI) to indicate modular boundaries.
• Ports and host details (e.g., API on localhost:8000, WebSocket on localhost:3000, PostgreSQL on localhost:5432), as provided in the README.
• Use of JWT for authentication in the REST API calls and the support for token refresh workflows.
Final Recommendations
• Detail the major components and how they interact; don’t leave out deployment aspects like Docker and the orchestration provided by docker-compose.
• Be as detailed as needed, breaking down services into as many components as makes sense for clear comprehension.