Workout Tracker is a Spring Boot application that allows users to manage their workouts, exercises, and track their fitness progress.
- User authentication and registration
- Create, update, and delete workouts
- Add exercises to workouts
- Schedule workouts
- Generate workout reports
- RESTful API for easy integration
- Java 17
- Spring Boot 3.x
- Spring Security
- Spring Data JPA
- MySQL
- Flyway for database migrations
- Lombok for reducing boilerplate code
- Swagger/OpenAPI for API documentation
The project follows a standard Spring Boot application structure:
entity
: Contains JPA entities (User, Workout, Exercise)repository
: Contains Spring Data JPA repositoriesservice
: Contains business logiccontroller
: Contains REST API endpointsdto
: Contains Data Transfer Objects for API requests and responses
- Clone the repository
- Ensure you have Java 17 and Maven installed
- Set up a MySQL database and update the
application.properties
file with your database credentials - Run the following command to start the application:
mvn spring-boot:run
- POST /api/workouts: Create a new workout
- PUT /api/workouts/{id}: Update an existing workout
- DELETE /api/workouts/{id}: Delete a workout
- GET /api/workouts: List all workouts for the current user
- GET /api/workouts/report: Generate a workout report
The database schema is managed using Flyway migrations. The initial schema is defined in:
To run the tests, use the following command:
mvn test
API documentation is available using Swagger UI. After starting the application, visit:
http://localhost:8081/swagger-ui.html
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open source and available under the MIT License.