This project simulates the core functionalities of a ride-sharing platform, including modules for driver, customer, billing, ride management, and administration. The backend is built with Django, and the frontend uses React.js. The application is designed to handle operations such as ride booking, driver registration, and billing.
- Features
- Technology Stack
- Setup Instructions
- Docker Setup
- Kubernetes Deployment
- Minikube Setup
- Testing
- Contributing
- Customer Management: Customer registration, login, and profile updates.
- Driver Management: Driver registration, login, profile updates, and ride management.
- Ride Booking: Real-time ride booking, ride status updates, and notifications.
- Billing: Automatic fare calculation and billing generation.
- Websocket Notifications: Real-time ride updates for drivers and customers.
- Redis Caching: Improves system performance and handles session storage.
- Backend: Django, Django REST Framework
- Frontend: React.js
- Database: MySQL
- Caching: Redis
- Containerization: Docker
- Orchestration: Kubernetes
- Testing: Postman, JMeter
- Install Docker.
- Install Kubernetes CLI (kubectl).
- Install Minikube.
- Install Python 3.9+.
- Install Node.js and npm.
- Clone this repository:
git clone https://github.com/your-repo/uber-simulation.git cd uber-simulation
cd backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
python manage.py makemigrations
python manage.py migrate
python manage.py runserver
cd frontend
npm install
npm start
- Build the backend image:
cd backend docker build -t uber-backend .
- Build the frontend image:
cd frontend docker build -t uber-frontend .
- Start the MySQL and Redis containers:
docker run --name mysql-container -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=uber_db -p 3306:3306 -d mysql:latest docker run --name redis-container -p 6379:6379 -d redis:latest
- Run the backend container:
docker run --name backend-container --link mysql-container --link redis-container -p 8000:8000 uber-backend
- Run the frontend container:
docker run --name frontend-container -p 3000:3000 uber-frontend
- Ensure
kubectl
is configured. - Ensure a Kubernetes cluster is running.
- Create a namespace:
kubectl create namespace uber
- Apply MySQL and Redis manifests:
kubectl apply -f k8s/mysql-pv.yaml kubectl apply -f k8s/redis-deployment.yaml
- Apply backend and frontend deployments:
kubectl apply -f k8s/backend-deployment.yaml kubectl apply -f k8s/frontend-deployment.yaml
kubectl get pods -n uber
kubectl get services -n uber
minikube start
- Use Minikube to deploy the application:
kubectl apply -f k8s/mysql-pv.yaml kubectl apply -f k8s/redis-deployment.yaml kubectl apply -f k8s/backend-deployment.yaml kubectl apply -f k8s/frontend-deployment.yaml
- Expose services using Minikube:
minikube service backend-service -n uber minikube service frontend-service -n uber
- Use Postman for testing API endpoints.
- Use JMeter for load testing (e.g., simulate 100 users booking rides simultaneously).
Feel free to contribute by creating issues or submitting pull requests. For major changes, please discuss with the project maintainers first.
This project is licensed under the MIT License. See the LICENSE
file for more details.