A modern, full-stack ride booking platform similar to Uber, built with React, Node.js, and real-time communication capabilities. FLY-RIDE connects passengers with drivers for seamless transportation services.
🔮 Future Enhancement: Currently a monolith, planned to be restructured into microservices architecture with RabbitMQ for asynchronous communication.
- 👤 User Authentication - Secure signup/login system
- 🗺️ Interactive Maps - Real-time location tracking with Leaflet.js
- 🚗 Ride Booking - Easy ride booking with fare calculation
- 📍 Location Search - Smart location search and autocomplete
- ⏱️ Real-time Tracking - Live tracking of driver location
- ⭐ Rating System - Rate your ride experience
- 💳 Ride History - View past rides and receipts
- 🚖 Driver Dashboard - Comprehensive driver interface
- 📱 Ride Requests - Accept/decline incoming ride requests
- 🗺️ Navigation - Built-in navigation system
- 💰 Earnings Tracking - Monitor daily and monthly earnings
- 📊 Performance Analytics - Driver performance metrics
- 🔔 Real-time Notifications - Instant ride request alerts
- 🔄 Real-time Communication - Socket.io for live updates
- 🔐 JWT Authentication - Secure token-based authentication
- 📱 Responsive Design - Mobile-first responsive UI
- 🚀 Fast Performance - Optimized with Vite build tool
- 🎨 Modern UI - Beautiful interface with Tailwind CSS
- 📡 RESTful API - Well-structured backend API
- React 19.0.0 - Modern React with latest features
- Vite - Lightning-fast build tool
- Tailwind CSS - Utility-first CSS framework
- React Router DOM - Client-side routing
- Leaflet.js - Interactive maps
- Socket.io Client - Real-time communication
- GSAP - Advanced animations
- Axios - HTTP client for API calls
- Node.js - Runtime environment
- Express.js - Web application framework
- MongoDB - NoSQL database
- Mongoose - MongoDB object modeling
- Socket.io - Real-time bidirectional communication
- JWT - JSON Web Tokens for authentication
- Bcrypt - Password hashing
- CORS - Cross-origin resource sharing
- RabbitMQ (Planned) - Message broker for microservices communication
The application currently runs as a single backend service handling all operations.
The system will be decomposed into three independent services:
- User authentication and profile management
- User registration and login
- Profile updates and preferences
- User ride history
- Captain authentication and profile management
- Vehicle registration and management
- Captain availability status
- Earnings and performance tracking
- Ride creation and management
- Real-time ride tracking
- Fare calculation
- Ride status updates
- Driver-passenger matching
- Event-driven Communication: Services communicate through events
- Asynchronous Processing: Non-blocking operations between services
- Message Queues:
user.events- User-related eventscaptain.events- Captain-related eventsride.events- Ride lifecycle eventsnotification.events- Real-time notifications
User Service ────→ RabbitMQ ────→ Ride Service
↑ ↓
└─────← RabbitMQ ←─────── Captain Service
Event Examples:
user.registered→ Trigger welcome notificationsride.created→ Notify nearby captainsride.accepted→ Update user and ride statusride.completed→ Update earnings and history
FLY-RIDE/
├── BACKEND/
│ ├── Controllers/ # Business logic controllers
│ │ ├── Captain.controller.js
│ │ ├── User.controllers.js
│ │ ├── Ride.controller.js
│ │ └── map.controller.js
│ ├── Models/ # Database models
│ │ ├── User.model.js
│ │ ├── captain.model.js
│ │ ├── ride.model.js
│ │ └── blacklistToken.model.js
│ ├── Routes/ # API routes
│ │ ├── User.routes.js
│ │ ├── Captain.routes.js
│ │ ├── ride.router.js
│ │ └── maps.routes.js
│ ├── Services/ # Service layer
│ │ ├── User.serves.js
│ │ ├── captain.serves.js
│ │ ├── ride.serves.js
│ │ ├── maps.serves.js
│ │ └── osrmService.js
│ ├── middlewares/ # Custom middlewares
│ │ └── auth.middleware.js
│ ├── DB/ # Database configuration
│ │ └── db.js
│ ├── app.js # Express app configuration
│ ├── Server.js # Server entry point
│ └── Socket.js # Socket.io configuration
├── FRONTEND/
│ ├── src/
│ │ ├── Pages/ # React pages/screens
│ │ │ ├── Home.jsx
│ │ │ ├── UserLogin.jsx
│ │ │ ├── CaptainLogin.jsx
│ │ │ ├── BookingPage.jsx
│ │ │ ├── Riding.jsx
│ │ │ └── ...
│ │ ├── components/ # Reusable components
│ │ │ ├── LocationSearchPanel.jsx
│ │ │ ├── RidePopup.jsx
│ │ │ ├── StarRating.jsx
│ │ │ └── ...
│ │ ├── context/ # React Context providers
│ │ │ ├── Usercontext.jsx
│ │ │ ├── Captaincontext.jsx
│ │ │ └── Socketcontext.jsx
│ │ ├── assets/ # Static assets
│ │ └── utils/ # Utility functions
│ ├── public/ # Public assets
│ └── package.json # Dependencies
└── README.md
FLY-RIDE/
├── SERVICES/
│ ├── USER-SERVICE/ # Independent User Service
│ │ ├── Controllers/
│ │ ├── Models/
│ │ ├── Routes/
│ │ ├── Services/
│ │ ├── middlewares/
│ │ ├── Events/ # RabbitMQ event handlers
│ │ ├── DB/
│ │ └── server.js
│ ├── CAPTAIN-SERVICE/ # Independent Captain Service
│ │ ├── Controllers/
│ │ ├── Models/
│ │ ├── Routes/
│ │ ├── Services/
│ │ ├── middlewares/
│ │ ├── Events/ # RabbitMQ event handlers
│ │ ├── DB/
│ │ └── server.js
│ ├── RIDE-SERVICE/ # Independent Ride Service
│ │ ├── Controllers/
│ │ ├── Models/
│ │ ├── Routes/
│ │ ├── Services/
│ │ ├── middlewares/
│ │ ├── Events/ # RabbitMQ event handlers
│ │ ├── DB/
│ │ └── server.js
│ └── SHARED/ # Shared utilities
│ ├── messageQueue/ # RabbitMQ configuration
│ ├── middlewares/ # Common middlewares
│ └── utils/ # Shared utilities
├── API-GATEWAY/ # Request routing and authentication
├── FRONTEND/
│ ├── src/
│ │ ├── Pages/ # React pages/screens
│ │ │ ├── Home.jsx
│ │ │ ├── UserLogin.jsx
│ │ │ ├── CaptainLogin.jsx
│ │ │ ├── BookingPage.jsx
│ │ │ ├── Riding.jsx
│ │ │ └── ...
│ │ ├── components/ # Reusable components
│ │ │ ├── LocationSearchPanel.jsx
│ │ │ ├── RidePopup.jsx
│ │ │ ├── StarRating.jsx
│ │ │ └── ...
│ │ ├── context/ # React Context providers
│ │ │ ├── Usercontext.jsx
│ │ │ ├── Captaincontext.jsx
│ │ │ └── Socketcontext.jsx
│ │ ├── assets/ # Static assets
│ │ └── utils/ # Utility functions
│ ├── public/ # Public assets
│ └── package.json # Dependencies
└── README.md
- 🔧 Scalability - Scale individual services based on demand
- 🛠️ Maintainability - Easier to maintain and update individual services
- 🔄 Fault Isolation - Service failures don't bring down the entire system
- ⚡ Performance - Optimized performance per service
- 👥 Team Independence - Different teams can work on different services
- 🚀 Deployment - Independent deployment of services
- Node.js (v14 or higher)
- MongoDB (local or cloud)
- Git
- RabbitMQ (Planned)
git clone https://github.com/yourusername/fly-ride.git
cd fly-ridecd BACKEND
npm installcd ../FRONTEND
npm installcd BACKEND
npm run devcd FRONTEND
npm run devThe application will be available at:
- Frontend:
http://localhost:5173 - Backend:
http://localhost:3000
- Sign Up/Login - Create an account or login
- Set Pickup Location - Choose your pickup point
- Set Destination - Enter where you want to go
- Book Ride - Confirm your ride details
- Track Driver - Monitor driver's real-time location
- Complete Ride - Rate your experience
- Register as Captain - Complete driver verification
- Go Online - Start accepting ride requests
- Accept Rides - Review and accept ride requests
- Navigate to Pickup - Use built-in navigation
- Complete Trip - Finish the ride and collect payment
POST /users/register- User registrationPOST /users/login- User loginGET /users/profile- Get user profilePOST /users/logout- User logout
POST /captains/register- Captain registrationPOST /captains/login- Captain loginGET /captains/profile- Get captain profile
POST /rides/create- Create new rideGET /rides/:id- Get ride detailsPATCH /rides/:id/confirm- Confirm ridePATCH /rides/:id/start- Start ridePATCH /rides/:id/end- End ride
GET /maps/get-coordinates- Get location coordinatesGET /maps/get-distance-time- Calculate distance and timeGET /maps/get-suggestions- Location suggestions
The application uses Socket.io for real-time communication:
- Live Location Updates - Real-time driver location tracking
- Ride Status Updates - Instant ride status notifications
- Driver Matching - Real-time driver assignment
- In-app Messaging - Communication between driver and passenger
- Responsive Design - Works seamlessly on all devices
- Modern Interface - Clean and intuitive user interface
- Interactive Maps - Smooth map interactions with Leaflet.js
- Smooth Animations - Enhanced user experience with GSAP
- Loading States - Proper loading indicators throughout the app
- JWT Authentication - Secure token-based authentication
- Password Hashing - Bcrypt for secure password storage
- Input Validation - Express-validator for data validation
- CORS Protection - Configured cross-origin resource sharing
- Token Blacklisting - Secure logout implementation
Single MongoDB instance serving all entities.
- User authentication and profile data
- User preferences and settings
- Ride history references
- Captain profiles and credentials
- Vehicle information
- Availability and location data
- Earnings and performance metrics
- Active and completed rides
- Route and fare information
- Real-time tracking data
- User and captain references
- Data Isolation - Each service owns its data
- Optimized Queries - Service-specific database optimization
- Independent Scaling - Scale databases based on service needs
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Your Name - Initial work -(https://github.com/Arojit45)
- React team for the amazing framework
- Socket.io for real-time communication
- Leaflet.js for interactive maps
- Tailwind CSS for the utility-first CSS framework
- MongoDB for the flexible database solution
⭐ Star this repository if you found it helpful!