ReadingIsGood is an online books retail firm that operates only on the Internet. Main target of ReadingIsGood is to deliver books from its one centralized warehouse to their customers within the same day. That is why stock consistency is the first priority for their vision operations.
ReadingIsGood is a REST API that provides you can create and manage customers, books and orders. It can also serve statistics of orders by customers.
In this project, Spring Boot, Spring Data JPA with MySQL and Spring Security is used. Also it has OpenAPI Specification for API documentation and Docker to containerize.
- Java 11
- Spring Boot
- Spring Data JPA
- Spring Security
- MySQL
- Docker
- JWT (JSON Web Token)
- OpenAPI (Swagger)
- Postman
- Git
Clone this repository to your local:
$ git clone https://github.com/vlknakkaya/ReadingIsGood.git
Build it using Gradle (skipping tests because of database is not available):
$ ./gradlew clean build -x test
Create Docker environment and start up the application on it:
$ docker-compose build
$ docker-compose up
After successful start of the application, you can access it's OpenAPI UI:
- STS must be installed, if not
- MySQL database is a must for running the application
- I used XAMPP because of it includes MariaDB and manageable from browser (it makes somethings easier ๐)
- You have to create
reading
database on it
Clone this repository to your local:
$ git clone https://github.com/vlknakkaya/ReadingIsGood.git
Import the project into STS:
File -> Import -> Gradle -> Existing Gradle Project
Build it from Gradle Tasks (it takes time based on dependencies) and Start!
You can use the API using Postman with the collection or it's OpenAPI UI.
Because of API has authentication
, you need to create token to use it. AuthController provides token creation.
You can create your token by giving credentials to /auth
:
NOTE: Application has 3 in-memory users. You can use one of them to create token.
username password user1 1111 user2 2222 user3 3333
After creating token, you can use it by giving to Header
with Authorization
key and Bearer
(includes whitespace) prefix.
You can use this controller's methods to manage Book. You can display, create, update or delete a Book or update stocks.
You can use this controller's method to manage Customer. You can display, create, update or delete a Customer or display it's orders.
You can use this controller's methods to manage Order. You can display, create, update or delete a Order, search by date or set it's status.
You can use this controller's methods to display statistics. You can display all or customer based statistics. Statistics value is grouped by months.