How eltemsahy/warehouse-system works
This is a TypeScript/Express modular monolith for warehouse operations. The implemented workflow is an API request for catalog, location, or stock operations: routes validate input and invoke application services or use cases, which enforce domain rules and access repositories or the stock ledger. Inventory also supports idempotent writes, reliable event delivery, and a nightly integrity check. The admin frontend is an early-stage landing page, not a demonstrated operational client. Some subsystem wiring is unsampled, so uncertain relationships are omitted.
Main entry points: app.ts Express app · api/routes.ts Inventory routes · api/routes.ts Catalog routes · item-service.ts Catalog services
Components 19
API runtime
- Express app
apps/api/src/app.ts
Master data
- Catalog routes
modules/catalog/api/routes.ts - Catalog services
modules/catalog/application/item-service.ts - Catalog repository
modules/catalog/infrastructure/pg-catalog-repository.ts - Location routes
modules/locations/api/routes.ts - Location services
modules/locations/application/location-service.ts - Locations repository
modules/locations/infrastructure/pg-locations-repository.ts
Inventory operations
- Inventory routes
modules/inventory/api/routes.ts - Stock adjustment
modules/inventory/application/adjust-stock.ts - Stock transfer
modules/inventory/application/transfer-stock.ts - Stock ledger
modules/inventory/infrastructure/pg-stock-ledger.ts - Ledger integrity
modules/inventory/application/check-ledger-integrity.ts
Reliability services
- Idempotency
shared/http/idempotency.ts - Outbox relay
shared/events/outbox-relay.ts - Daily scheduler
shared/jobs/daily-job.ts
Admin frontend
- Admin landing page
apps/web-admin/src/pages/LandingPage.tsx - Dashboard preview
apps/web-admin/src/features/landing/components/DashboardPreview.tsx - Preview data
apps/web-admin/src/features/landing/data/previewData.ts
Other components
- API caller
Connections 16
- API caller → Express app: sends requests
README.md - Express app → Catalog routes: mounts module
apps/api/src/app.ts - Express app → Location routes: mounts module
apps/api/src/app.ts - Express app → Inventory routes: mounts module
apps/api/src/app.ts - Express app → Idempotency: installs middleware
apps/api/src/app.ts - Express app → Outbox relay: creates relay
apps/api/src/app.ts - Express app → Daily scheduler: schedules check
apps/api/src/app.ts - Catalog routes → Catalog services: invokes services
modules/catalog/api/routes.ts - Catalog services → Catalog repository: reads and writes
modules/catalog/application/item-service.ts - Location routes → Location services: invokes services
modules/locations/api/routes.ts - Location services → Locations repository: reads and writes
modules/locations/application/location-service.ts - Inventory routes → Stock adjustment: executes adjustment
modules/inventory/api/routes.ts - Inventory routes → Stock transfer: executes transfer
modules/inventory/api/routes.ts - Inventory routes → Stock ledger: reads balance
modules/inventory/api/routes.ts - Admin landing page → Dashboard preview: renders preview
- Dashboard preview → Preview data: uses data
apps/web-admin/src/features/landing/components/DashboardPreview.tsx