Production backend for the Zia marketplace platform. This service exposes REST APIs, Socket.IO chat events, Stripe webhooks, background queue integrations, and Prisma-backed persistence.
- HTTP API: Express + route/controller/service layering
- Realtime: Socket.IO namespace for messaging and read receipts
- Persistence: PostgreSQL via Prisma
- Async processing: RabbitMQ queue service
- External providers: Stripe, AWS S3/SES, Google Maps, Gemini embeddings
- Single shared Prisma client to reduce connection churn
- Hardened socket auth/authorization flow (identity bound server-side)
- Raw-body Stripe webhook verification path
- Route-level code and service separation for easier scaling
- Dockerized runtime with multi-stage image builds
- Install dependencies:
npm install
- Configure environment:
cp .env.example .env
- Generate Prisma client and run app:
npm run build npm run dev
Use .env.example as the canonical template. Key groups:
DATABASE_URL,PORT,NODE_ENVJWT_SECRET,JWT_EXPIRES_INRABBITMQ_URLSTRIPE_SECRET_KEY,STRIPE_WEBHOOK_SECRETAWS_REGION,AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,AWS_S3_BUCKET_NAMEGOOGLE_MAPS_API_KEY,GEMINI_API_KEY,EMBEDDING_API_URL,EMBEDDING_MODEL
docker compose up --buildThis brings up:
backendservicepostgresdatabaserabbitmqbroker (+ management UI)
npm run dev- development runtime withtsxnpm run build- Prisma generate + TypeScript buildnpm run start- run compiled outputnpm run seed- run seed script
/api/users,/api/providers,/api/services,/api/categories/api/service-requests,/api/reviews,/api/notifications/api/payments(including/webhook)/api/confirmations,/api/schedule,/api/chatbot- Socket.IO namespace:
/messaging
- Run database migrations before startup in production.
- Ensure Stripe webhook endpoint receives raw JSON payload.
- Use strong
JWT_SECRETand rotate secrets per environment. - Restrict CORS and ingress by environment.
Licensed under ISC. See LICENSE.