A modern, responsive ride-sharing platform frontend built with React and Bootstrap. This application provides a complete user interface for passengers, drivers, and administrators to manage ride requests, applications, and payments.
- Dashboard: View ride statistics and quick access to platform features
- Request Rides: Create new ride requests with pickup/dropoff locations and desired fare
- Manage Rides: View and manage your ride requests
- Review Applications: See driver applications for your rides and approve/reject them
- Payment Processing: Handle payments for completed rides
- Dashboard: View available rides and driver statistics
- Browse Rides: Search and filter available ride requests
- Apply for Rides: Submit applications to drive passengers
- Manage Rides: Track your accepted rides and update their status
- Dashboard: Monitor platform statistics and recent activity
- User Management: View, activate/deactivate, and manage user accounts
- Ride Management: Monitor all ride requests and their statuses
- Platform Analytics: View system health and performance metrics
- Frontend Framework: React 19.1.0
- UI Framework: Bootstrap 5.3.7
- Routing: React Router DOM 7.7.1
- HTTP Client: Axios 1.7.8
- Build Tool: Vite 6.0.5
- Development: ESLint for code quality
The application follows a microservice architecture pattern with separate backend services:
- User Service (Port 3001): Authentication and user management
- Ride Service (Port 3002): Ride requests and applications
- Payment Service (Port 3003): Payment processing
- Admin Service (Port 3004): Administrative functions
- Node.js (v16 or higher)
- npm or yarn
- Backend services running (see backend repository)
-
Clone the repository
git clone <repository-url> cd Ride-Sharing-System-Frontend
-
Install dependencies
npm install
-
Set up backend services
Option A: Use Mock Server (for testing/development)
# Navigate to mock server directory cd mock-server # Install mock server dependencies npm install # Start mock backend services npm start
Option B: Set up actual backend services
See BACKEND_SETUP.md for detailed instructions on setting up the actual backend microservices.
-
Start the development server
# Return to project root cd .. # Start frontend npm run dev
-
Open your browser Navigate to
http://localhost:5173
The mock server provides test accounts:
- Passenger:
[email protected]
/password123
- Driver:
[email protected]
/password123
- Admin:
[email protected]
/password123
The service status component on the landing page will show green indicators when the mock server is running.
src/
βββ components/ # Reusable components
β βββ Navbar.jsx # Navigation component
β βββ ProtectedRoute.jsx # Route protection wrapper
βββ context/ # React context providers
β βββ AuthContext.jsx # Authentication state management
βββ pages/ # Page components
β βββ admin/ # Admin-specific pages
β βββ driver/ # Driver-specific pages
β βββ passenger/ # Passenger-specific pages
β βββ LandingPage.jsx # Homepage
β βββ LoginPage.jsx # User login
β βββ RegisterPage.jsx # User registration
β βββ ProfilePage.jsx # User profile
β βββ PaymentPage.jsx # Payment processing
βββ services/ # API service layer
β βββ apiService.js # Centralized API calls
βββ styles/ # Custom stylesheets
βββ utils/ # Utility functions
βββ App.jsx # Main application component
βββ main.jsx # Application entry point
The application implements role-based access control with three user roles:
- Passenger: Can request rides and manage their bookings
- Driver: Can browse and apply for rides
- Admin: Can manage users and monitor platform activity
Authentication is handled via JWT tokens stored in localStorage.
- Responsive Design: Mobile-first approach using Bootstrap
- Modern Interface: Clean, intuitive design with consistent styling
- Loading States: Spinners and loading indicators for better UX
- Error Handling: User-friendly error messages and validation
- Interactive Elements: Modals, badges, and form validations
The application connects to backend services via configurable base URLs in src/services/apiService.js
:
const USER_SERVICE_URL = "http://localhost:3001";
const RIDE_SERVICE_URL = "http://localhost:3002";
const PAYMENT_SERVICE_URL = "http://localhost:3003";
const ADMIN_SERVICE_URL = "http://localhost:3004";
- Landing Page: Platform introduction and features
- Login/Register: User authentication
- Dashboard: Statistics and quick actions
- Request Ride: Create new ride requests
- My Rides: Manage ride requests
- Applications: Review driver applications
- Dashboard: Available rides overview
- Available Rides: Browse and apply for rides
- My Rides: Manage accepted rides
- Dashboard: Platform statistics and monitoring
- Manage Users: User account administration
- Manage Rides: Ride request oversight
The application uses React Context API for state management:
- AuthContext: Manages user authentication state, login/logout functions, and user role information
All API calls are centralized in src/services/apiService.js
with separate service modules:
- userService: Authentication and user management
- rideService: Ride operations
- paymentService: Payment processing
- adminService: Administrative functions
Protected routes ensure users can only access pages appropriate to their role:
<ProtectedRoute roles={["passenger"]}>
<PassengerDashboard />
</ProtectedRoute>
- Real-time statistics display
- Quick action buttons
- Recent activity feeds
- Advanced filtering and searching
- Status-based organization
- Real-time updates
- Secure payment forms
- Receipt generation
- Payment history tracking
- Role-based access control
- Account activation/deactivation
- User statistics and monitoring
npm run dev
- Start development servernpm run build
- Build for productionnpm run preview
- Preview production buildnpm run lint
- Run ESLint
The project uses ESLint for code quality and consistency. Run npm run lint
to check for issues.
-
Build the application
npm run build
-
Deploy the
dist
folder to your hosting service -
Configure environment variables for production API endpoints
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License.
For support and questions, please create an issue in the repository or contact the development team.
Note: This frontend application requires the corresponding backend services to be running for full functionality. Please refer to the backend repository for setup instructions.+ Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the TS template for information on how to integrate TypeScript and typescript-eslint
in your project.