How jsanchezl12/apis_miso works
Main Components & Their Roles
• API Gateway / Entry Point: Represent the primary NestJS application (main.ts) that routes incoming requests.
• Authentication Module: Highlight the auth module, JWT and local strategies, and the associated guards, showing how they protect the API endpoints.
• Domain Modules: For each business domain (culturagastronomica, gastroculture_pais, gastroculture_producto, gastroculture_receta, gastroculture_restaurante, ingrediente, pais, producto, receta, region, restaurante, and user) create separate nodes. These modules include controllers (for REST), resolvers (for GraphQL), DTOs, entities, and services. This division underlines the modular architecture and separation of concerns.
• GraphQL Layer: Indicate that many modules expose GraphQL resolvers and that there is a GraphQL schema (src/schema.gql) that underpins these endpoints. This layer acts as an alternative API interface alongside REST.
• Shared Utilities & Interceptors: Show a shared module that includes error handling, security constants, and testing utilities that are common across the project.
• External Integrations: Include external systems such as the continuous integration tools (Jenkins, SonarQube) and client API testing collections (Postman collections) which are used for validation and monitoring. These highlight the CI/CD and testing pipeline.
• Database Interaction (if applicable): Although the files don’t show a dedicated database folder explicitly, the presence of entity and seeding scripts indicates that a database is integrated. Represent a “Database” node that interacts with the domain modules via repositories or ORM layers.
Relationships & Interactions
• Internal Dependencies: Indicate that shared utilities, interceptors, and error handlers are used across modules (a common “shared” component connected to all business modules).
• CI/CD Pipeline: Optionally, include a side note that the project integrates automated test suites (unit tests and JMeter tests), and that Jenkins and SonarQube monitor code quality and deployments.
Architectural Patterns & Design Principles
• Modular Architecture: Emphasize that each domain is isolated within its own module – promoting separation of concerns, scalability, and maintainability.
• Layered Design: The structure follows a typical layered approach with a presentation layer (controllers/resolvers), business logic layer (services), and a data-access layer (entities, and scripts for database operations).
• Security and Testing: Highlight the use of guards, strategies, and testing utilities, underscoring best practices in secure and reliable API design.
• Branch out from the API gateway to separate components:
• Authentication Layer (with JWT/Local strategies)
• GraphQL API Router (with resolvers and schema)
• API endpoint handlers (controllers/resolvers)
• Business logic (services)
• Auxiliary components (shared errors, interceptors, utilities)
• Side notes or legends indicating CI/CD integrations and testing aspects.