Gym Backend (Spring Boot)
A Spring Boot backend application for a gym management system. This application provides RESTful APIs for managing users, gym classes and bookings.
Requirements
- Java 17 or higher
- Maven 3.8+
- PostgreSQL
Getting Started
Running Locally
- Clone the repository
- Configure PostgreSQL database (default credentials in application.properties)
- Run the application:
mvn spring-boot:run
The application will start at http://localhost:8080
Using Docker
- Build the Docker image:
docker build -t gym-backend .
- Run the container:
docker run -p 8080:8080 gym-backend
API Endpoints
Users
GET /api/users: Get all usersGET /api/users/{id}: Get user by IDPOST /api/users: Create new userPUT /api/users/{id}: Update user
Gym Classes
GET /api/classes: Get all classesGET /api/classes/{id}: Get class by IDPOST /api/classes: Create new classPUT /api/classes/{id}: Update classDELETE /api/classes/{id}: Delete class
Bookings
GET /api/bookings: Get all bookingsGET /api/bookings/user/{userId}: Get bookings by user IDPOST /api/bookings: Create new bookingPUT /api/bookings/{id}/cancel: Cancel booking
File Upload
POST /api/upload: Upload files (for profile pictures and class images)
Description
Languages
Java
98.5%
Dockerfile
1.5%