How kc1t/desafio-verzel works
Main Components
• Frontend Application: Represent the “screenli-cli” portion built with Next.js. Indicate pages such as login, registration, lists (create, view, and update), and movie details. Also include the use of components (e.g., Navbar, Footer, various UI components) and hooks for state management.
• Backend API: Represent the “screenli-api” portion implemented in Node.js. Break it down into sub-components as follows:
– Server Initialization: The entry point (server.ts and app.ts) where the server is configured.
– Configuration Layer: Show how configuration files (apiConfig.ts, db.ts) manage connections and environment settings.
– Controllers: Identify controllers like authController, listController, and movieController, handling the request logic.
– Routes: Represent the API routes grouped by functionality (authRoutes, listRoutes, movieRoutes).
– Services: Illustrate service modules (authService, listService, movieService) encapsulating business logic.
– Models: Mark the models (User, listModel, etc.) that define the data schema interacting with MongoDB.
• Database: Include MongoDB (via MongoDB Atlas) which interacts with the API for persisting user data, movie lists, and other dynamic content.
• External API Integration: Since the project relies on The Movie Database (TMDb) for movie data, denote the integration as an external service with directional data flow from the backend to TMDb.
Relationships and Interactions
• Within the backend, illustrate the interaction flow:
– API Routes receive HTTP requests and forward them to the appropriate Controllers.
– Controllers call Services, which may interact with Models (and, consequently, the Database) or external APIs.
– Middleware (specifically for authentication) intercepts requests to protect secure endpoints.
Architectural Patterns and Design Principles
• Modularization: The separation of concerns is evident – controllers, services, routes, and models are each isolated in separate directories.
• MVC-like Pattern: Although not a strict MVC implementation, the structure loosely mirrors an MVC pattern where controllers handle requests, services manage business logic, and models represent data.
• Client-Server: Emphasize the clear demarcation between the frontend client (Next.js) and the backend server (Node.js).
Relevant Technologies
• Frontend: Next.js, React, TailwindCSS, TypeScript.
• Backend: Node.js, TypeScript, MongoDB.
• Third-Party API: TMDb for movie data.
• Deployment/Hosting: The frontend is hosted on Vercel and the backend on Render.