Architecture Review

ជំពូកនេះមិនទាន់ត្រូវបានបកប្រែជាភាសាខ្មែរនៅឡើយទេ — សូមអានជាភាសាអង់គ្លេសខាងក្រោម។

Table of Contents

  1. The Final Project Structure
  2. The Request Lifecycle
  3. What We Deliberately Skipped
  4. Where to Go Next

1. The Final Project Structure

src/
├── generated/
│   └── prisma/          # generated Prisma Client (gitignored)
├── prisma/
│   ├── prisma.module.ts
│   └── prisma.service.ts
├── tasks/
│   ├── dto/
│   │   ├── create-task.dto.ts
│   │   └── update-task.dto.ts
│   ├── tasks.controller.ts
│   ├── tasks.service.ts
│   └── tasks.module.ts
├── app.module.ts
└── main.ts

prisma/
└── schema.prisma

prisma.config.ts

Every file here was built incrementally, in this order:

PartAdded
1The project itself, main.ts
2tasks.module.ts
3tasks.controller.ts
4tasks.service.ts (in-memory)
5dto/, ValidationPipe
6prisma/, prisma.config.ts, tasks.service.ts rewritten against Prisma
7NotFoundException / ConflictException usage
8Swagger UI at /api

2. The Request Lifecycle

Full request lifecycle from request to database and back

Every request into /tasks now travels the same path:

Request → Controller → DTO Validation → Service → PrismaService → PostgreSQL → Service → Controller → Response

This is the core idea to take away from this whole crash course: Nest isn't a pile of decorators to memorize — it's this one consistent flow, with a clear, single-responsibility layer for each step.

3. What We Deliberately Skipped

This was a 1-hour crash course, not the whole framework. Left out on purpose, each worth its own dedicated learning time:

Guards, interceptors, middleware, pipes in depth, custom decorators, authentication/JWT, authorization/RBAC, WebSockets, microservices, queues, caching, testing, GraphQL, file upload, advanced database patterns.

4. Where to Go Next

If you want to go from "I can build a small API" to "I can build a production-style e-commerce API, live, with a cohort" — including proper authentication, authorization, payments (Bakong), and deployment (Sabay Cloud) — that's exactly what the paid, live cohort this crash course funnels into covers, over 3 months.

ទិញកាហ្វេជូនខ្ញុំ

ចូលចិត្តមេរៀននេះមែនទេ? សូមពិចារណាទិញកាហ្វេជូនខ្ញុំមួយកែវ ដើម្បីគាំទ្រការបង្កើតមាតិកាឥតគិតថ្លៃបន្ថែមទៀត!