How gargharshit304-lab/stocksense works
StockSense is a role-based warehouse inventory system. Managers and staff use the React application to review stock and perform receiving, delivery, transfer, and count workflows; the documented operational stages update inventory and movement history. The backend exposes authenticated APIs, with authentication and inventory operations backed by Prisma. The README describes broader capabilities than the sampled runtime excerpts; edges for unsampled workflows are limited to documented relationships, and the frontend is described as demo-mode/localStorage by default.
Main entry points: App.tsx App workflow shell · auth.ts Auth service · controllers Inventory handlers · prisma.ts PostgreSQL via Prisma
Components 28
Web application
- App workflow shell
src/App.tsx - Sign-in and signup
src/components/AuthView.tsx - Manager dashboard
src/components/DashboardView.tsx - Staff operations
src/components/StaffDashboardView.tsx - Product catalog
src/components/ProductsView.tsx - Receiving workflow
src/components/ReceiptsView.tsx - Delivery picking
src/components/DeliveryOrdersView.tsx - Stock counting
src/components/InventoryAdjustmentView.tsx - Warehouse transfers
src/components/WarehouseView.tsx - Movement audit
src/components/MoveHistoryView.tsx - Staff task history
src/components/StaffOperationHistoryView.tsx - HTTP client
src/api/client.ts
Identity and access
- Auth state
src/context/AuthContext.tsx - Authentication routes
backend/src/routes/auth.ts - Auth handlers
backend/src/controllers/auth.ts - Auth service
backend/src/services/auth.ts - Token and role guards
backend/src/middleware/auth.ts - JWT utilities
backend/src/utils/jwt.ts
Inventory operations
- Picking and workflows
backend/src/services/picking.ts - Stock logic
backend/src/services/stock.ts - Dashboard queries
backend/src/services/dashboard.ts
API and domain services
- Express API
backend/src/app.ts - API route registry
backend/src/routes/index.ts - Inventory API routes
backend/src/routes - Inventory handlers
backend/src/controllers
Persistence and messaging
- PostgreSQL via Prisma
backend/src/utils/prisma.ts - Transactional email
backend/src/utils/sendEmail.ts
Other components
- Manager or staff
Connections 35
- Manager or staff → App workflow shell: uses
- App workflow shell → Sign-in and signup: renders
src/App.tsx - App workflow shell → Manager dashboard: renders
src/App.tsx - App workflow shell → Staff operations: renders
src/App.tsx - App workflow shell → Product catalog: renders
src/App.tsx - App workflow shell → Receiving workflow: renders
src/App.tsx - App workflow shell → Delivery picking: renders
src/App.tsx - App workflow shell → Stock counting: renders
src/App.tsx - App workflow shell → Warehouse transfers: renders
src/App.tsx - App workflow shell → Movement audit: renders
src/App.tsx - App workflow shell → Staff task history: renders
src/App.tsx - App workflow shell → Auth state: reads auth
src/App.tsx - Sign-in and signup → Auth state: calls auth
src/components/AuthView.tsx - Auth state → HTTP client: sends requests
src/context/AuthContext.tsx - HTTP client → Express API: HTTP requests
- Express API → API route registry: mounts routes
backend/src/app.ts - API route registry → Authentication routes: registers
backend/src/routes/index.ts - API route registry → Inventory API routes: registers
backend/src/routes/index.ts - Authentication routes → Auth handlers: dispatches
backend/src/routes/auth.ts - Auth handlers → Auth service: calls
backend/src/controllers/auth.ts - Auth handlers → Token and role guards: uses guards
backend/src/routes/auth.ts - Auth service → PostgreSQL via Prisma: reads and writes
backend/src/services/auth.ts - Auth service → JWT utilities: creates tokens
backend/src/services/auth.ts - Auth service → Transactional email: sends OTP
backend/src/services/auth.ts - Inventory API routes → Inventory handlers: dispatches
backend/src/routes/auth.ts - Inventory handlers → Picking and workflows: invokes workflows
- Inventory handlers → Stock logic: invokes stock logic
- Inventory handlers → Dashboard queries: queries dashboard
- Picking and workflows → PostgreSQL via Prisma: updates operations
- Stock logic → PostgreSQL via Prisma: persists stock
- Dashboard queries → PostgreSQL via Prisma: reads metrics
- Receiving workflow → Manager or staff: creates and validates
- Delivery picking → Manager or staff: picks packs validates
- Warehouse transfers → Manager or staff: coordinates transfer
- Stock counting → Manager or staff: records count