Skip to content

crocarneiro/books-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Books API

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.

Tech Stack

  • Java 17
  • Spring 2.6.7
  • MySQL
  • Heroku
  • IDE IntelliJ
  • Maven

Demo

You can check the API out on the online Swagger UI available at the following link:

https://crocarneiro-books-api.herokuapp.com/swagger-ui/index.html?configUrl=/api-docs/swagger-config#/book-controller/findAllBooks

Also, there is an Insomnia collection available in the docs folder. Or in the following link:

Insomnia collection

Build

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

Running the application locally

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

Releases

No releases published

Packages

No packages published

Languages