Why Did I Build This?
"Standard Node.js/Express backends inherently lack architectural discipline and are highly prone to spaghetti code in complex e-commerce domains due to loose typing. To handle MangaSokağı's transaction volume and data integrity, I needed to establish an enterprise-grade API layer that strictly decouples controllers from business logic while enforcing rigorous compile-time type checking."
Architecture & Decisions
The system is built upon NestJS's modular architecture, distinctly isolating domains (`admin`, `auth`, `category`, `manga`, `user`). The security layer is enforced via `auth.guard.ts`, a JWT-driven Role-Based Access Control (RBAC) mechanism that intercepts requests at the lifecycle's edge. Database connectivity is managed exclusively through a globally injected `prisma.service.ts`. By leveraging Prisma's auto-generated client (`generated/prisma`), the architecture guarantees absolute end-to-end type safety from the database schema up to the HTTP response payload. The entire runtime is encapsulated using Docker for deterministic deployment isolation.
Key Features
- 01.Strict architectural decoupling of Controller and Business Logic layers (Separation of Concerns)
- 02.Endpoint-level JWT authorization enforced by custom execution context interceptors (`auth.guard.ts`)
- 03.Compile-time error catching and memory-safe database queries via Prisma ORM's auto-generated client
- 04.Deterministic database seeding module for automated environment initialization and CI/CD pipelines
- 05.Optimized Docker containerization for highly portable and scalable microservice deployments