How willvillegas/proyecto-web works
Main Components Identification
a. Frontend (Angular):
• Angular application representing the user interface.
• Multiple feature areas such as movie pages, actor pages, login/signup components, and custom components (e.g., cards, filter components).
• Use of Angular Router for navigation and interceptors (JWT and auth error handling).
• Angular’s organization: core modules, shared components, and services that interact with the backend API.
b. Backend (Node.js/Express):
• Controllers (handling HTTP requests for movies, actors, and users).
• Services (business logic, e.g., movie.service, actor.service, user.service).
• Repositories (data access logic for models).
• Middlewares (auth, authorization, file upload handling with multer).
• Models and Interfaces (defining schema contracts for movies, actors, and users).
• Utilities (for authentication such as JWT, bcrypt, and database connections).
• That the backend is structured in two parts: a "src" folder (source code) and a "dist" folder for compiled JavaScript files.
c. Database (MongoDB):
• That the database stores documents for movies, actors, and users, with relationships (e.g., movies having casts of actors).
d. File Storage:
• “uploads” directory in the backend that stores images for movies and actors.
Relationships and Data Flow Between Components
• Backend middleware intercepting requests (authentication and authorization) before reaching controllers.
• Communication from the backend to the database (MongoDB) where schemas for movies, actors, and users are being managed.
• Optionally, show how the backend may serve static files (uploaded images) and API documentation endpoints (via Postman collection files available in the repository).
Important Architectural Patterns & Design Principles
• MVC-like pattern on the backend: separating controllers, services, repositories, and models.
• Clear separation of concerns in the frontend by organizing components (pages, dialogs, etc.) as Angular modules.
• Use of middleware in backend design for handling cross-cutting concerns like authentication and file uploads.
• RESTful API design for backend endpoints.
• Layered architecture that distinguishes between business logic (services), data access (repositories), and presentation logic (controllers).
Technologies, Frameworks, and Libraries
• Frontend: Angular, Angular Router, Tailwind CSS, and TypeScript.
• Backend: Node.js, Express, TypeScript, JWT for authentication, Bcrypt for password hashing, and Multer for file uploads.
• Database: MongoDB.
• Additional configuration tools and linters (e.g., ESLint for the backend).
Practical Steps
• Within the Backend block, create nested sub-components to indicate controllers, services, repositories, and middlewares.
• Within the Frontend block, detail significant Angular modules or feature areas (movies, actors, authentication).
• That the “uploads” folder and static file handling are represented as part of the backend’s responsibilities.