Skip to content

CRUD API of F1 drivers 🏁🏎️ that showcases the use of Spring Boot, MySQL & Docker as its main technologies.

Notifications You must be signed in to change notification settings

MatiasCarabella/formula1-driver-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

44 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

F1 Driver API

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.

Setup Instructions

Prerequisites

Installation

  1. Clone the repository:
git clone https://github.com/MatiasCarabella/formula1-driver-API.git
cd formula1-driver-API
  1. Build and start the application using Docker Compose:
 docker compose up --build 

This will automatically build the Docker containers and start the application.

  1. Access the application on http://localhost:9096/api. You should get the following response:
{
    "status": "Ready to go! 🚦🏁"
}

Project Structure

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

Usage

API Endpoints

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

API Documentation (Postman)

License

This project is licensed under the MIT License.

Acknowledgements

  • Spring Boot πŸƒ for the backend framework.
  • Docker 🐳 for containerized deployment.
  • @DaianaArena πŸ’œ for creating the banner image.

About

CRUD API of F1 drivers 🏁🏎️ that showcases the use of Spring Boot, MySQL & Docker as its main technologies.

Topics

Resources

Stars

Watchers

Forks