How mdozairq/ott-platform works
Project type and purpose
• This is a backend‐only monolithic service (“OTT Platform”) built with Nest.JS (TypeScript) exposing REST endpoints, persisting data in MongoDB, and packaged/deployed via Docker Compose. There is no frontend in this repo; clients interact over HTTP (e.g., Swagger UI or mobile/web apps).
High‐level components
a. External clients (API consumers, Swagger UI)
b. Load Balancer / API Gateway (optional)
c. Docker Compose orchestration
• NestJS application container
• MongoDB container
d. Nest Application (one container)
• Config Module (env & secrets)
• Common Module (response interceptor)
• Health Module (liveness/health check)
• JWT Module (token generation & validation)
• Role Module (guards & decorators)
• Users Module
• Movies Module
• TV Shows Module
• My-List Module
• Error Handling Module
e. Persistence Layer
• MongoDB (collections: users, movies, tvshows, myLists)
f. External or future services (e.g., Payment, Caching, Message Queues)
Interactions & data flow
• Client → (LB/Gateway) → NestJS Controller
• Controller → Service → Repository (Data Access)
• Repository → MongoDB (CRUD)
• JWT Module issues/verifies tokens on protected endpoints
• Role Module enforces RBAC guards in controllers
• Health Module returns ✔/✖ for liveness probes
• Docker Compose links NestJS & MongoDB via network
Architectural patterns & design principles
• Layered (Controller → Service → Repository)
• Modular (NestJS Modules per domain)
• Dependency Injection (built-in NestJS DI container)
• Cross-cutting concerns in dedicated modules (Config, Common/Interceptor, Errors, JWT, Role)
• Future extensibility via new modules or microservice extraction
Technologies & frameworks
• NestJS (TypeScript)
• MongoDB (NoSQL)
• Docker & Docker Compose
• Swagger (OpenAPI auto-docs)
• Jest (e2e & unit tests)
• ESLint/Prettier (code quality)
• Migrations (seed JSON files)