How vishnuvinay89/all-saas-learner-ai-services works
Project type and purpose
• This is a NestJS-based, server-side TypeScript application acting as a REST API backend.
• It’s structured as a modular monolith: two domain modules (MongoDB and MySQL), both exposing “scores” endpoints plus shared configuration and caching.
• The project is containerized via Docker/Docker-Compose and tested with Jest (unit and e2e).
File structure
• Top-level:
• Dockerfile & docker-compose.yml – container definitions and multi-container orchestration (app, MongoDB, MySQL).
• nest-cli.json, tsconfig*.json – Nest/TypeScript build configs.
• .github/workflows – CI pipelines for dev/prod.
• src/:
• app.module.ts, main.ts – Nest entry point and root module.
• config/ – abstraction of environment-driven DB connection configs.
• mongodb/ – module for MongoDB: schemas (Mongoose), DTOs, controller, service, plus caching submodule.
• mysql/ – module for MySQL: entities (TypeORM), DTOs, controller, service.
• test/ – end-to-end tests and Jest config.
README for additional insights
• Technology stack: Node.js, NestJS, Mongoose, TypeORM, Docker.
a. Main components
• Client / API consumer (e.g., frontend or Postman)
• NestJS Application
– HTTP Server (Express under the hood)
– AppModule (root)
• ConfigModule (env config for MongoDB + MySQL)
• MongoModule
– Mongoose schemas (assessmentInput, scores, logs, mapping)
– CacheService (in-Mongo caching)
– ScoresController & ScoresService
• MySQLModule
– TypeORM entities (score)
– ScoresController & ScoresService
• External resources
– MongoDB instance (container)
– MySQL instance (container)
b. Relationships & interactions
• Client → HTTP Server → Controllers
• Controllers → Services → Database adapters (Mongoose or TypeORM)
• Services use ConfigModule for connection settings
• CacheService used by Mongo services for temporary storage
• Docker-Compose glues Nest app, MongoDB, MySQL in one network
c. Architectural patterns & design principles
• Modularization (Nest Modules) separating domain concerns (Mongo vs. MySQL)
• Dependency Injection (services injected into controllers, config injected into modules)
• Repository pattern via Mongoose models & TypeORM repositories
• 12-factor principles: config via env, containerization
d. Key technologies & libraries
• NestJS (modules, controllers, providers)
• Mongoose (MongoModule, schemas, DTOs)
• TypeORM (entities, repositories)
• Docker & Docker-Compose
• Jest for unit/e2e testing
• GitHub Actions (.github/workflows) for CI