How alad1n0/project-back works
Project type and purpose
• This is a NestJS–Prisma backend API (no frontend code).
• Purpose: Support a restaurant-ordering platform with features for users, restaurants, products, categories, baskets, favorites, ratings, promotions, FAQs, and OTP-based authentication.
File structure
• Top-level: Nest config (nest-cli.json), TypeScript setup (tsconfig.json), Prisma schema & migrations (prisma/), source code (src/), tests (test/).
• src/ is organized into Nest modules: auth, users, restaurants, categories, product, basket, favorites, rating, service/otp, config, plus shared helpers and middleware.
• prisma/ contains:
• schema/ (modular .prisma files per domain entity)
• migrations/ (SQL migration history)
• seed/ scripts that prepopulate the database.
• No separate frontend—monolithic backend with modular architecture.
README
• Confirms this is a NestJS TypeScript starter extended for a food-ordering domain.
a. Main components
• Client (mobile/web) – HTTP/HTTPS requests
• NestJS Application
– Modules: Auth, Users, Restaurants, Categories, Products, Basket, Favorites, Ratings, Promotions, FAQ, OTP Service
– Shared layers: Controllers (entry points), Services (business logic), DTOs (validation), Middleware (JWT), Helpers
• Prisma Client (ORM)
• Database (e.g. PostgreSQL)
• External SMS/OTP Provider (Infobip)
b. Relationships & interactions
• Client → HTTP → Controllers → Services → Prisma Client → Database
• Auth module uses OTP Service → External SMS Provider
• Services may call other services (e.g. Basket service reads Products, Users, Restaurant details)
• Seed scripts populate Database before app start
c. Architectural patterns & principles
• Modular organization: each domain in its own Nest module
• MVC-style flow within each module (Controller → Service → Data Layer)
• Layered separation: HTTP layer, business-logic layer, ORM/data layer
• Single point of DB access via Prisma service
d. Key technologies
• NestJS (Modules, Controllers, Services, Middleware)
• TypeScript
• Prisma ORM + migrations + seed scripts
• PostgreSQL (or another SQL DB)
• Infobip SMS API for OTP