Item Microservice API is a Spring Boot web application for managing users and items. It supports user registration, JWT-based authentication, and creation and getting list of owned items.
- Java 17+
- Spring Boot
- Spring Security
- io.jsonwebtoken
- Spring Data JPA / Hibernate
- MySQL (Docker)
- Maven
- Java 17+
- Maven
- Docker + Docker Compose
git clone https://github.com/Ghaspar009/item-microservice-api.gitInside the docker folder, create a .env file with the following environment variables:
MYSQL_ROOT_PASSWORD=your_root_password
MYSQL_DATABASE=your_database_name
Example:
MYSQL_ROOT_PASSWORD=root123
MYSQL_DATABASE=taskdb
Navigate to the docker folder and run:
docker-compose up -dFrom the root of the project, run:
./mvnw spring-boot:runOr if you have Maven installed globally:
mvn spring-boot:run| Method | Endpoint | Description | Requires JWT |
|---|---|---|---|
| POST | /register |
Register a new user | No |
| POST | /login |
Authenticate and receive a JWT | No |
| GET | /items |
Get a list of items owned by user authenticated with JWT | Yes |
| POST | /items |
Add a new item | Yes |
To run unit tests:
mvn testKacper Knuth
This project was created as part of a recruitment process for Betacom S.A.