How bambadiagne/simple_blog works
Main Components
• Frontend: The Angular application housed in the “frontend” directory.
• Backend: The NestJS API in the “backend” directory structured with several modules (e.g., Auth, Posts, Comments, Users, Database, Logger, Code Verification, Common services including mailing and storage).
• Database: PostgreSQL as referenced in the README with Prisma migrations and schema located in backend/prisma/.
• External Services:
• AWS S3 (Storage service)
• AWS SES (Mailing service)
• Docker environment for container orchestration (docker-compose file).
• Additional Configurations: Environment variables, Dockerfiles, and configuration files which support deployment and runtime configurations.
Representing the Relationships and Interactions
• The Frontend communicates with the Backend via HTTP calls (REST/JSON).
• The Backend handles authentication (JWT, refresh tokens) and routes user requests to the respective controllers (e.g., posts, comments, users).
• The Backend uses Prisma to interact with the PostgreSQL database.
• The mailing service (using AWS SES) and file storage service (using AWS S3) are invoked by dedicated modules/services within the backend.
• Docker containers encapsulate the frontend, backend, and database dependencies, enabling a consistent deployment environment.
• The authentication module in the backend interacts with guards and strategies for JWT and local authentication.
Architectural Patterns and Design Principles
• Modular Architecture: Both projects are separated into modules; each module encapsulates features (Authentication, Posts, Comments, etc.), facilitating separation of concerns.
• MVC-like Separation within NestJS: Controllers handle HTTP requests, services implement business logic, and modules orchestrate the application.
• Containerization and Deployment: Dockerfiles for both frontend and backend, along with docker-compose, underscore the use of containerization for deployment consistency.
• Use of SOLID Principles: The backend clearly separates services, controllers, strategies, and DTOs to adhere to best practices for maintainability and testability.
Relevant Technologies and Frameworks
• Angular: For the frontend UI and client-side routing.
• NestJS: For the backend API, controllers, services, and module-based architecture.
• PostgreSQL and Prisma: For the database layer and database migrations.
• AWS (S3 & SES): For external storage and email services.
• Docker: For containerization, with individual Dockerfiles and a docker-compose configuration.
• Various code quality tools like ESLint and Prettier that enforce best practices.
• Frontend → Backend: API requests/responses.
• Backend ↔ Database: CRUD operations.
• Backend → AWS S3/SES: External service calls.
• Docker container boundaries showing each component's deployment context.
• Presentation layer (Angular),
• Application layer (NestJS modules and services),
• Data layer (PostgreSQL/Prisma), and
• External services (AWS S3, AWS SES).
• Annotations: Optionally annotate to highlight design aspects (e.g., "JWT Authentication", "REST API endpoints", "Service Modules").