A production-ready Spring Boot REST API for retail and e-commerce inventory management with hierarchical categories, product variants, and barcode scanning capabilities.
- π Quick Start - Get running in 5 minutes
- π Documentation - Detailed guides
- π Architecture - System design overview
- π Tech Stack - Technologies used
- π Project Structure - Folder organization
Techsloyd is an enterprise-grade inventory management system designed for:
- πͺ Retail POS Systems
- ποΈ E-commerce Platforms
- π¦ Warehouse Management
- π± Mobile Applications
- β Hierarchical product categories (unlimited nesting)
- β Product variants with attribute combinations (Size, Color, etc.)
- β Barcode registry (5 formats: UPC-A, UPC-E, EAN-13, EAN-8, CODE-128)
- β Real-time stock tracking
- β Price management with variant adjustments
- β Tree operations with cycle detection
- β Full-text product search
- β CORS-enabled for frontend integration
- Java 17+
- PostgreSQL 12+
- Maven 3.9+ (or use bundled
mvnw)
# 1. Clone repository
git clone <repo-url> && cd Techsloyd
# 2. Create database and run schema
psql -U postgres -d api -f Schema.sql
# 3. Configure & Run
cd backend-api
mvnw spring-boot:runAPI available at: http://localhost:8080/api
β‘οΈ Detailed Setup: See Setup.md
| Document | Purpose |
|---|---|
| Task.md | Internship project assignment - 30 APIs across 4 modules |
| PROJECT.md | Complete system architecture, module organization, API endpoints |
| SQL.md | Database schema, ER diagrams, table relationships, workflows |
| Setup.md | Step-by-step installation for all operating systems |
Controllers (REST API)
β
Services & Repositories (Business Logic & Data Access)
β
Database (PostgreSQL - 7 Normalized Tables)
Category (self-referencing tree)
β
Product
ββ ProductVariant
β ββ VariantCombination
β ββ VariantOption & VariantOptionValue
β
ββ Barcode
| Component | Technology | Version |
|---|---|---|
| Language | Java | 17 |
| Framework | Spring Boot | 3.4.12 |
| Database | PostgreSQL | 12+ |
| ORM | Hibernate/JPA | 6.x |
| Build | Maven | 3.9.11 |
| Utilities | Lombok | 1.18.42 |
| Testing | JUnit 5 | 5.x |
Techsloyd/
βββ README.md # This file
βββ PROJECT.md # System architecture & module details
βββ SQL.md # Database schema & ER diagrams
βββ Setup.md # Installation guide
βββ Task.md # Internship project assignment
βββ Schema.sql # Database initialization script
β
βββ backend-api/ # Spring Boot application
βββ pom.xml # Maven dependencies
βββ mvnw # Maven wrapper (Linux/macOS)
βββ mvnw.cmd # Maven wrapper (Windows)
βββ HELP.md
β
βββ src/
β βββ main/
β β βββ java/com/inventory/backend_api/
β β β βββ BackendApiApplication.java # Main entry point
β β β β
β β β βββ controller/ # REST endpoints (30 APIs)
β β β β βββ ProductController.java # 8 Product APIs
β β β β βββ CategoryController.java # 9 Category APIs
β β β β βββ VariantController.java # 10 Variant APIs
β β β β βββ BarcodeController.java # 3 Barcode APIs
β β β β
β β β βββ services/ # Business logic
β β β β βββ VariantService.java
β β β β
β β β βββ entity/ # JPA entities (7 classes)
β β β β βββ Barcode.java
β β β β βββ Category.java
β β β β βββ Product.java
β β β β βββ ProductVariant.java
β β β β βββ VariantCombination.java
β β β β βββ VariantOption.java
β β β β βββ VariantOptionValue.java
β β β β
β β β βββ repository/ # Data access (7 interfaces)
β β β β βββ BarcodeRepository.java
β β β β βββ CategoryRepository.java
β β β β βββ ProductRepository.java
β β β β βββ ProductVariantRepository.java
β β β β βββ VariantCombinationRepository.java
β β β β βββ VariantOptionRepository.java
β β β β βββ VariantOptionValueRepository.java
β β β β
β β β βββ dto/ # DTOs & models
β β β βββ BarcodeService.java
β β β βββ CategoryReorderRequest.java
β β β βββ CategoryStatsResponse.java
β β β βββ CreateOptionRequest.java
β β β βββ CreateValueRequest.java
β β β βββ GenerateMatrixRequest.java
β β β βββ MoveCategoryRequest.java
β β β βββ ScanResponse.java
β β β
β β βββ resources/
β β βββ application.properties # Spring configuration
β β βββ static/ # Static assets
β β βββ templates/ # HTML templates
β β
β βββ test/
β βββ java/com/inventory/backend_api/
β βββ BackendApiApplicationTests.java # Unit tests
β
βββ target/ # Build output (auto-generated)
βββ classes/
βββ generated-sources/
βββ test-classes/
This project consists of 4 modules with 30 RESTful APIs:
Priority: HIGH | Complexity: Medium
Core product CRUD operations with search, filtering, pagination, and bulk operations.
| Endpoint | Method | Purpose |
|---|---|---|
/api/products |
GET | Get all products with pagination |
/api/products/:id |
GET | Get product details |
/api/products |
POST | Create new product |
/api/products/:id |
PUT | Update product |
/api/products/:id |
DELETE | Delete product |
/api/products/search |
GET | Full-text search |
/api/products/bulk-update |
POST | Bulk update products |
/api/products/bulk-delete |
POST | Bulk delete products |
Priority: HIGH | Complexity: Medium-High
Hierarchical category tree management with reordering and statistics.
| Endpoint | Method | Purpose |
|---|---|---|
/api/categories |
GET | Get all categories |
/api/categories/tree |
GET | Get hierarchical tree |
/api/categories/:id |
GET | Get category details |
/api/categories |
POST | Create category |
/api/categories/:id |
PUT | Update category |
/api/categories/:id |
DELETE | Delete category |
/api/categories/move |
POST | Move category in tree |
/api/categories/reorder |
POST | Reorder categories |
/api/categories/statistics |
GET | Get category stats |
Priority: MEDIUM | Complexity: High
Product variants with options, values, auto-generated matrix, and inventory management.
| Endpoint | Method | Purpose |
|---|---|---|
/api/variants/options |
GET | Get all options |
/api/variants/options |
POST | Create option |
/api/variants/options/:id/values |
GET | Get option values |
/api/variants/options/:id/values |
POST | Create option value |
/api/products/:id/variants |
GET | Get product variants |
/api/variants/generate-matrix |
POST | Auto-generate variants |
/api/variants/:id/inventory |
PUT | Update inventory |
/api/variants/:id/pricing |
PUT | Update pricing |
/api/variants/options/:id |
DELETE | Delete option |
/api/variants/options/:id/values/:valueId |
DELETE | Delete value |
Priority: MEDIUM | Complexity: Low
Barcode scanning and validation with POS integration.
| Endpoint | Method | Purpose |
|---|---|---|
/api/barcode/scan |
POST | Process barcode scan |
/api/barcode/lookup/:barcode |
GET | Lookup by barcode |
/api/barcode/validate |
POST | Validate format |
Total: 8 + 9 + 10 + 3 = 30 APIs β
# Build project
mvnw clean install
# Run application
mvnw spring-boot:run
# Run tests
mvnw test
# Build JAR for production
mvnw clean package
java -jar target/backend-api-0.0.1-SNAPSHOT.jarPostgreSQL with 7 normalized tables (3NF):
- categories, products, product_variants, variant_options, variant_option_values, variant_combinations, barcodes
β‘οΈ Schema Details: See SQL.md for ER diagrams, relationships, and workflows
Edit backend-api/src/main/resources/application.properties:
spring.datasource.url=jdbc:postgresql://localhost:5432/api
spring.datasource.username=postgres
spring.datasource.password=YOUR_PASSWORD
spring.jpa.hibernate.ddl-auto=validatecurl -X POST http://localhost:8080/api/categories \
-H "Content-Type: application/json" \
-d '{
"name": "Electronics",
"slug": "electronics",
"description": "Electronic devices"
}'curl -X POST http://localhost:8080/api/products \
-H "Content-Type: application/json" \
-d '{
"category": {"id": "category-uuid"},
"name": "Wireless Mouse",
"sku": "MOUSE-001",
"price": 29.99,
"stockLevel": 50
}'curl "http://localhost:8080/api/products/search?query=mouse"| Issue | Solution |
|---|---|
| PostgreSQL connection refused | Ensure PostgreSQL is running: psql -U postgres |
| Table not found | Run Schema.sql: psql -U postgres -d api -f Schema.sql |
| Port 8080 in use | Change port: server.port=8090 in application.properties |
| Build fails | Clear cache: mvnw clean compile |
β‘οΈ More Help: See Setup.md - Troubleshooting
- Read PROJECT.md - Understand system architecture
- Review SQL.md - Study database design
- Follow Setup.md - Get it running
- Explore API endpoints - Test with Postman/cURL
- Review source code - Understand implementation
- β Create hierarchical product categories
- β Add products with multiple variants
- β Link variant options (Size, Color, etc.)
- β Manage product pricing and stock
- β Scan barcodes for POS systems
- β Search products by name/SKU
- β Move categories in tree structure
- Cycle Detection: Prevents circular category hierarchies
- Variant Pricing: Supports fixed and percentage adjustments
- Barcode Formats: UPC, EAN, CODE-128 validation
- Stock Tracking: Independent variant-level inventory
- Clone repository
- Create feature branch:
git checkout -b feature/your-feature - Commit changes:
git commit -m "Add feature" - Push branch:
git push origin feature/your-feature - Open pull request
- Schema.sql - Database creation script
- pom.xml - Maven dependencies
- application.properties - Spring Boot configuration
- BackendApiApplication.java - Application entry point
- PROJECT.md - Detailed system architecture
- SQL.md - Database schema reference
- Setup.md - Complete installation guide
- Spring Boot Docs
- PostgreSQL Docs
- Version: 1.0
- Status: β Production Ready
- Last Updated: January 16, 2026
- License: MIT
For issues or questions:
- Check Setup.md - Troubleshooting
- Review PROJECT.md for detailed architecture
- Consult SQL.md for database questions
- Search Spring Boot Documentation
Happy Coding! π