Welcome to the Rental Cab Service project! This repository contains the code for a complete car rental service, featuring a React frontend and a Node.js backend with a MySQL database.
Rental Cab Service is a web application that allows users to search for cars near their location, book a ride, and schedule rides. The platform supports user and driver registrations, ensuring a seamless experience for both passengers and drivers.
- User Registration: Allows users to create an account and manage their bookings.
- Driver Registration: Enables drivers to register with their license number and car details.
- Car Search: Users can search for available cars near their location.
- Booking and Scheduling: Users can book immediate rides or schedule future rides.
Ensure you have the following installed:
- Node.js
- npm (Node Package Manager)
- MySQL
- Navigate to the
frontend
directory:cd frontend
- Install dependencies:
npm install
- Navigate to the
backend
directory:cd backend
- Install dependencies:
npm install
-
Install MySQL and start the MySQL server.
-
Create a new database:
CREATE DATABASE rental_cab_service;
-
Create a user and grant all privileges on the database (replace
username
andpassword
with your own):CREATE USER 'username'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON rental_cab_service.* TO 'username'@'localhost'; FLUSH PRIVILEGES;
-
Import the database schema (if you have a SQL file with the schema):
mysql -u username -p rental_cab_service < path/to/schema.sql
-
Update the database configuration in the backend. Create a
.env
file in thebackend
directory and add the following:DB_HOST=localhost DB_USER=username DB_PASSWORD=password DB_NAME=rental_cab_service
- Navigate to the
frontend
directory:cd frontend
- Start the development server:
npm start
- Open your browser and navigate to
http://localhost:3000
.
- Navigate to the
backend
directory:cd backend
- Start the backend server with Nodemon for automatic restarts:
nodemon index.js
- The backend server should be running on
http://localhost:5000
.
Contributions are welcome! Please follow these steps to contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature
). - Commit your changes (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature/your-feature
). - Open a Pull Request.
This project is licensed under the MIT License. See the LICENSE file for more details.
Thank you for using Rental Cab Service! If you have any questions or suggestions, feel free to open an issue or contact the project maintainers.