How aldotestino/vctmang works
Main architectural components
• Frontend (client/)
• React.js + TypeScript single‑page app built with Vite
• Uses Chakra‑UI for styling
• Manages local state (Zustand stores in src/store)
• Communicates with backend via REST and Socket.io
• Backend (server/)
• Node.js + Express.js HTTP API
• Socket.io for real‑time updates
• Controllers (src/controllers/*) implement business logic (orders, menu, users)
• Prisma ORM (src/lib/prisma.ts + schema.prisma) for database access
• Seeds initial data (seed.ts) and exposes public images (src/public/images)
• Database
• MongoDB Replica Set (mongodb_replica/) for high availability
• Configured via Dockerfile in mongodb_replica/
• Orchestration & Infrastructure
• docker‑compose-dev.yml / docker‑compose.yml define three services:
– client (frontend container)
– server (API container)
– mongodb (replica set container)
Interactions and data flows
• Client → Server (HTTP REST): CRUD operations on menu, orders, users
• Server → Client (WebSocket via Socket.io): realtime order status, cook/admin notifications, transaction updates
• Server → MongoDB: queries & mutations via Prisma
• Docker‑Compose: brings up all services on a common Docker network
Architectural patterns
• Full‑stack MVC‑style backend: controllers → services → database
• Single‑page application (SPA) frontend decoupled from backend
• Event‑driven real‑time layer (WebSocket) alongside REST API
• Containerization (Docker) and multi‑container orchestration