A modern, secure, and efficient inventory management REST API built with Spring Boot 3, Spring Security 6, and Hibernate (JPA).
Designed for developers, students, and businesses who want a clean, extensible backend for managing products, warehouses, suppliers, categories, and stock movements โ with full role-based access control.
WarehouseFlow simplifies how inventory data flows through a system.
Itโs fast, minimal, and production-ready โ handling everything from tracking stock levels to generating warehouse reports.
The goal: a foundation you can deploy as-is or extend into a complete ERP or e-commerce backend.
| Category | Description |
|---|---|
| ๐งโ๐ผ User Management | Built-in admin creation, secure password hashing with BCrypt |
| ๐ Security | Role-based access control using Spring Security 6 |
| โ๏ธ REST API | Clean, stateless endpoints for all core entities |
| ๐พ Database Layer | Uses JPA/Hibernate with H2 for testing (easily switchable to MySQL/PostgreSQL) |
| ๐ฆ Inventory Operations | Full CRUD for products, categories, suppliers, warehouses, inventory items |
| ๐ Reports | Basic analytical endpoints for stock and movement summaries |
| ๐ง Modern Stack | Java 21, Spring Boot 3, Maven, REST-first architecture |
| ๐งฐ Developer Friendly | Clean modular structure and ready for deployment or Dockerization |
| Layer | Technology |
|---|---|
| Language | Java 21 |
| Framework | Spring Boot 3.3+ |
| ORM | Hibernate / JPA |
| Security | Spring Security 6 (HTTP Basic Auth + BCrypt) |
| Database | H2 (default), configurable to MySQL / PostgreSQL |
| Build Tool | Maven |
| Testing | JUnit, Spring Test |
| IDE | IntelliJ IDEA / Eclipse / VSCode |
warehouseflow/
โฃ src/main/java/mental/development/inventory_system/
โ โฃ config/ # Spring Security configuration and beans
โ โฃ controller/ # REST controllers for each entity
โ โฃ model/ # Entity models (Product, Supplier, Warehouse, etc.)
โ โฃ repository/ # JPA repositories for database operations
โ โฃ service/ # Business logic and data handling
โ โ WarehouseFlowApp.java # Main application class
โฃ src/main/resources/
โ โฃ application.properties # DB & security configuration
โ โ data.sql # Optional seed data
โ pom.xml
git clone https://github.com/MentalIllness/WarehouseFlow.git
cd warehouseflowmvn clean installmvn spring-boot:runThe API will start on:
http://localhost:8080
WarehouseFlow uses HTTP Basic Authentication and BCrypt for password hashing.
Users are stored in the database with role assignments (ROLE_ADMIN, ROLE_USER, etc.).
The endpoint /api/users/create-admin is open (permitAll) and used to create the initial administrator:
POST /api/users/create-adminAfter that, use Basic Auth in headers for protected endpoints:
Authorization: Basic base64(username:password)
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/products |
Fetch all products |
| GET | /api/categories |
List product categories |
| GET | /api/suppliers |
Get supplier information |
| GET | /api/warehouses |
List warehouses |
| GET | /api/reports/** |
Public reports (aggregated stock info) |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/inventory/add |
Add new inventory item |
| PUT | /api/inventory/update/{id} |
Update existing stock |
| DELETE | /api/inventory/delete/{id} |
Remove inventory record |
| POST | /api/products |
Create new product |
| POST | /api/categories |
Create new category |
| POST | /api/suppliers |
Create supplier entry |
| GET | /api/users |
List all users (Admin only) |
POST /api/products
{
"name": "ThinkPad T14 Gen 5",
"sku": "TP-T14G5",
"quantity": 0,
"price": 1899.99,
"category": {
"id": 1,
"name": "Electronics"
},
"supplier": {
"id": 1,
"name": "Lenovo Distribution",
"contactEmail": "dist@lenovo.example",
"phone": "+359888000111"
}
}All app properties are stored in src/main/resources/application.properties.
Example:
spring.application.name=warehouseflow
spring.datasource.url=jdbc:h2:mem:warehouseflowdb
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=
spring.jpa.hibernate.ddl-auto=update
spring.h2.console.enabled=true
spring.h2.console.path=/h2-consoleYou can easily switch to MySQL/PostgreSQL by updating these properties.
| Command | Description |
|---|---|
mvn clean install |
Build project |
mvn spring-boot:run |
Run locally |
mvn test |
Run tests |
mvn package |
Package JAR file |
java -jar target/warehouseflow-1.0.jar |
Run built JAR |
The project includes unit and integration test templates for services and controllers.
Run them via:
mvn testYou can extend them easily for repository-level tests using Springโs @DataJpaTest.
WarehouseFlow is ready for containerization.
Add a Dockerfile (planned feature) to deploy easily via:
docker build -t warehouseflow .
docker run -p 8080:8080 warehouseflowFuture roadmap includes full Docker Compose setup with MySQL and frontend integration.
- โ Role-based access (Admin/User)
- ๐ชช JWT Authentication (planned)
- ๐ Advanced reporting module
- ๐งฎ Inventory analytics dashboards
- ๐ณ Docker support (with MySQL)
- ๐ React/Vue frontend
- ๐ฆ Swagger/OpenAPI documentation
Contributions are welcome!
If you want to add new features, fix bugs, or improve documentation:
- Fork this repo
- Create a new branch (
feature/amazing-feature) - Commit your changes
- Push and open a Pull Request
Mental Development
Backend Developer & Law Student @ Varna Free University
๐ง mental.illness.business@gmail.com
This project is licensed under the MIT License.
Youโre free to use, modify, and distribute it with attribution.
If you like WarehouseFlow, consider giving it a โญ on GitHub โ it helps more developers discover the project!