This project is an API which allows simple CRUD operations of books in a MYSQL database.
The purpose was to create a simple API, which development process could be shown in a Youtube Video. In other words, I made this project for my channel, where I talk and create tutorials about software development.
- Java 17
- Spring 2.6.7
- MySQL
- Heroku
- IDE IntelliJ
- Maven
You can check the API out on the online Swagger UI available at the following link:
Also, there is an Insomnia collection available in the docs
folder. Or in the following link:
To build this application you'll need Maven and a JDK 17 distribution.
Clone or download the repository, go to the root folder and run the following command:
mvn package
To run the application locally, first you will need a MySQL instance running. If you already have one, then you can set the application to run with it with the following environment variables:
Variable | Description | Default Value |
---|---|---|
MYSQL_HOST | The IP or host name of the server where the MySQL instance is running. | localhost |
MYSQL_PORT | The port where the MySQL instance is running. | 3306 |
MYSQL_USERNAME | The username used to connect to the MySQL instance. | root |
MYSQL_PASSWORD | The password used to connect to the MySQL instance. | root |
Then just run the application with the command below:
java -jar target/books-api-0.0.1-SNAPSHOT.jar