How hknsh/project-knedita works
Main components
• API Server: Represented by the NestJS application using Fastify as the HTTP adapter. This is your central coordinator where all requests are processed.
• Modules/Features: Break down the application into its core modules, such as:
• Auth Module (handles authentication with JWT, local strategies, and possibly guards)
• Kweeks Module (managing posts, comments, attachments, and related business logic)
• Users Module (responsible for user operations and profile management)
• Common/shared services (e.g., Prisma integration, S3 service for file storage, custom validators)
• PostgreSQL: Your relational database managed by Prisma migrations.
• Redis: Likely used for caching or session management.
• MinIO: Used as a S3-compatible object storage solution.
• Infrastructure Components: Docker components (Dockerfile, docker-compose setups) that manage container orchestration and deployment environments.
Relationships and interactions
• Inside the application, request routing directs traffic to the respective modules (e.g., Auth, Kweeks, Users) using their controllers.
• The application’s business logic (inside services) then interacts with external systems:
• The Prisma service makes queries/transactions against PostgreSQL.
• The S3 (or MinIO) service handles file management.
• Redis is accessed for caching or pub/sub events (e.g., notifications).
• Optionally, include connections between modules if they depend on one another (like using a shared user service in both auth and kweeks).
Architectural patterns/design principles
• Modularity: Each domain (auth, kweeks, users) is encapsulated in its own module, promoting separation of concerns.
• RESTful design: Controllers are structured to expose endpoints that follow RESTful conventions.
• Infrastructure as Code: Docker and docker-compose are used to define environment settings and service orchestration.
• Database Migrations: Prisma schema and migration directories underline a versioned and managed approach to database evolution.
Relevant technologies and frameworks
• NestJS and Fastify – mark these as the core frameworks for handling HTTP requests and server logic.
• Prisma – denote this as the ORM facilitating communication with PostgreSQL.
• PostgreSQL, Redis, MinIO – Represent these as the key external systems integrated via Docker.
• Other tools: Swagger for API documentation, TypeScript for language features, and Docker for containerization.