REST API built with Spring Boot for a fictional online book store called "Nozama" (yes, "Amazon" but backwards).
I used this project to study back-end development with Java, Spring Boot, Docker, Azure, as well as to practice some other development concepts (such as TDD, API documentation, Clean Code...) and strength my skills.
The Swagger documentation was built using Springdoc and it's available at https://nozama.azurewebsites.net/swagger-ui/index.html
This project's intent is to simulate an e-commerce, by allowing the Admins to manage the store's products catalog, and by allowing users to view the catalog, add items to their cart, make orders and purchase the books.
As this project consists of a REST API, one of the goals is to follow the REST principles described by Roy Fielding, such as Hyperlinking, Statelessness, Uniform Interface, etc.
Also, the transactions performed by this project will be entirely fake (some simple database operations to simulate order registration and payment making) and thus there will be no interactions with no real payment API.
These are the features that either I have already implemented or I intend to implement:
Feature | Status |
---|---|
CRUD of the main entities (Book, Author, Category and Publisher) | Implemented |
Authentication and Authorization (Admin and Customer users and protected endpoints) | Implemented |
Order making (Users be able to add items to their cart and purchase) | Implemented |
The architecture of this project was somewhat inspired by the Clean Architecture. I tried to create something myself and attempted to follow a more simple structure, as this project is more simple and does not required a so neat and advanced organization. Also, as the intent is to use Spring Boot as the framework, I intentionally didn't worry about making the project decoupled from Spring.
Basically, this is the structure:
- Application:
- Interaction with the external world and utilization of the domain layer. Basically the controllers.
- Domain:
- Business-specific stuff, such as the entities and the use cases.
- Infrastructure:
- Any configuration required by the Spring and the libraries used.
Step | Command |
---|---|
1. Install dependencies and build | mvn clean install -DskipTests |
2. Run | mvn spring-boot:run |
These technologies were used:
- Java 17 LTS with Maven
- Spring Boot
- Docker
- Azure
- Hibernate
- Spring Data JPA
- Spring Security
- JUnit 5
- Mockito
- Spring HATEOAS
- Flyway
- Springdoc
The full list of dependencies can be checked out in this project's pom.xml file.