Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matiascarabella/formula1-driver-api
CRUD API of F1 drivers that showcases the use of Spring Boot, MySQL & Docker as its main technologies. 🏎️
https://github.com/matiascarabella/formula1-driver-api
api crud crud-api f1 formula1 java rest restful-api spring-boot
Last synced: about 1 month ago
JSON representation
CRUD API of F1 drivers that showcases the use of Spring Boot, MySQL & Docker as its main technologies. 🏎️
- Host: GitHub
- URL: https://github.com/matiascarabella/formula1-driver-api
- Owner: MatiasCarabella
- Created: 2021-03-04T02:10:56.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-11-24T23:07:13.000Z (2 months ago)
- Last Synced: 2024-11-24T23:19:41.137Z (2 months ago)
- Topics: api, crud, crud-api, f1, formula1, java, rest, restful-api, spring-boot
- Language: Java
- Homepage:
- Size: 157 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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
- [**Docker**](https://docs.docker.com/get-started/get-docker/) and [**Docker Compose**](https://docs.docker.com/compose/)### Installation
1. Clone the repository:
```
git clone https://github.com/MatiasCarabella/formula1-driver-API.git
cd formula1-driver-API
```2. Build and start the application using Docker Compose:
```bash
docker compose up --build
```
_This will automatically build the Docker containers and start the application._3. Access the application on http://localhost:9096/api. You should get the following response:
```json
{
"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)](https://documenter.getpostman.com/view/10146128/2s93JoxRFG)
## License
This project is licensed under the [MIT License](LICENSE).
## Acknowledgements
- [**Spring Boot**](https://spring.io/projects/spring-boot) 🍃 for the backend framework.
- [**Docker**](https://www.docker.com/) 🐳 for containerized deployment.
- [**@DaianaArena**](https://github.com/DaianaArena) 💜 for creating the banner image.