This project represents a small REST backend for a book-store, exposing several endpoints that are leveraged by it's peer web app shopp-web:.
This project utilizes the following technologies;
- Java 8
- Spring Boot (framework)
- Gradle (build tool)
- Embedded H2 (database)
- Liquibase (db migration)
- Caffeine (memory caching)
- Redis (Disabled, but can be optionally turned to replace caffeine for more robust standalone caching)
- A peer front-end application shopp-web: (written in React-16 webhooks) which consumes the APIs exposed by this service
- JUnit (testing)
- REST endpoints
- Navigate to the root of the project and execute the following command;
./gradlew bootRun
All of the APIs are accessible via http://localhost:8090/api/**
if you want to test with a REST client like Postman.
Please see the API documentation here:
- Schema definitions : http://localhost:8090/api/v3/api-docs/
- Endpoints: http://localhost:8090/api/swagger-ui/index.html?configUrl=/api/v3/api-docs/swagger-config#/
NOTE - All data exposed by the API endpoints are preloaded on the application's first start up. To reset the data,
you can simply stop the application, delete the folder named database
located directly under the root of the application,
and start the application again. Now, you will be presented with fresh data from scratch.
Two sample unit/integration tests are currently provided just to show the testing possibilities. To run the sample tests issue the following command at the root of the project;
./gradlew clean test --info
For further reference, please consider the following sections:
- Official Gradle documentation
- Spring Boot Gradle Plugin Reference Guide
- Spring for Apache ActiveMQ 5
- Spring Boot Actuator
- Spring Web
- Spring Configuration Processor
The following guides illustrate how to use some features concretely:
- Java Message Service API via Apache ActiveMQ Classic.
- Building a RESTful Web Service with Spring Boot Actuator
- Building a RESTful Web Service
- Serving Web Content with Spring MVC
- Building REST services with Spring
These additional references should also help you: