How community-vercel/ustaadpro-server works
UstaadPro is an Express/PostgreSQL backend for a mobile home-services marketplace, with a parallel WhatsApp booking and administration surface. The main customer flow is signup or login, browse/search the service catalog, then check out and review orders; the service model also represents work-price options and pricing modes. Other documented domains include addresses, shop, providers, complaints, and admin management. The tree and excerpts establish server mounting and selected integrations; unsampled routes and controllers are represented at domain level, without asserting their internal call wiring.
Main entry points: server.js Express Server · authController.js Auth Controller · botRoutes.js Bot Routes · Service.js Service Catalog
Components 28
Marketplace API
- Express Server
server.js - PostgreSQL
config/db.js
Catalog And Commerce
- Service Routes
routes/services.js - Service Controller
controllers/serviceController.js - Service Catalog
models/Service.js - Order Routes
routes/orders.js - Order Controller
controllers/orderController.js - Order Records
models/Order.js - Review API
controllers/reviewController.js - Search API
controllers/searchController.js - Commerce Domains
routes/shop.js
Identity And Messaging
- Auth Routes
routes/auth.js - Auth Controller
controllers/authController.js - User Records
models/User.js - OTP Records
models/AuthOtp.js - Email Sender
utils/mailer.js - SMS Sender
utils/sms.js
WhatsApp Booking
- Bot Routes
routes/botRoutes.js - Bot Controller
controllers/botController.js - Bot Service Catalog
services/whatsappService.js - Bot Booking API
controllers/botbookingController.js - Bot Service Routes
routes/botserviceRoutes.js - Bot Service Controller
controllers/botserviceController.js
Operations
- Admin API
controllers/adminController.js
Other components
- Mobile Client
- Email Provider
- SMS Provider
- Firebase Messaging
Connections 29
- Mobile Client → Express Server: sends API requests
- Express Server → Auth Routes: mounts auth API
- Express Server → Service Routes: mounts service API
- Express Server → Order Routes: mounts order API
- Express Server → Bot Routes: mounts bot API
- Express Server → Bot Service Routes: mounts bot services
- Auth Routes → Auth Controller: dispatches auth requests
- Auth Controller → User Records: reads and updates users
- Auth Controller → OTP Records: manages verification codes
- Auth Controller → Email Sender: sends email codes
- Auth Controller → SMS Sender: sends SMS codes
- Email Sender → Email Provider: delivers messages
- SMS Sender → SMS Provider: delivers messages
- Service Routes → Service Controller: dispatches catalog requests
- Service Controller → Service Catalog: queries catalog
- Service Catalog → PostgreSQL: reads catalog and pricing
- Order Routes → Order Controller: dispatches checkout requests
- Order Controller → Order Records: creates and lists orders
- Order Records → PostgreSQL: persists order data
- Express Server → Search API: mounts search API
- Express Server → Review API: mounts review API
- Express Server → Commerce Domains: mounts shop API
- Express Server → Admin API: mounts admin API
- Admin API → Firebase Messaging: sends push notifications
- Bot Routes → Bot Controller: dispatches bot controls
- Bot Routes → Bot Booking API: dispatches booking timeline
- Bot Service Routes → Bot Service Controller: dispatches service management
- Bot Service Catalog → Service Catalog: loads bot catalog
- Express Server → PostgreSQL: checks database