Safar
Safar is a robust online cab booking platform built with Java, Spring Boot, and Spring Security. This project seamlessly integrates user management, cab management, driver management, booking management, and wallet management modules. It offers a comprehensive REST API, empowering users with interactive services for easy cab bookings.
Install / Use
/learn @akt0001c/SafarREADME
Safar
This is an Online cab booking application called Safar, which provides REST API services for booking cabs and managing users with two roles: admin and user, through interactive API services.
Modules
- User Module
- Cab Managment Module
- Driver Managment Module
- Booking Managment Module
- Wallet Managment Module
Frontend And Backend Technologies
- HTML
- JavaScript
- CSS
- Spring Boot
- Maven
- Spring Data Jpa
- Hibernate
- Spring Security
- Mysql
- Lombok
- Swagger
Gihub Link-> https://github.com/akt0001c/Safar.git
Netlify Link-> https://harmonious-salmiakki-4ba81b.netlify.app/
Table of Contents
- Features
- Prerequisites
- Getting Started
- Usage
- API Endpoints
- Database Configuration
- Testing
- Contributing
- Contributors
Features
- User registration and authentication.
- Booking cabs for rides.
- Driver registration and management.
- Wallet system for managing payments.
- Viewing ride history.
- Admin functionality for managing drivers and ride history.
Prerequisites
Before you begin, ensure you have met the following requirements:
- HTML, JavaScript, CSS knowledge.
- Spring Boot, Maven, Spring Data JPA, Hibernate, Spring Security, and MySQL.
- Lombok and Swagger for API documentation.
ER DIGRAM
Getting Started
To get started, follow these steps:
- Clone the project:
https://github.com/akt0001c/Safar.git - Configure the database in
application.properties. - Build and run the application.
Usage
- Visit the API documentation at
http://localhost:8888/swagger-ui/to explore available endpoints. - Use the provided API endpoints for user registration, cab booking, driver management, and more.
API Endpoints
User Module
POST /users: Register a new user.POST /users/saveCabBooking: Book a cab.GET /users/{email}: Retrieve user details by email.GET /users: Retrieve a list of all users.PATCH /users/{email}: Update user details by email.DELETE /users/{email}: Delete a user by email.GET /users/role/{role}: Retrieve users by role.GET /users/hello: Test endpoint for Spring Security.
Cab Booking Module
POST /cabBooking: Book a cab.PATCH /cabBooking/{cabBookingId}: Update a cab booking.GET /cabBooking/cancel/{cabBookingId}: Cancel a cab booking.GET /cabBooking/history: View booking history for a user.GET /cabBooking/completeTrip/{cabBookingId}: Complete a cab trip.GET /ADMIN/cabBooking/history: View booking history for all cab bookings.
Driver Management Module
POST /ADMIN/driver: Insert a new driver.GET /ADMIN/drivers: Retrieve a list of all drivers.PATCH /ADMIN/driver/{email}: Update driver details by email.PATCH /ADMIN/driver/{email}/{name}: Update driver's name by email.DELETE /ADMIN/driver/{driverEmail}: Delete a driver by email.GET /ADMIN/driver/bestdrivers: Retrieve a list of the best drivers.GET /ADMIN/driver/{driverEmail}: Retrieve driver details by email.
Wallet Management Module
POST /WALLET/addMoney: Add money to a user's wallet.PATCH /WALLET/changeStatus: Change the status of a wallet.POST /WALLET/createWallet/{email}: Create a wallet for a user.GET /WALLET/getWallet: Retrieve a user's wallet.GET /WALLET/WalletDetails: Retrieve the wallet details of the logged-in user.
Database Configuration
Configure your database settings in application.properties:
server.port=8888
# Database specific properties
spring.datasource.url=
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.username=
spring.datasource.password=
# ORM software specific properties
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
Testing
- mvn test
- mvc test for controllers
Contributors
- Ankit Choubry
- Aman Kumar
- Susheel Kumar
- Dhanushpriyan
Contributing
Contributions are welcome! If you'd like to contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them.
- Push the changes to your fork.
- Create a pull request explaining your changes.
Contact
For any questions or suggestions, feel free to contact us at amankumar.ak0012@gmail.com or akt00071000@gmail.com .
