Zariya is a production-grade, AI-orchestrated service booking and discovery platform designed for regional utility markets (e.g. Pakistan). It enables intelligent dispatch routing, real-time agent-driven orchestration, automated notifications, interactive maps, and role-based management dashboards.
- Frontend: React (v19) + Vite (v6), Tailwind CSS (v4), Framer Motion, Leaflet Maps.
- Backend: Node.js + Express, JWT authentication, Helmet security, CORS policies, Rate limiting.
- Database: MongoDB via Mongoose (with automated fallback to local JSON database files).
- Email Notifications: Nodemailer supporting Ethereal testing and production SMTP (SendGrid/AWS SES).
# Clone the repository and navigate to root directory
cd Zariya-AI-Orchestration
# Install dependencies
npm installCreate a .env file in the root directory:
# Server Configuration
PORT=3001
NODE_ENV=production
# Security & Authentication
JWT_SECRET=your_production_jwt_secret_key_string
ALLOWED_ORIGINS=https://your-frontend-domain.vercel.app,http://localhost:3000
# Database Configuration (Optional - Falls back to local JSON if blank)
MONGODB_URI=mongodb+srv://<username>:<password>@cluster.mongodb.net/zariya?retryWrites=true&w=majority
# Email Configuration
# Supported providers: ethereal | smtp | sendgrid | gmail | mailgun
EMAIL_PROVIDER=ethereal
SMTP_FROM="Zariya Services" <no-reply@zariya.pk>
# Default/SMTP Settings (For ethereal or smtp provider)
SMTP_HOST=smtp.ethereal.email
SMTP_PORT=587
SMTP_SECURE=false
SMTP_USER=your_smtp_user
SMTP_PASS=your_smtp_pass
# SendGrid Configuration (Active when EMAIL_PROVIDER=sendgrid)
SENDGRID_API_KEY=SG.your_key_here
# Gmail SMTP Configuration (Active when EMAIL_PROVIDER=gmail)
GMAIL_USER=your_email@gmail.com
GMAIL_PASS=your_gmail_app_password
# Mailgun Configuration (Active when EMAIL_PROVIDER=mailgun)
MAILGUN_HOST=smtp.mailgun.org
MAILGUN_PORT=587
MAILGUN_SECURE=false
MAILGUN_USER=postmaster@yourdomain.com
MAILGUN_PASS=your_mailgun_password
# AI API Key (Required for autonomous agents processing)
GEMINI_API_KEY=your_gemini_api_key_hereEvery request/response cycle is logged to stdout in standard JSON format:
{"timestamp":"2026-05-20T05:29:09.123Z","method":"POST","path":"/api/bookings","status":201,"durationMs":124,"ip":"::1","userAgent":"Mozilla/...","userId":"usr_cust_1"}GET /health- Displays database status (MongoDB / Firestore), uptime, memory consumption, and runtime mode.
- Return Schema:
{ "status": "OK", "timestamp": "2026-05-20T05:29:09.123Z", "uptime": 120.45, "memoryUsage": { ... }, "env": "production", "database": { "mongodb": "CONNECTED", "firebase": "INACTIVE", "localFallback": "STANDBY" } }
A cross-platform Node script is available to back up both local files and MongoDB database records:
# Execute local database extraction & filesystem backup
node backup.jsThe script will output collections as timestamped files under the backups/ directory.
The project includes vercel.json to handle React SPA routing.
- Connect your repository to Vercel.
- Set the build command to
npm run build. - Set the output directory to
dist. - Configure the environment variable:
VITE_API_URL: Your deployed backend URL (e.g.https://zariya-api.onrender.com/api).
The project includes render.yaml for Render Blueprint deployments.
- Link your repo to Render.
- Apply the Blueprint config from
render.yamlor create a new Web Service:- Environment:
Node - Build Command:
npm install && npm run build - Start Command:
node server.js
- Environment:
- Add the required environment variables (
JWT_SECRET,GEMINI_API_KEY, etc.).
Deploy the stack locally using Docker Compose, which spins up the Express server and a local MongoDB instance.
# Start the production container suite in background
docker compose up --build -d
# Check service logs
docker compose logs -f
# Shut down the stack
docker compose down -vAll protected routes require the header Authorization: Bearer <JWT_TOKEN>.
POST /api/auth/register- Payload:
{ "email": "str", "password": "str", "name": "str", "role": "customer|provider", "specialty": "str (optional)" }
- Payload:
POST /api/auth/login- Payload:
{ "email": "str", "password": "str" } - Response:
{ "token": "JWT", "user": { ... } }
- Payload:
POST /api/bookings(Protected)- Creates a new booking and triggers emails.
- Payload:
{ "bookingId": "str", "provider": { ... }, "customerContact": "str", "intent": { ... } }
GET /api/bookings(Protected)- Returns bookings filtered by user role.
PATCH /api/bookings/:bookingId/status(Protected)- Update status (
Pending,Confirmed,Completed,Cancelled). - Payload:
{ "status": "Confirmed" }
- Update status (
To perform manual integration tests, use the following pre-seeded test accounts:
| Role | Password | Details | |
|---|---|---|---|
| Customer | customer@zariya.pk |
password123 |
Can query intents, check trust indicators, and book providers. |
| Provider | provider@zariya.pk |
password123 |
Can toggle availability, view assigned orders, and update statuses. |
| Admin | admin@zariya.pk |
password123 |
Can view all platform bookings and monitor registered users. |