This is a backend REST API application for a service marketplace built with Spring Boot. The application allows vendors to list their services, users to book or hire those services, and admins to approve or reject services listed by vendors. The API uses Spring Data JPA, Hibernate, Spring Security, JWT Authentication, Role-based Authorization, and MySQL as the database. The API is documented using Swagger and is thoroughly tested using JUnit and Mockito.
- Vendor Role:
- Add new services
- View & Update their own listed services
- User Role:
- Book or hire services offered by vendors
- Update their own profile
- Admin Role:
- Approve or reject services added by vendors
- Manage vendors and users
- Authentication:
- JWT-based authentication
- Role-based authorization
- Database:
- MySQL as the database engine
- API Documentation:
- Swagger UI for API documentation and testing
- Logging:
- Application logging for tracking and debugging
- Exception Handling:
- Global exception handler for consistent error responses
- Testing:
- Unit testing with JUnit and Mockito
- Backend Framework: Spring Boot
- Database: MySQL, H2
- ORM: Hibernate, Spring Data JPA
- Security: Spring Security, JWT Authentication, Role-based Authorization
- API Documentation: Swagger
- Testing: JUnit, Mockito
- Logging: SLF4J & Dedicated log file for easy analysis
- Exception Handling: Global Exception Handler
- Java 11 or higher
- Maven
- MySQL
- Clone the repository:
https://github.com/abhi07799/Online-Service-Marketplace.git
- Navigate to the project directory:
cd service-marketplace-backend
- Set up the MySQL database:
- Create a new database named
marketplace
. - Update the
application.properties
file with your MySQL database credentials.
- Create a new database named
- Build the project:
mvn clean install
- Test the application:
mvn test
- Run the application:
mvn spring-boot:run
You can access the Swagger API documentation at:
http://localhost:8080/swagger-ui.html
Logging is configured using the built-in SLF4J logging support. You can check the logs in the logs
directory.
Special thanks to the open-source community for providing amazing libraries and tools.