A modern Spring Boot RESTful application for managing Items, Inventory, and Orders with intelligent stock management and dynamic order processing.
- Smart Inventory Management - Real-time stock tracking with top-up and withdrawal operations
- Dynamic Order Processing - Automated order number generation and status tracking
- Multi-Database Support - H2, PostgreSQL, and Oracle compatibility
- Interactive API Documentation - Built-in Swagger UI for testing and exploration
- Production Ready - Comprehensive testing, monitoring, and deployment configurations
- Observability - Comprehensive logging and monitoring capabilities (OpenTelemetry, Tempo, Grafana)
- ☕ Java 21+
- 📦 Maven 3.6+
- 📦 OpenTelemetry 2.16.X
- 🐳 Docker & Docker Compose (for containerized setup)
# Clone and run in one command
git clone https://github.com/hakimamarullah/obs-inventory-service && cd obs-inventory-service
./mvnw spring-boot:run
🌐 Application URL: http://localhost:8080
Run the complete stack with observability tools using Docker Compose:
# Start all services (app + monitoring stack)
docker-compose up -d
# View logs
docker-compose logs -f
# Stop all services
docker-compose down
Service | Port | Description |
---|---|---|
inventory-api | 8080 | Main Spring Boot application |
tempo | 3200 | Distributed tracing backend |
grafana | 3000 | Observability dashboard |
Once the stack is running, access Grafana at:
Default Credentials:
- Username:
admin
- Password:
admin
Quick Setup:
- Navigate to http://localhost:3000
- Login with admin/admin (change password when prompted)
- Go to Explore → Select Tempo as data source
- Query traces from your application to see distributed tracing data
The Grafana instance comes pre-configured with Tempo as a data source for viewing application traces and monitoring performance.
Runtime | Java 21+, Spring Boot 3.x |
Data Layer | Spring Data JPA, Hibernate |
Databases | H2 (dev), PostgreSQL, Oracle |
Documentation | OpenAPI 3.0, Swagger UI |
Observability | OpenTelemetry, Tempo, Grafana |
Containerization | Docker, Docker Compose |
- Swagger UI:
localhost:8080/swagger-ui.html
- OpenAPI Spec:
localhost:8080/v3/api-docs
Perfect for testing and development:
URL: http://localhost:8080/h2-console
JDBC: jdbc:h2:mem:test
Username: sa
Password: (configured in application.properties)
The application automatically creates these sequences:
item_seq
→ Item ID generationorder_seq
→ Order number generationinventory_seq
→ Inventory ID generation
Sample items and inventory records are automatically loaded on startup via:
schema.sql
→ Database schema and sequencesimport.sql
→ Sample data insertion
-- Generate next order number
SELECT NEXT VALUE FOR order_seq;
-- Check inventory levels
SELECT i.name, inv.quantity
FROM items i
JOIN inventory inv ON i.id = inv.item_id;
-- View recent orders
SELECT * FROM orders
ORDER BY created_at DESC
LIMIT 10;
# Run all tests
./mvnw test
Key configuration files:
application.properties
→ Main application settingsapplication-local.properties
→ Local development environmentapplication-test.properties
→ Testing environment
This project is licensed under the MIT License - see the LICENSE file for details.