Node.js + Express API for CatalogX.
- Runtime: Node.js
- Language: TypeScript
- Database: PostgreSQL (pg)
- Cache: Redis (ioredis)
- Auth: JWT + Bcryptjs
- Validation: Zod
graph TD
Request[HTTP Request]
Router[Express Router]
Auth[Middleware - Auth]
Validators[Middleware - Zod Validation]
Controller[Controllers]
Service[Services]
Database[(PostgreSQL)]
Redis[(Redis Cache)]
Request --> Router
Router --> Auth
Auth --> Validators
Validators --> Controller
Controller --> Service
Service --> Database
Service --> Redis
cd backendnpm install- Configure
.env(use.env.exampleas template) npm run buildnpm run dev
POST /auth/register: Register a new user.POST /auth/login: Login and get JWT.GET /products: List products (cached).GET /products/:id: Get product detail (cached).POST /products: Create product (Auth required).PUT /products/:id: Update product (Auth required).DELETE /products/:id: Deactivate product (Auth required).