The Ambulance Booking System is a comprehensive web application designed to streamline ambulance booking and emergency response coordination. It features a dual-frontend architecture to cater to different user needs and a robust backend for real-time operations.
It allows patients and drivers to interact in real-time through a secure, intuitive, and responsive platform, ensuring faster medical assistance during emergencies.
The system connects seamlessly with the backend via REST APIs and Socket.io, providing real-time driver tracking, instant booking updates, and live trip status monitoring.
- 🧭 Unified Interface:
- Ambulance Booking App: A comprehensive Next.js application for both Users and Drivers.
- 🚑 Clients: Book ambulances, track drivers, and view booking history.
- 👨
✈️ Drivers: Log in, view assigned trips, and update trip statuses. - ⚡ Real-time tracking & communication: Powered by Socket.io & Google Maps API.
- 💬 Responsive design: Optimized for both web and mobile users.
Client Authentication
- Secure login and registration.
- JWT-based session management.
Driver Authentication
- Secure login with hashed passwords (bcrypt).
- JWT-based authentication & route protection.
- Clients can book ambulances with pickup & destination details.
- System finds the nearest available driver.
- Real-time trip updates: Requested → Accepted → In Progress → Completed → Cancelled.
- Booking history stored for both clients and drivers.
- Powered by Socket.io.
- Real-time updates for:
- Trip status changes.
- Driver location updates.
- Notifications for acceptance, arrival, or cancellations.
- View all bookings and statuses.
- Manage driver accounts.
- Monitor system analytics.
| Technology | Purpose |
|---|---|
| Next.js | Core frontend framework |
| Axios | API communication |
| Socket.io Client | Real-time updates |
| Google Maps API | Location tracking and map integration |
| Tailwind CSS | Styling and responsive layout management |
| Technology | Purpose |
|---|---|
| Node.js | JavaScript runtime for backend |
| Express | Web framework for building REST APIs |
| express-validator | Validate incoming request data |
| jsonwebtoken (JWT) | Authentication and route protection |
| cors | Enable cross-origin requests |
| bcrypt | Secure password hashing |
| MongoDB & Mongoose | NoSQL database and ODM |
| Socket.io | Real-time bidirectional communication |
- booking request → Triggered by client to request an ambulance.
- booking accept → Sent by driver upon accepting a booking.
- location update → Continuously transmits driver’s live location.
- trip status emits → Booking progress and completion updates.
- Node.js (v16 or later) → Download Node.js
- npm (comes with Node.js)
- Git → Download Git
- MongoDB → Download MongoDB or use MongoDB Atlas.
git clone https://github.com/praggCode/AMB_One.git
cd AMB_OneNavigate to the backend directory and install dependencies:
cd backend
npm installCreate a .env file in the backend directory with the following variables (example):
PORT=4000
DB_CONNECT=your_mongodb_connection_string
JWT_SECRET=your_jwt_secretRun the backend server:
npm run devNavigate to the frontend directory:
cd ../frontend
npm installRun the development server:
npm run devTo verify the system’s functionality:
- ✅ Test client login/signup.
- ✅ Test driver login/signup.
- ✅ Create and manage ambulance bookings.
- ✅ Monitor real-time booking status and driver tracking.
- ✅ Validate responsiveness across devices.
- ✅ Test Socket.io event flow (booking request → accept → complete).
- Frontend communicates with backend via
/api/...routes. - Uses Socket.io for instant updates between drivers and clients.
- Implements JWT-based authentication for secure requests.
- 📍 Advanced route optimization for drivers.
- 💳 Online Payment Integration (Razorpay / Stripe).
- 🏥 Hospital Dashboard for centralized booking management.
- 🔊 Voice Alerts for driver notifications.
- 📱 Mobile App version (React Native / Flutter).