How kaviselvam31/storeflow works
Purpose and Runtime
StoreFlow is a Spring Boot backend for store operations, exposing CRUD-oriented APIs for organizational, catalog, inventory, purchasing, and sales records. The application starts at src/main/java/com/storeflow/StoreApplication.java; Maven build and dependency/runtime definition is pom.xml. Runtime settings, including the persistence connection configuration, are expected in src/main/resources/application.properties.
API Boundary
HTTP request handling is split by business resource into Spring controllers. Controllers are the external API boundary and delegate operations to corresponding services:
• Store structure: src/main/java/com/storeflow/controller/BranchController.java, src/main/java/com/storeflow/controller/CategoryController.java
• Parties: src/main/java/com/storeflow/controller/CustomerController.java, src/main/java/com/storeflow/controller/SupplierController.java
• Commercial workflows: src/main/java/com/storeflow/controller/PurchaseController.java, src/main/java/com/storeflow/controller/SalesController.java
• Stock/catalog: src/main/java/com/storeflow/controller/ProductController.java, src/main/java/com/storeflow/controller/InventoryController.java
Domain Model
JPA-style entities model the persisted business records and their relationships:
• Organization and catalog: src/main/java/com/storeflow/entity/Branch.java, src/main/java/com/storeflow/entity/Category.java, src/main/java/com/storeflow/entity/Product.java
• Supply and stock: src/main/java/com/storeflow/entity/Supplier.java, src/main/java/com/storeflow/entity/Purchase.java, src/main/java/com/storeflow/entity/PurchaseItem.java, src/main/java/com/storeflow/entity/Inventory.java
• Demand: src/main/java/com/storeflow/entity/Customer.java, src/main/java/com/storeflow/entity/Sales.java
The README specifically notes review of Product soft delete, making product lifecycle behavior a material catalog concern.
Service Layer
Services form the application/business boundary between controllers and persistence. Each primary resource has a dedicated service, including src/main/java/com/storeflow/service/ProductService.java, src/main/java/com/storeflow/service/InventoryService.java, and src/main/java/com/storeflow/service/PurchaseService.java. This layout indicates CRUD validation and lifecycle logic should reside here rather than in HTTP controllers or repositories.
Persistence Layer
Repository interfaces isolate entity storage access and are the boundary to the configured relational database/JPA provider:
• Core master data: src/main/java/com/storeflow/repository/BranchRepository.java, src/main/java/com/storeflow/repository/ProductRepository.java
• Transactional records: src/main/java/com/storeflow/repository/PurchaseRepository.java, src/main/java/com/storeflow/repository/PurchaseItemRepository.java, src/main/java/com/storeflow/repository/SalesRepository.java
• Stock: src/main/java/com/storeflow/repository/InventoryRepository.java
Primary Flow and Dependencies
The dominant control flow is controller → service → repository → database, returning entity-backed API responses. Catalog and supplier data support purchase records; purchases are decomposed into purchase items; inventory represents stocked products; customer and product data support sales records. Branches provide the store-location dimension across operational records. The important architectural boundaries are HTTP controllers, service-managed business logic, and repositories backed by infrastructure configured through application.properties.
Main entry points: Product.java Product · Branch.java Branch · Purchase.java Purchase · Sales.java Sales
Components 22
Runtime
- Maven Build
pom.xml - StoreApplication
src/main/java/com/storeflow/StoreApplication.java - Runtime Settings · Configures the persistence connection.
src/main/resources/application.properties
HTTP API
- Resource Controllers · Branch, category, customer, supplier, purchase, sales, product, and inventory endpoints.
Application Services
- Product Service · Owns product lifecycle logic, including soft-delete behavior.
src/main/java/com/storeflow/service/ProductService.java - Inventory Service
src/main/java/com/storeflow/service/InventoryService.java - Purchase Service
src/main/java/com/storeflow/service/PurchaseService.java - Other Resource Services · Services for branches, categories, customers, suppliers, and sales.
Domain Model
- Branch · Store-location dimension for operations.
src/main/java/com/storeflow/entity/Branch.java - Category
src/main/java/com/storeflow/entity/Category.java - Product
src/main/java/com/storeflow/entity/Product.java - Supplier
src/main/java/com/storeflow/entity/Supplier.java - Purchase
src/main/java/com/storeflow/entity/Purchase.java - Purchase Item · Line items that decompose a purchase.
src/main/java/com/storeflow/entity/PurchaseItem.java - Inventory · Stocked product records.
src/main/java/com/storeflow/entity/Inventory.java - Customer
src/main/java/com/storeflow/entity/Customer.java - Sales
src/main/java/com/storeflow/entity/Sales.java
Persistence
- Product Repository
src/main/java/com/storeflow/repository/ProductRepository.java - Inventory Repository
src/main/java/com/storeflow/repository/InventoryRepository.java - Purchase Repositories · Stores purchases and their line items.
src/main/java/com/storeflow/repository/PurchaseRepository.java - Other Repositories · Storage access for branches, sales, and other master data.
src/main/java/com/storeflow/repository/BranchRepository.java - Relational Database
Connections 25
- Maven Build → StoreApplication: builds
- StoreApplication → Resource Controllers: boots
- Resource Controllers → Product Service: delegates catalog requests
- Resource Controllers → Inventory Service: delegates stock requests
- Resource Controllers → Purchase Service: delegates purchase requests
- Resource Controllers → Other Resource Services: delegates other resources
- Product Service → Product Repository: persists products
- Inventory Service → Inventory Repository: persists stock
- Purchase Service → Purchase Repositories: persists purchases
- Other Resource Services → Other Repositories: persists resources
- Product Repository → Relational Database: JPA access
- Inventory Repository → Relational Database: JPA access
- Purchase Repositories → Relational Database: JPA access
- Other Repositories → Relational Database: JPA access
- Runtime Settings → Relational Database: connection configuration
- Product → Category: classified by
- Purchase → Supplier: sourced from
- Purchase → Purchase Item: contains
- Purchase Item → Product: references
- Inventory → Product: stocks
- Sales → Customer: sold to
- Sales → Product: references
- Branch → Purchase: operational location
- Branch → Inventory: operational location
- Branch → Sales: operational location