How nikhil-razdan/alsorg-packing works
1. Repository shape
This repo contains three separate application surfaces around one shared operational backend:
- packing/: the Spring Boot server and system-of-record
- packing-ui/: the main web portal for packing, warehouse, logistics, dashboards, and reports
- ShipTrack/: a mobile/field app for dispatch and logistics execution
2. Backend is the core hub
The packing/ project is the central architecture node. It is a Java/Spring Boot application with layered structure:
- controllers expose HTTP APIs
- services implement business rules and orchestration
- repositories persist entities via Spring Data JPA
- domain holds entities and enums for packing, dispatch, logistics, stickers, users, audit, and VenFlow
- security/config handle JWT auth, CORS, timezone, and reverse-proxy/header behavior
3. Backend domain boundaries
The backend is organized by business capability rather than by UI:
- Packing / item / packet / sticker: item lifecycle, QR/sticker generation, sticker history
- Warehouse / dispatch: dispatched items, challans, gate passes, POD files
- Logistics: drivers, vehicles, shifts, trips, trip items, trip locations, expenses
- Audit and activity: audit logs and operational event logs
- VenFlow: a separate workflow domain with stages, status tracking, permissions, and audit logs
- Reporting: dashboard analytics, packing/dispatch reports, inventory aging, exports, schedules
4. External integration layer
The backend also acts as an integration hub:
- Zoho Inventory integration under integration/zoho
- PDF generation services for challans, gate passes, stickers, and inventory documents
- QR/barcode generation in a dedicated service package
- Email/report scheduling for automated report delivery
These are important architectural boundaries because they turn internal operational data into external documents, exports, and third-party inventory data.
5. Primary web frontend: packing-ui/
The Vite/React web app is the main operational UI for office/plant users. It is structured as a shell plus business modules:
- top-level pages for login, dashboard, warehouse, dispatched items, users, logistics portal, Zoho items
- shell and shared components for layout, sidebar, header, and protected routing
- auth guards for authentication, role, module, and warehouse-access checks
- services/api.js and feature-specific API clients for all backend calls
6. Web app module boundaries
The web UI is split into distinct operational areas, which map closely to backend domains:
- Dashboard: stats, charts, feeds, alerts, and report viewer components
- Packing/Flow: bomflow, packflow, and venflow modules for production and workflow operations
- Logistics: fleet, drivers, trips, shifts, dispatch challans, reports
- Inventory reporting: inventory command center, master items, aging/report views
This separation is useful for diagramming because each module is a front-end boundary with its own route tree and access rules, even though all call the same backend.
7. Mobile app: ShipTrack/
ShipTrack is a React Native app, likely built with Expo/EAS, used for dispatch and logistics execution in the field. Its structure shows:
- a navigation layer with an app navigator
- authentication context
- screens for login, admin dashboard, trips, trip items, dispatch home, dispatch items, scan dispatch, and bulk scan
- API clients for auth, dispatch, challan download, logistics, live location tracking, and dispatched-item operations
This app is not the system-of-record; it is a task-focused client for scanning, trip handling, and location/status updates.
8. End-to-end operational flow
The central data flow is:
packing item creation → sticker/QR generation → warehouse movement → ready-to-dispatch → challan generation → dispatch/logistics tracking → delivery/completion
Both web and mobile clients read and write against this flow, but at different stages:
- web UI drives creation, review, admin operations, reporting, and approvals
- mobile app drives field dispatch, scanning, trip progression, and live tracking
- backend stores the authoritative status transitions and history
9. Authentication and authorization
Both frontends rely on token-based access against the backend’s JWT security layer. The web app has several route/feature guards (RequireAuth, RequireRole, RequireModule, warehouse-access checks), and the mobile app has its own auth context. This means the architecture is permission-centric: access is enforced in both UI and backend, with the backend as the final authority.
10. Persistence and history tracking
The backend uses JPA repositories over a relational database, with entities capturing:
- users, master items, packets, stickers
- dispatch/warehouse records
- trips, drivers, vehicles, expenses
- audit/activity/history tables
The presence of audit logs, sticker history, and VenFlow audit records suggests the system is designed to preserve state transitions and operational traceability, not just current status.
11. Reporting is a first-class subsystem
Reporting is not an afterthought; it has dedicated controllers, repositories, services, DTOs, and export utilities. It supports:
- dashboard metrics and activity feeds
- packing and dispatch reports
- combined operational reports
- inventory aging
- scheduled report delivery and Excel export
In an architecture diagram, this should be shown as a read-heavy subsystem fed from the same core operational data store.
12. Practical diagram view
A clear architecture diagram would show:
- two client layers: web portal and mobile field app
- one Spring Boot backend in the center
- one database underneath the backend
- side integrations for Zoho Inventory, PDF/QR generation, and email/report scheduling
- cross-cutting JWT security, RBAC, and audit/history wrapping all business flows
Main entry points: service Services · Layout.jsx Shell · api.js API Client · Packet.java Operational DB
Components 26
Spring Boot Backend
Central system-of-record for packing, dispatch, logistics, VenFlow, reporting, and integrations.
- Controllers · HTTP boundary for auth, packing, warehouse, logistics, reporting, and integrations.
packing/src/main/java/com/alsorg/packing/controller - Services · Business rules, orchestration, and workflow coordination.
packing/src/main/java/com/alsorg/packing/service - Domain Model · Core entities and enums for items, packets, dispatch, logistics, stickers, users, and VenFlow.
packing/src/main/java/com/alsorg/packing/domain - Repositories · Spring Data repositories over the operational database.
packing/src/main/java/com/alsorg/packing/repository - Security · JWT authentication, CORS, forwarded headers, and timezone configuration.
packing/src/main/java/com/alsorg/packing/config/SecurityConfig.java - Packing · Packet lifecycle, item handling, sticker history, and scanning.
packing/src/main/java/com/alsorg/packing/service/PacketService.java - Logistics · Drivers, vehicles, shifts, trips, trip items, locations, and expenses.
packing/src/main/java/com/alsorg/packing/service/LogisticsDispatchTripService.java - Reporting · Dashboard metrics, packing and dispatch reports, inventory aging, exports, and schedules.
packing/src/main/java/com/alsorg/packing/reporting/service/ReportSchedulerService.java - VenFlow · Independent workflow domain with stages, permissions, and audit tracking.
packing/src/main/java/com/alsorg/packing/service/VenFlowService.java - Audit Trail · Audit and activity logging for operational traceability.
packing/src/main/java/com/alsorg/packing/service/AuditLogService.java
Web Portal
Primary React portal for office and warehouse operations.
- Shell · App shell, navigation, and protected routing for the portal.
packing-ui/src/components/Layout.jsx - Access Guards · Route and feature guards for auth, role, module, and warehouse access.
packing-ui/src/auth/RequireAuth.jsx - Dashboard · Stats, charts, feeds, reports, and operational visibility.
packing-ui/src/pages/Dashboard.jsx - Warehouse · Warehouse operations and packing/dispatch workflow entry points.
packing-ui/src/pages/WarehousePage.jsx - Logistics Portal · Fleet, drivers, trips, challans, and logistics management UI.
packing-ui/src/pages/LogisticsPortalPage.jsx - VenFlow UI · Dedicated workflow surface with role and permission controls.
packing-ui/src/modules/venflow/VenFlowRoutes.jsx - API Client · Shared HTTP client and feature-specific API wrappers.
packing-ui/src/services/api.js
Mobile Field App
React Native app for dispatch execution and live field updates.
- Navigator · Application navigation and screen routing for field users.
ShipTrack/navigation/AppNavigator.jsx - Auth Context · Authentication state and login/session handling.
ShipTrack/auth/AuthContext.jsx - Dispatch Flow · Dispatch home, scanned items, bulk scan, and trip progression screens.
ShipTrack/screens/DispatchHomeScreen.jsx - Trips · Trip list, trip items, and admin dashboard for logistics execution.
ShipTrack/screens/TripsScreen.jsx - Mobile APIs · Dispatch, logistics, challan, location, and item update clients.
ShipTrack/api/dispatchApi.js
Integrations & Output
External system connections and generated operational documents.
- Zoho Sync · Zoho Inventory authentication, item mapping, cache, and sync client.
packing/src/main/java/com/alsorg/packing/integration/zoho/ZohoInventoryClient.java - PDF & QR · Challan, gate pass, sticker PDFs, and barcode/QR generation.
packing/src/main/java/com/alsorg/packing/service/pdf/ChalaanPdfService.java - Schedules · Scheduled reports and email delivery for recurring operational outputs.
packing/src/main/java/com/alsorg/packing/reporting/service/EmailService.java - Operational DB · System-of-record storage for operational entities and history.
packing/src/main/java/com/alsorg/packing/domain/packet/Packet.java
Connections 33
- Shell → Access Guards: protects · Shell routes are gated by authentication and permissions.
- Shell → Dashboard: hosts · Portal shell renders dashboard and operational pages.
- Shell → Warehouse: hosts · Portal shell routes to warehouse operations.
- Shell → Logistics Portal: hosts · Portal shell routes to logistics management.
- Shell → VenFlow UI: hosts · Portal shell includes the VenFlow workspace.
- Dashboard → API Client: reads · Dashboard uses shared API clients for metrics and reports.
- Warehouse → API Client: writes · Warehouse actions call backend APIs for packing and dispatch.
- Logistics Portal → API Client: writes · Logistics management uses backend APIs for trips and fleet.
- VenFlow UI → API Client: reads/writes · VenFlow UI exchanges workflow data with the backend.
- API Client → Controllers: calls · Web portal communicates with backend HTTP controllers.
- Navigator → Auth Context: uses · Navigation depends on auth state.
- Navigator → Dispatch Flow: routes · Navigator presents dispatch screens.
- Navigator → Trips: routes · Navigator presents trip screens.
- Dispatch Flow → Mobile APIs: syncs · Dispatch screens push scan and dispatch updates.
- Trips → Mobile APIs: syncs · Trip screens sync trip status and location data.
- Mobile APIs → Controllers: calls · Mobile app talks to backend controllers.
- Controllers → Services: delegates · Controllers delegate to services.
- Services → Domain Model: orchestrates · Business services manipulate core domain objects.
- Services → Repositories: persists · Services read and write through repositories.
- Services → Audit Trail: logs · Operational actions generate audit/activity entries.
- Services → Packing: implements · Packing-related services manage packet and sticker flow.
- Services → Logistics: implements · Logistics services manage dispatch execution and fleet state.
- Services → Reporting: implements · Reporting services aggregate operational data.
- Services → VenFlow: implements · VenFlow services manage workflow stages and permissions.
- Services → Zoho Sync: syncs · Services integrate with Zoho Inventory.
- Services → PDF & QR: generates · Services produce PDFs, QR codes, and barcodes.
- Reporting → Schedules: schedules · Reports can be scheduled and emailed.
- Controllers → Security: secured by · API boundary is protected by JWT and edge-aware config.
- Repositories → Operational DB: stores · Repositories persist into the relational system-of-record.
- Zoho Sync → Operational DB: reflects · Zoho sync maps external inventory state to local records.
- PDF & QR → Operational DB: reads · Document generation uses operational data.
- Reporting → Operational DB: reads · Reporting is read-heavy over operational history.
- VenFlow → Operational DB: stores · VenFlow workflow state and audit history are persisted.