A full-stack ride-hailing web application inspired by the concept of seamless urban mobility, built with a unique brand identity and modern tech stack.
- 🔐 Register & Login — Secure JWT-based authentication
- 🚕 Book a Ride — Select cab type (Car / Auto / Bike), enter pickup & drop locations
- 💰 Fare Estimation — Real-time fare calculator with discount code support
- 🍱 Ride Extras — Add refreshments and charity donations to rides
- 📋 Ride History — View all past and active rides with status badges
- 💳 Payment Gateway — Simulated Stripe-style checkout with card UI
- 🌐 Language Switcher — Toggle between English 🇬🇧 and Hindi 🇮🇳
- 🔑 Admin Portal — Separate login & dashboard for administrators
- 📊 Dashboard Overview — Stats for total rides, drivers, cars, and payments
- 🧑
✈️ Driver Registration — Register new drivers directly from the admin portal - 📜 Rides / Payments / Cars History — Full tabular views of all data
- 🤖 Auto-Assign Driver — When a ride is booked, an available driver is automatically matched based on cab type
- 📍 Change City — Users can set their city on the dashboard (persisted via localStorage)
- 📄 About / Blog Page — Two promotional blogs promoting the Ucab platform
| Layer | Technology |
|---|---|
| Frontend | React 18 + Vite |
| Routing | React Router v6 |
| Styling | Vanilla CSS + Bootstrap 5 |
| Fonts | Google Fonts — Outfit |
| i18n | react-i18next (EN / HI) |
| Backend | Node.js + Express.js |
| Database | MongoDB + Mongoose |
| Auth | JWT (JSON Web Tokens) + bcryptjs |
| API Client | Axios |
cab-booking-system/
├── backend/
│ └── backend/
│ ├── controllers/ # Business logic (ride, driver, fare, admin, payment)
│ ├── models/ # Mongoose schemas (User, Driver, Ride, Payment)
│ ├── routes/ # Express API routes
│ ├── middleware/ # JWT auth middleware
│ ├── server.js # Main Express app
│ └── cab-frontend/ # React frontend (Vite)
│ └── src/
│ ├── pages/ # Dashboard, Login, BookRide, Payment, History, About, Admin
│ ├── components/ # Navbar
│ ├── services/ # Axios API service
│ └── i18n.js # Language translations
└── README.md
- Node.js v18+
- MongoDB (local or Atlas)
git clone https://github.com/luckysharma-dev/cab-booking-system.git
cd cab-booking-systemcd backend/backend
npm installCreate a .env file inside backend/backend/:
PORT=5000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret_keyStart the backend:
npm run devcd backend/backend/cab-frontend
npm install
npm run devThe app will be available at http://localhost:5173
| Method | Route | Description |
|---|---|---|
| POST | /api/auth/register |
Register a new user |
| POST | /api/auth/login |
Login user |
| POST | /api/drivers/register |
Register a new driver |
| POST | /api/drivers/login |
Login driver |
| GET | /api/rides/user-history |
Get user ride history |
| POST | /api/rides/book |
Book a new ride (auto-assigns driver) |
| POST | /api/payments/pay |
Process payment for a ride |
| GET | /api/admin/dashboard |
Admin: get all stats |
| POST | /api/admin/login |
Admin login |
Ucab has its own distinct visual identity — not a copy of Uber:
- 🟣 Primary Color: Deep Purple
#302b63 - 🩵 Accent: Electric Teal
#38f9d7 - 🖋️ Font: Outfit — Modern & rounded
- 🌌 Background: Soft Lavender
#f8f5ff - 🌟 Navbar: Purple gradient with glowing teal logo
| Dashboard | Booking | Admin |
|---|---|---|
| Teal gradient hero with city selector | Full booking form with cab types | Driver management & stats |
Pull requests are welcome! For major changes, please open an issue first.
MIT © Lucky Sharma
