This is an e-commerce API designed for managing products, orders, and users.
Built with Java 17 and Spring Boot 3, it follows the principles of hexagonal architecture, ensuring a clear separation between business logic and infrastructure layers.
Additionally, it implements design patterns to enhance scalability, maintainability, and efficiency.
- Authentication and Authorization using JWT
- Product, orders management
- Caching for products
- Documentation using OpenAPI
- Hexagonal architecture
- Java 17
- Spring Boot 3
- Spring Security Authentication and Authorization using JWT
- Spring Data JPA for data access
- Postgres as database
- OpenAPI for API documentation
- Docker for containerization
- Docker Compose for running the application
- Redis for caching
- Elasticsearch for search
- Clone the repository
git clone https://github.com/Ignorancio/backend-java-store
cd backend-java-store- Build the project
docker compose build- Run the project
docker compose up -d-
Authentication:
POST /auth/login- Login and get a JWT tokenPOST /auth/register- Register a new userPOST /auth/refresh- Refresh a JWT tokenPOST /auth/register/admin- Register a new admin user, only for testing purposes
-
Products:
GET /api/v1/products- Get all productsGET /api/v1/products/{id}- Get a product by IDPOST /api/v1/products- Create a new productPUT /api/v1/products/- Update a productDELETE /api/v1/products/{id}- Delete a product
-
Categories:
GET /api/v1/categories- Get all categoriesGET /api/v1/categories/{id}- Get a category by IDPOST /api/v1/categories- Create a new categoryPUT /api/v1/categories/- Update a categoryDELETE /api/v1/categories/{id}- Delete a category
-
Orders:
GET /api/v1/orders- Get all orders associated with the authenticated userGET /api/v1/orders/{id}- Get an order by IDGET /api/v1/orders/all- Get all orders for admin usersPOST /api/v1/orders- Create a new orderPUT /api/v1/orders/{id}- Update an orderDELETE /api/v1/orders/{id}- Delete an order
-
Search:
GET /api/v1/search- Search for products by name
- Refactor Auth service
- Improve persistence for caching
- Add tests
- Add CI/CD
- Add Elasticsearch for search
- Add monitoring