How ackzerman/assignment works
The Parcel Routing System turns parcel data into explainable department and approval decisions. Operators can route one parcel synchronously or upload a batch, which is validated, queued, processed in chunks, and made available through progress polling and paginated results. The React interface presents both workflows. Redis holds temporary batch state and BullMQ work; health checks and metrics expose operational status. The graph follows documented and sampled wiring; unsampled frontend and infrastructure details are represented only where the README supports them.
Main entry points: app.js Express application · batchRoutes.js Batch endpoints · worker.js Batch worker · App.jsx Application shell
Components 25
Operator interface
- Application shell
frontend/src/App.jsx - Single parcel form
frontend/src/components/ParcelForm.jsx - Batch upload
frontend/src/components/BatchUpload.jsx - Routing result
frontend/src/components/RoutingResult.jsx - Batch results
frontend/src/components/BatchResults.jsx - API client
frontend/src/api.js
HTTP API
- Express application
backend/src/app.js - Parcel endpoints
backend/src/api/routes/parcelRoutes.js - Batch endpoints
backend/src/api/routes/batchRoutes.js - Security middleware
backend/src/api/middleware/security.js - Request logging
backend/src/api/middleware/requestLogger.js - Error handling
backend/src/api/middleware/errorHandler.js
Routing domain
- Parcel validation
backend/src/domain/validation.js - Batch validation
backend/src/domain/batchProcessor.js - Routing engine
backend/src/domain/routingEngine.js - Routing rules
backend/src/domain/rules.js
Batch processing
- BullMQ queue
backend/src/infrastructure/queue.js - Batch worker
backend/src/infrastructure/worker.js - Temporary batch state
backend/src/infrastructure/batchStore.js - Redis client
backend/src/infrastructure/redis.js
Operations
- Metrics
backend/src/observability/metrics.js - Anomaly detection
backend/src/observability/anomalyDetector.js - Structured logger
backend/src/observability/logger.js
Other components
- Parcel operator
- Redis
Connections 38
- Parcel operator → Application shell: uses
- Application shell → Single parcel form: renders
- Application shell → Batch upload: renders
- Application shell → Routing result: shows
- Application shell → Batch results: shows
- Single parcel form → API client: submits parcel
- Batch upload → API client: submits batch
- API client → Express application: HTTP requests
- Express application → Parcel endpoints: dispatches
- Express application → Batch endpoints: dispatches
- Express application → Security middleware: applies
- Express application → Request logging: applies
- Express application → Error handling: handles errors
- Parcel endpoints → Parcel validation: validates
- Parcel endpoints → Routing engine: routes parcel
- Parcel endpoints → Metrics: records outcomes
- Parcel endpoints → Structured logger: logs outcomes
- Routing engine → Routing rules: evaluates
- Batch endpoints → Batch validation: validates batch
- Batch endpoints → Redis client: checks Redis
- Batch endpoints → Temporary batch state: creates and reads state
- Batch endpoints → BullMQ queue: enqueues batch
- Batch endpoints → Metrics: updates queue depth
- BullMQ queue → Redis client: uses connection
- Temporary batch state → Redis client: uses connection
- Redis client → Redis: connects
- BullMQ queue → Batch worker: dispatches jobs
- Batch worker → Temporary batch state: loads and checkpoints
- Batch worker → Parcel validation: validates parcels
- Batch worker → Routing engine: routes parcels
- Batch worker → Metrics: records jobs
- Batch worker → Structured logger: logs errors
- Express application → Metrics: serves metrics
- Express application → BullMQ queue: checks queue health
- Express application → Redis client: checks readiness
- Express application → Anomaly detection: checks alerts
- Error handling → Metrics: records errors
- Error handling → Structured logger: logs errors