Move Smarter. Deliver Faster.
SwiftRoute is a logistics & delivery operations center (MERN) with role-based dashboards, shipment tracking (timeline + live updates), and Google Maps.
client/(React 18 + Vite + Tailwind + Framer Motion)server/(Node.js + Express + MongoDB + Mongoose + Socket.IO)
- Node.js (v18+ recommended)
- MongoDB (local or Atlas) reachable from your machine
- Google Maps API key (optional but recommended for map views)
Copy the example env files:
copy server\.env.example server\.env
copy client\.env.example client\.envThen fill in:
server/.envMONGODB_URI(your MongoDB connection string)JWT_ACCESS_SECRET,JWT_REFRESH_SECRETCLIENT_URL(frontend origin, e.g.http://localhost:5173)- (optional)
RATE_LIMIT_WINDOW_MS,RATE_LIMIT_MAX
client/.envVITE_API_URL(e.g.http://localhost:5225)VITE_SOCKET_URL(e.g.http://localhost:5225)VITE_GOOGLE_MAPS_API_KEY(Google Maps key)
From the project root:
npm run devThis starts both backend and frontend (single command).
The project includes a dev seed script that inserts realistic demo data:
- users (admin, merchants, drivers)
- merchants, drivers, vehicles
- orders, shipments, tracking timeline events
- payments
To seed your database:
cd server
npm run seedAfter seeding, you can log in and view the dashboards immediately.
The seed script uses this demo password for all seeded users:
- Password:
Admin@123
Seeded user emails (default set):
- Admin:
admin@swiftroute.com - Merchants:
merchant1@swiftroute.com,merchant2@swiftroute.com - Drivers:
driver1@swiftroute.com,driver2@swiftroute.com
- Public
- Landing:
/ - Public tracking:
/track/:trackingId
- Landing:
- Auth
- Login:
/login
- Login:
- Admin (role:
admin)- Dashboard:
/admin - Manage shipments:
/admin/shipments - Manage users:
/admin/users - Manage merchants:
/admin/merchants - Manage drivers:
/admin/drivers - Manage vehicles:
/admin/vehicles - Manage orders:
/admin/orders
- Dashboard:
- Merchant (role:
merchant)- Dashboard:
/merchant - Create order:
/merchant/create-order - My orders:
/merchant/orders - My shipments:
/merchant/shipments
- Dashboard:
- Driver (role:
driver)- Dashboard:
/driver - Assigned deliveries:
/driver/deliveries - Delivery detail:
/driver/delivery/:id - Profile:
/driver/profile
- Dashboard:
- All API routes are under:
/api/v1 - Response shape is standardized as:
{ "success": true, "message": "Success", "data": {} }Live events are enabled via Socket.IO:
- Backend broadcasts/clients subscribe to:
driver_location_broadcastshipment_updatedelivery_completed
Admin and Driver dashboards listen for these events to keep shipment status/timeline in sync.
- Never commit real secrets. Keep JWT secrets and DB credentials in
.env. - If Google Maps is not configured, the map components show friendly placeholders.