Backend service for a beauty salon booking system. Built with Java + Spring Boot, secured with JWT-based authentication, and backed by MongoDB.
The system provides REST APIs for user authentication, service discovery, master availability, and appointment management with role-based access control.
- Java 17+
- Spring Boot
- Spring Security (JWT, role-based authorization)
- MongoDB
- BCrypt (password hashing)
- REST API
The project follows a classic layered architecture:
controller → service → repository → database
↓
dto
- controller – REST endpoints
- service – business logic
- repository – MongoDB access
- dto – request/response models
- config – security, CORS, JWT configuration
- JWT-based stateless authentication
- Role-based authorization (
CLIENT,ADMIN) - Passwords stored using BCrypt hashing
- Custom JWT filter integrated into Spring Security filter chain
- CORS configuration for frontend integration
POST /api/auth/**– registration & loginGET /api/services/**– list of servicesGET /api/masters/by-service/**– masters by serviceGET /api/masters/available-slots– available time slots
GET /api/appointments/my– client appointments (CLIENT, ADMIN)GET /api/appointments/admin/all– all appointments (ADMIN only)
All other endpoints require a valid JWT token.
- User registration and login
- JWT authentication & authorization
- Service catalog
- Master availability lookup
- Appointment booking
- Role-based access control
Create a .env file in the project root:
MONGODB_URI=mongodb://localhost:27017/beautysalon
JWT_SECRET=your_jwt_secret
JWT_EXPIRATION=86400000- Java 17+
- MongoDB
- Maven
mvn clean install
mvn spring-boot:runThe application will start on:
http://localhost:8080
The API is designed to be frontend-ready and follows REST principles. Example requests can be found in the controller classes.
This project is an MVP backend, designed to be extended with:
- Swagger / OpenAPI documentation
- Refresh tokens
- Appointment cancellation & rescheduling
- Admin management features
Developed by Bohdan Tarasenko