Welcome to the Statistics API project! This project aims to create a Spring Boot RESTful API that updates statistics in the database and caches responses that we retrieve.
This README.md file provides an overview of the project.
To run the project, follow this instruction:
- Clone the repository:
git clone https://github.com/vadymhrnk/statistics-api.git
- Download JDK, Apache Maven and Docker
- Use Docker to build and run MongoDB:
docker-compose -f docker-compose.yaml -p statistics-api up -d
- Build and run the project using:
mvn clean spring-boot:run
- Java 17: the primary programming language for backend development.
- Spring Boot: the framework for building and deploying Java-based applications with ease.
- Spring Security: ensures secure authentication and authorization within the application.
- Spring Data MongoDB: provides easy integration with MongoDB for data access.
- Spring Boot Starter Web: starter for building web applications, including RESTful APIs.
- Spring Boot Starter Cache: starter for using Spring Framework’s caching support.
- Spring Boot Starter Validation: starter for using JSR-380 Bean Validation with Hibernate Validator.
- MapStruct: simplifies the implementation of bean mappings, reducing manual coding effort.
- Lombok: a tool to reduce boilerplate code, enhancing code readability and conciseness.
- MongoDB Driver: driver for MongoDB integration.
- Springdoc OpenAPI: an OpenAPI for generating documentation.
- JWT (JSON Web Token): used for secure communication and authorization between client and server.
- Mongock: enables MongoDB database migration management.
-
Authentication controller:
POST: /auth/registration
-> Sign in to the app.POST: /auth/login
-> Log in to get token for further interactions.
-
Report controller:
GET: /reports/dates
-> Get list of all reports by dates.GET: /reports/dates?firstDate=2024-02-15&secondDate=2024-02-16
-> Get list of all reports by selected datesGET: /reports/ASIN
-> Get all reports by ASINs.GET: /reports/ASIN?asinList=B07JWCZKSJ&asinList=B09ZDDDS1X
-> Get all reports by specific ASINs.