MangaSokağı: Type-Safe NestJS & Prisma Backend Architecture
A modular NestJS REST API engineered on strict dependency injection (DI) and end-to-end type safety, serving as the core transaction engine for the MangaSokağı e-commerce platform.
Performance & metrics
- Optimized memory allocation achieved by leveraging NestJS's Dependency Injection (DI) to manage service instances as Singletons
- Advanced database connection pooling and query batching managed directly by the Rust-based Prisma Query Engine
- High-throughput network I/O sustained by offloading heavy business logic into isolated, asynchronous Service layers
Why I built it
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
- Strict architectural decoupling of Controller and Business Logic layers (Separation of Concerns)
- Endpoint-level JWT authorization enforced by custom execution context interceptors (
auth.guard.ts) - Compile-time error catching and memory-safe database queries via Prisma ORM's auto-generated client
- Deterministic database seeding module for automated environment initialization and CI/CD pipelines
- Optimized Docker containerization for highly portable and scalable microservice deployments
Technical review
This project demonstrates an enterprise-grade backend architecture tailored for robust e-commerce platforms. Security countermeasures like the AuthGuard act as low-level interceptors, aggressively dropping unauthorized payloads before they consume controller-level memory allocation. Furthermore, the Prisma-generated client entirely eliminates human error in Data Transfer Objects (DTOs), functioning as an immutable contract that prevents backend schema refactors from silently breaking frontend components.
Related projects
Strawberry & Sugar: High-Performance Actix-Web & SQLx API
A high-performance Rust backend built on Actix-Web and SQLx, featuring compile-time query verification, Argon2 hashing, and strict role-based access control (RBAC).
- Rust
- SQL
- Actix-Web
- +5
ASPCommerce API
A robust HTTP/1 RESTful API backend for an e-commerce platform, featuring encrypted user authentication, product management, and cross-origin (CORS) access.
- C#
- ASP.NET 7
- MySQL
- +1

Major project
Mavi Bahçem: A Static Next.js Blog with a PHP/MySQL Admin Panel
mavibahcem.com: my personal blog about anime, manga, books, Studio Ghibli and engineering. The frontend is a fully static Next.js site; reader cards, comments, the Garden Board, the guestbook, the newsletter, Discord announcements and the admin panel run on a lightweight PHP/MySQL API on shared hosting.
- TypeScript
- PHP
- SQL
- +10
Need something similar?
I can build a system like this for you, too.
Describe your project in a few sentences, and we'll work out the right approach and an estimated scope together.