How kanisk-sk/supply-chain works
This is a supply-chain tracking and analytics application: users manage master data and inventory, place and advance orders, dispatch and track shipments, and inspect alerts and live analytics. The backend’s FastAPI entry point registers the product routers; domain services own transactional rules and delegate persistence to repositories, with state machines governing order and shipment lifecycles. The tree also shows corresponding Next.js screens and shared API utilities. The README is empty, and most frontend wiring and several routers were not sampled, so those connections are not asserted here.
Main entry points: main.py FastAPI application · shipments/service.py Shipment lifecycle · inventory/service.py Inventory control · products/service.py Product catalog
Components 29
Application entry
- FastAPI application
backend/app/main.py - SQL database
backend/app/core/database.py
Supply-chain operations
- Authentication
backend/app/modules/auth - User management
backend/app/modules/users/service.py - Product catalog
backend/app/modules/products/service.py - Supplier management
backend/app/modules/suppliers/service.py - Warehouse management
backend/app/modules/warehouses - Inventory control
backend/app/modules/inventory/service.py - Order lifecycle
backend/app/modules/orders/service.py - Order state machine
backend/app/state_machines/order.py - Shipment lifecycle
backend/app/modules/shipments/service.py - Shipment state machine
backend/app/state_machines/shipment.py - Public tracking
backend/app/modules/shipments/public_router.py
Operational insight
- Alert scheduler
backend/app/jobs/service.py - Derived alerts
backend/app/modules/alerts/service.py - Live analytics
backend/app/modules/analytics/service.py - Audit history
backend/app/modules/audit_logs/service.py
Web experience
- Web API client
frontend/src/lib/api.ts - Login and access
frontend/src/app/login/page.tsx - Inventory screen
frontend/src/app/inventory/page.tsx - Order screens
frontend/src/app/orders/page.tsx - Shipment screens
frontend/src/app/shipments/page.tsx - Tracking screens
frontend/src/app/tracking/[trackingNumber]/page.tsx - Analytics screen
frontend/src/app/analytics/page.tsx - Alerts screen
frontend/src/app/alerts/page.tsx - Product screen
frontend/src/app/products/page.tsx - Supplier screen
frontend/src/app/suppliers/page.tsx - Warehouse screen
frontend/src/app/warehouses/page.tsx - Admin users
frontend/src/app/admin/users/page.tsx
Connections 38
- FastAPI application → Authentication: registers routes
backend/app/main.py - FastAPI application → User management: registers routes
backend/app/main.py - FastAPI application → Product catalog: registers routes
backend/app/main.py - FastAPI application → Supplier management: registers routes
backend/app/main.py - FastAPI application → Warehouse management: registers routes
backend/app/main.py - FastAPI application → Inventory control: registers routes
backend/app/main.py - FastAPI application → Order lifecycle: registers routes
backend/app/main.py - FastAPI application → Shipment lifecycle: registers routes
backend/app/main.py - FastAPI application → Public tracking: registers routes
backend/app/main.py - FastAPI application → Derived alerts: registers routes
backend/app/main.py - FastAPI application → Live analytics: registers routes
backend/app/main.py - FastAPI application → Alert scheduler: starts optionally
backend/app/main.py - User management → SQL database: uses ORM models
- Product catalog → Supplier management: reads supplier data
backend/app/modules/products/service.py - Product catalog → Derived alerts: reconciles stock alerts
backend/app/modules/products/service.py - Product catalog → Audit history: records changes
backend/app/modules/products/service.py - Inventory control → Product catalog: reads product data
backend/app/modules/inventory/service.py - Inventory control → Warehouse management: reads warehouse data
backend/app/modules/inventory/service.py - Inventory control → Derived alerts: reconciles alerts
backend/app/modules/inventory/service.py - Inventory control → Audit history: records changes
backend/app/modules/inventory/service.py - Order lifecycle → Product catalog: validates products
backend/app/modules/orders/service.py - Order lifecycle → Order state machine: validates transitions
backend/app/modules/orders/service.py - Order lifecycle → Audit history: records changes
backend/app/modules/orders/service.py - Shipment lifecycle → Inventory control: dispatches stock
backend/app/modules/shipments/service.py - Shipment lifecycle → Order lifecycle: reads order data
backend/app/modules/shipments/service.py - Shipment lifecycle → Shipment state machine: validates transitions
backend/app/modules/shipments/service.py - Shipment lifecycle → Derived alerts: reconciles overdue
backend/app/modules/shipments/service.py - Shipment lifecycle → Audit history: records changes
backend/app/modules/shipments/service.py - Public tracking → Shipment lifecycle: serves public view
- Alert scheduler → Derived alerts: reconciles overdue
backend/app/jobs/service.py - Alert scheduler → SQL database: queries candidates
backend/app/jobs/service.py - Live analytics → SQL database: queries metrics
backend/app/modules/analytics/service.py - Inventory screen → Web API client: uses API client
- Order screens → Web API client: uses API client
- Shipment screens → Web API client: uses API client
- Tracking screens → Web API client: uses API client
- Analytics screen → Web API client: uses API client
- Alerts screen → Web API client: uses API client