A demo REST API built with Spring Boot for managing anime information. This project provides a simple CRUD (Create, Read, Update, Delete) interface for anime entries.
- List all animes
- Get anime by ID
- Create new anime entries
- Update existing animes
- Delete animes
- Spring Boot 4.0.2
- Java 25
- Lombok
- Gradle (Kotlin DSL)
GET /animes- List all animesGET /animes/{id}- Get anime by IDPOST /animes- Create new animePUT /animes/{id}- Update existing animeDELETE /animes/{id}- Delete anime
- Java 25
- MySQL 8.0+ or Docker
- Gradle
-
Clone the repository
-
Configure environment variables
Copy the
.env.examplefile to.env:cp .env.example .env
Then edit the
.envfile with your database credentials:DB_URL=jdbc:mysql://localhost:3306/animes DB_USERNAME=your_mysql_username DB_PASSWORD=your_mysql_password MYSQL_ROOT_PASSWORD=your_root_password MYSQL_DATABASE=animes
-
Start the database
Option A: Using Docker (Recommended)
docker-compose up -d
This will start a MySQL container with the credentials from your
.envfile.Option B: Using existing MySQL installation
CREATE DATABASE animes;
-
Run the application
./gradlew bootRun
The API will be available at http://localhost:8080
- Never commit the
.envfile to version control - The
.envfile contains sensitive credentials and is already in.gitignore - Use
.env.exampleas a template for your local.envfile - Each developer should create their own
.envfile locally - The
docker-compose.ymlalso uses environment variables from.env