EcoCycle Co. distributes eco-friendly products across multiple warehouse locations throughout Asia. This Multi-Warehouse Inventory Management System (IMS) tracks inventory across all locations, manages stock movements, prevents stockouts, and supports their sustainability mission through carbon footprint tracking and circular economy flows.
EcoCycle struggles with:
- Tracking inventory across multiple Asian warehouses
- Coordinating inter-warehouse transfers
- Preventing stockouts while avoiding overstock
- Measuring carbon impact of their eco-friendly operations
- Managing circular economy flows (recycling, refurbishing)
- Frontend: Next.js 14, TypeScript, Tailwind CSS, React Icons
- Backend: Node.js + Express, Prisma ORM, PostgreSQL (Supabase)
- Auth: JWT authentication via Supabase Auth
- User - Staff authentication & roles
- Warehouse - Multiple locations with sustainability metrics
- Product - Eco-friendly products with carbon tracking
- Category - Product classification hierarchy
- Inventory - Stock levels per warehouse
- Transfer + TransferItem - Inter-warehouse movements
- StockCount - Physical inventory counting
- Transaction + TransactionItem - Stock movements
- Order + OrderItem - Customer order fulfillment
- Supplier + SupplierProduct - Vendor management
- PurchaseOrder + PurchaseOrderItem - Procurement
- Delivery + DeliveryItem - Goods receipt tracking
- CarbonTracking - Carbon impact monitoring
- RecyclingRecord - Circular economy flows
- MaterialFlow - Material input/output analysis
- SystemSetting - Application configuration
- AuditLog - Change tracking and audit trail
- Express server with TypeScript ✓
- PostgreSQL on Supabase ✓
- Prisma ORM with all 17 models ✓
- Environment configuration ✓
- Router setup ✓
- Warehouse Module - Service, Controller, Routes ✓
- Inventory Module - Service, Controller, Routes ✓
- Product Module - Service, Controller, Routes ✓
- Category Module - Service, Controller, Routes ✓
- Transaction Module - Service, Controller, Routes ✓
- Order Module - Service, Controller, Routes ✓
- Supply Chain Module - Service, Controller, Routes ✓
- Suppliers Management ✓
- Purchase Orders Management ✓
- Deliveries Management ✓
-
Transfer Module - Service, Controller, Routes ✓
- Inter-warehouse stock movements
- Transfer workflow (PENDING → COMPLETED)
- Stock validation and automatic inventory updates
- Transfer number generation (TRF-YYYYMM-XXXXX)
-
StockCount Module - Service, Controller, Routes ✓
- Physical inventory counting
- Bulk counting support
- Variance calculation and tracking
- Workflow (PENDING → REVIEWED → ADJUSTED)
- Automatic transaction creation on adjustment
- Sustainability Module - Service, Controller, Routes ✓
-
Carbon Tracking -
/sustainability/carbon- Track emissions by scope (SCOPE_1, SCOPE_2, SCOPE_3)
- Monitor by category (TRANSPORT, ENERGY, WASTE, MATERIALS)
- Source tracking for warehouses and transfers
-
Recycling Records -
/sustainability/recycling- Track circular economy flows
- Record by type (PLASTIC, PAPER, METAL, ELECTRONIC, ORGANIC)
- Calculate carbon saved and landfill diverted
- Method tracking (MECHANICAL, CHEMICAL, COMPOSTING)
-
Material Flow -
/sustainability/material-flow- Track material inputs/outputs
- Categorize flows (INPUT, OUTPUT, WASTE, RECYCLED)
- Source and destination tracking
- Material flow analysis
-
Sustainability Dashboard -
/sustainability/dashboard- Combined metrics for all sustainability data
- Warehouse-specific summaries
- Real-time impact tracking
-
- Authentication Middleware - JWT validation with Supabase
- Seed Data - Sample data for testing
- User Management Module - Staff authentication & roles (User model)
- System Settings Module - Application configuration (SystemSetting model)
- Audit Log Module - Change tracking (AuditLog model)
- Analytics Module - Stock value, turnover rates
- Dashboard Module - Main dashboard with KPIs
- Frontend Integration - Connect Next.js frontend
- API Documentation - Swagger/OpenAPI docs
- Testing Suite - Unit and integration tests
- Deployment Configuration - Docker, CI/CD
- Total Models: 17
- Completed Modules: 10 (covering 14 models)
- Remaining Models: 3 (User, SystemSetting, AuditLog)
- Completion Status: 82% of backend complete
// Request Body (same for all search endpoints)
{
"search": "", // Search term
"currentPage": 1, // Page number (1-based)
"limit": 10, // Items per page
"filters": {}, // Table-specific filters
"sort": { // Sorting preferences
"field": "createdAt",
"order": "desc" // "asc" or "desc"
}
}
// Response Pattern
{
"success": true,
"data": [...], // Array of records
"pagination": { // Complete pagination metadata
"currentPage": 1,
"limit": 10,
"total": 145,
"totalPages": 15,
"hasNext": true,
"hasPrev": false
}
}