This RESTful API allows users to fetch, add, update, and delete Formula 1 driver data, such as name, nationality, team, and statistics. Built with Spring Boot and MySQL, the app is fully dockerized for easy setup and deployment via Docker Compose, requiring no additional software installation.
- Docker and Docker Compose
- Clone the repository:
git clone https://github.com/MatiasCarabella/formula1-driver-API.git
cd formula1-driver-API
- Build and start the application using Docker Compose:
docker compose up --build
This will automatically build the Docker containers and start the application.
- Access the application on http://localhost:9096/api. You should get the following response:
{
"status": "Ready to go! π¦π"
}
formula1-driver-API/
βββ src/
β βββ main/
β β βββ java/
β β β βββ com/
β β β βββ springBootProject/
β β β βββ formula1/
β β β βββ config/
β β β β βββ DataInitializer.java
β β β βββ controller/
β β β β βββ DriverController.java
β β β β βββ StatusController.java
β β β βββ domain/
β β β β βββ Driver.java
β β β βββ repository/
β β β β βββ DriverRepository.java
β β β βββ response/
β β β β βββ ResponseHandler.java
β β β βββ service/
β β β β βββ DriverService.java
β β β βββ Formula1Application.java
β β βββ resources/
β β βββ data/
β β β βββ drivers.json
β β βββ application.properties
β βββ test/
β βββ java/
β βββ com/
β βββ springBootProject/
β βββ formula1/
β βββ controller/
β β βββ DriverControllerIntegrationTests.java
β βββ Formula1ApplicationTests.java
βββ pom.xml
βββ Dockerfile
βββ docker-compose.yml
βββ mvnw
βββ mvnw.cmd
βββ .gitignore
βββ LICENSE
βββ README.md
Endpoint | Method | Description |
---|---|---|
/api |
GET | Check the service status with a message |
/api/drivers |
GET | Get all drivers, with optional filters |
/api/drivers |
POST | Add new drivers to the database |
/api/drivers/{id} |
PUT | Update driver information by ID |
/api/drivers/{id} |
DELETE | Delete a driver by ID |
/api/drivers/initialize |
POST | Initialize the database with sample data |
This project is licensed under the MIT License.
- Spring Boot π for the backend framework.
- Docker π³ for containerized deployment.
- @DaianaArena π for creating the banner image.