How anamikasharma1509/scm-supply-chain-management works
SCM is a blockchain-backed supply-chain traceability and anti-counterfeit platform. Supplier batch registration and shipment dispatch, manufacturer receipt and lineage synthesis, and public QR/identifier verification are its principal domain stages; the API persists records and optionally consults a blockchain registry. The graph includes the documented alert, analytics, transaction, QR, and organization capabilities. Some route implementations and frontend pages were not sampled, so their internal calls are not inferred.
Main entry points: app.ts REST application · prisma.ts Database access · api.ts API client · blockchain.ts Blockchain service
Components 26
Web application
- Supplier dashboard
apps/web/src/pages/SupplierDashboard.tsx - Manufacturer dashboard
apps/web/src/pages/ManufacturerDashboard.tsx - Verification page
apps/web/src/pages/VerificationPage.tsx - Alerts page
apps/web/src/pages/AlertsPage.tsx - Authentication context
apps/web/src/context/AuthContext.tsx - API client
apps/web/src/lib/api.ts
Supply-chain API
- Authentication
apps/api/src/routes/auth.routes.ts - Organizations
apps/api/src/routes/organization.routes.ts - Batch registry
apps/api/src/routes/batch.routes.ts - Shipments and custody
apps/api/src/routes/shipment.routes.ts - Public verification
apps/api/src/routes/verify.routes.ts - QR codes
apps/api/src/routes/qr.routes.ts - Anomaly alerts
apps/api/src/routes/alert.routes.ts - Analytics
apps/api/src/routes/analytics.routes.ts - Notifications
apps/api/src/routes/notification.routes.ts - Transaction audit
apps/api/src/routes/transaction.routes.ts - Health checks
apps/api/src/routes/health.routes.ts
API platform
- REST application
apps/api/src/app.ts - JWT authorization
apps/api/src/middleware/auth.ts - Error handling
apps/api/src/middleware/errorHandler.ts - Rate limiting
apps/api/src/middleware/rateLimiter.ts
Persistence and ledger
- Database access
apps/api/src/lib/prisma.ts - Relational database
- Blockchain service
apps/api/src/lib/blockchain.ts - Blockchain registry
Other components
- Supply-chain users
Connections 47
- Supply-chain users → Supplier dashboard: registers batches
- Supply-chain users → Manufacturer dashboard: receives and processes
- Supply-chain users → Verification page: checks products
- Supply-chain users → Alerts page: reviews alerts
- Supplier dashboard → API client: requests API
apps/web/src/pages/SupplierDashboard.tsx - Manufacturer dashboard → API client: requests API
apps/web/src/pages/ManufacturerDashboard.tsx - Verification page → API client: requests verification
apps/web/src/pages/VerificationPage.tsx - Alerts page → API client: requests alerts
- Authentication context → API client: requests identity
apps/web/src/context/AuthContext.tsx - API client → REST application: sends HTTP requests
apps/web/src/lib/api.ts - REST application → Authentication: mounts routes
apps/api/src/app.ts - REST application → Organizations: mounts routes
apps/api/src/app.ts - REST application → Batch registry: mounts routes
apps/api/src/app.ts - REST application → Shipments and custody: mounts routes
apps/api/src/app.ts - REST application → Public verification: mounts routes
apps/api/src/app.ts - REST application → QR codes: mounts routes
apps/api/src/app.ts - REST application → Anomaly alerts: mounts routes
apps/api/src/app.ts - REST application → Analytics: mounts routes
apps/api/src/app.ts - REST application → Notifications: mounts routes
apps/api/src/app.ts - REST application → Transaction audit: mounts routes
apps/api/src/app.ts - REST application → Health checks: mounts routes
apps/api/src/app.ts - REST application → Error handling: registers handler
apps/api/src/app.ts - Authentication → Database access: reads and writes users
apps/api/src/routes/auth.routes.ts - Authentication → JWT authorization: authenticates sessions
apps/api/src/routes/auth.routes.ts - Authentication → Rate limiting: limits login requests
apps/api/src/routes/auth.routes.ts - Batch registry → Database access: reads and writes batches
apps/api/src/routes/batch.routes.ts - Batch registry → JWT authorization: checks roles
apps/api/src/routes/batch.routes.ts - Batch registry → Blockchain service: uses ledger service
apps/api/src/routes/batch.routes.ts - Shipments and custody → Database access: reads and writes shipments
apps/api/src/routes/shipment.routes.ts - Shipments and custody → JWT authorization: checks roles
apps/api/src/routes/shipment.routes.ts - Shipments and custody → Blockchain service: uses ledger service
apps/api/src/routes/shipment.routes.ts - Public verification → Database access: records scan evidence
apps/api/src/routes/verify.routes.ts - Public verification → Rate limiting: limits public scans
apps/api/src/routes/verify.routes.ts - Public verification → Blockchain service: checks on-chain proof
apps/api/src/routes/verify.routes.ts - Anomaly alerts → Database access: reads and updates alerts
apps/api/src/routes/alert.routes.ts - Anomaly alerts → JWT authorization: checks access
apps/api/src/routes/alert.routes.ts - Analytics → Database access: queries records
apps/api/src/routes/analytics.routes.ts - Transaction audit → Database access: reads transaction records
apps/api/src/routes/transaction.routes.ts - Transaction audit → Blockchain service: uses ledger service
apps/api/src/routes/transaction.routes.ts - Notifications → Database access: accesses notifications
apps/api/src/routes/notification.routes.ts - Notifications → JWT authorization: checks access
apps/api/src/routes/notification.routes.ts - Organizations → Database access: accesses organizations
apps/api/src/routes/organization.routes.ts - QR codes → Database access: accesses QR records
apps/api/src/routes/qr.routes.ts - Health checks → Database access: checks database
apps/api/src/routes/health.routes.ts - Health checks → Blockchain service: checks ledger
apps/api/src/routes/health.routes.ts - Database access → Relational database: persists records
- Blockchain service → Blockchain registry: reads registry
apps/api/src/lib/blockchain.ts