65 lines
1.3 KiB
Markdown

# 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
1. Clone the repository
2. Configure PostgreSQL database (default credentials in application.properties)
3. Run the application:
```bash
mvn spring-boot:run
```
The application will start at http://localhost:8080
### Using Docker
1. Build the Docker image:
```bash
docker build -t gym-backend .
```
2. Run the container:
```bash
docker run -p 8080:8080 gym-backend
```
## API Endpoints
### Users
- `GET /api/users`: Get all users
- `GET /api/users/{id}`: Get user by ID
- `POST /api/users`: Create new user
- `PUT /api/users/{id}`: Update user
### Gym Classes
- `GET /api/classes`: Get all classes
- `GET /api/classes/{id}`: Get class by ID
- `POST /api/classes`: Create new class
- `PUT /api/classes/{id}`: Update class
- `DELETE /api/classes/{id}`: Delete class
### Bookings
- `GET /api/bookings`: Get all bookings
- `GET /api/bookings/user/{userId}`: Get bookings by user ID
- `POST /api/bookings`: Create new booking
- `PUT /api/bookings/{id}/cancel`: Cancel booking
### File Upload
- `POST /api/upload`: Upload files (for profile pictures and class images)