How wignn/rpl-prod works
Project type and purpose
• This is a full-stack web application comprising:
• A NestJS backend (API server and business logic)
• A Next.js frontend (React-based UI)
• A Node.js “client” service for WhatsApp API integration
• A PostgreSQL database
• Supporting infrastructure: Docker Compose networking, Caddy reverse proxy, Prometheus metrics, k6 load-testing
File structure
• Top-level services (defined in compose.yaml):
• backend/ – NestJS monolith (controllers, services, Prisma schema & migrations, guards, middleware)
• frontend/ – Next.js app (app directory, API routes for NextAuth, components, lib utilities)
• client/ – standalone Node.js service for WhatsApp/Twilio integration
• db – Postgres container (not in file tree but in compose.yaml)
• caddy – reverse proxy (Caddyfile at root)
• prometheus/ & k6/ – monitoring and load-testing scaffolding
• Key patterns:
• Modular NestJS structure (facility, finance, rent, report, room, etc.)
• Prisma ORM for DB access
• NextAuth for authentication flows in Next.js
• Dockerfiles and compose.yaml orchestrate containerized deployment
README insights
• Services overview confirms tech stack and responsibilities:
• NestJS handles business logic, JWT guards, error filters, file uploads
• Next.js serves SSR/SSG pages and client API routes
• Client service connects to external WhatsApp APIs for notifications/bots
• PostgreSQL holds all persistent data, managed via Prisma migrations
• Load Balancer / Reverse Proxy (Caddy)
• Frontend (Next.js container)
• Backend API (NestJS container)
• WhatsApp Integration Service (Node.js “client” container)
• Database (PostgreSQL)
• Monitoring (Prometheus server)
• Load-testing (k6) – optional, can be shown as external tool
• File Storage (backend/uploads volume)
• Users ↔️ Caddy → Frontend (HTTP/HTTPS)
• Frontend → Backend API (REST calls, NextAuth token flow)
• Backend API ↔️ PostgreSQL via Prisma client
• Backend API → WhatsApp Service (push requests or via message queue if implemented)
• WhatsApp Service ↔️ External WhatsApp/Twilio APIs
• Backend API → Prometheus client endpoints → Prometheus server (metrics scraping)
• k6 → Caddy/frontdoor (load testing traffic)
c. Architectural patterns & design principles:
• Modular monolith on the backend using NestJS modules & DI
• Clear separation of concerns: UI, business logic, integration service
• Container-based deployment with Docker Compose networking (app-network)
• Infrastructure as code for reverse proxy and monitoring
d. Key technologies & frameworks:
• Frontend: Next.js, React, NextAuth, TypeScript
• Backend: NestJS, Prisma ORM, PostgreSQL, JWT guards, middleware, pipes
• Client: Node.js service calling WhatsApp/Twilio APIs
• DevOps: Docker, Docker Compose, Caddy, Prometheus, k6