This Formula 1 Driver API is a fully dockerized RESTful service for managing Formula 1 driver data. Built with Spring Boot and MySQL, it offers endpoints for CRUD operations, seamless local or containerized deployment, and API documentation via Swagger and Postman.
- 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:
{
"message": "Ready to go! π¦π",
"status": 200
}
formula1-driver-API/
βββ src
β βββ main
β β βββ java
β β β βββ com
β β β βββ motorsport
β β β βββ formula1
β β β βββ Formula1Application.java
β β β βββ controller
β β β β βββ IDriverController.java
β β β β βββ IPingController.java
β β β β βββ impl
β β β β βββ DriverController.java
β β β β βββ PingController.java
β β β βββ entity
β β β β βββ Driver.java
β β β β βββ Response.java
β β β βββ repository
β β β β βββ DriverRepository.java
β β β βββ response
β β β β βββ ResponseHandler.java
β β β βββ usecase
β β β β βββ ICreateDrivers.java
β β β β βββ IDeleteDriver.java
β β β β βββ IGetAllDrivers.java
β β β β βββ IGetDriversFromJson.java
β β β β βββ IGetDriversWithFilters.java
β β β β βββ IGetDuplicateDrivers.java
β β β β βββ IInitializeDatabase.java
β β β β βββ IIsDatabasePopulated.java
β β β β βββ IUpdateDriver.java
β β β β βββ impl
β β β β βββ CreateDrivers.java
β β β β βββ DeleteDriver.java
β β β β βββ GetAllDrivers.java
β β β β βββ GetDriversFromJson.java
β β β β βββ GetDriversWithFilters.java
β β β β βββ GetDuplicateDrivers.java
β β β β βββ InitializeDatabase.java
β β β β βββ IsDatabasePopulated.java
β β β β βββ UpdateDriver.java
β β β βββ util
β β β βββ DocumentationHelper.java
β β βββ resources
β β βββ application.properties
β β βββ data
β β βββ drivers.json
β βββ test
β βββ java
β βββ com
β βββ motorsport
β βββ formula1
β βββ usecase
β βββ impl
β βββ CreateDriversTest.java
β βββ DeleteDriverTest.java
β βββ GetAllDriversTest.java
β βββ GetDriversFromJsonTest.java
β βββ GetDriversWithFiltersTest.java
β βββ GetDuplicateDriversTest.java
β βββ InitializeDatabaseTest.java
β βββ IsDatabasePopulatedTest.java
β βββ UpdateDriverTest.java
βββ Dockerfile
βββ docker-compose.yml
βββ mvnw
βββ mvnw.cmd
βββ pom.xml
βββ .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 |
Once the application is running, you can access the generated OpenAPI docs at:
You can also view and test the API using the following Postman docs:
If you have Java and Maven installed locally, you can use the following commands:
mvn spotless:apply
mvn test
This project is licensed under the MIT License.
- @DaianaArena π for creating the banner image.