Full-stack supply chain intelligence platform for Algerian SMEs, integrating inventory management, procurement, BI dashboards, demand forecasting, risk scoring, and explainable replenishment recommendations.
# SupplyQuest DZ
Phase 2 inventory-intelligence platform for Algerian SMEs, with a multi-tenant PostgreSQL backend and a React operations workspace.
## Implemented foundation and Phase 1
- React + TypeScript + Vite + Tailwind CSS frontend
- Node.js + Express + TypeScript REST API under `/api/v1/`
- PostgreSQL + Prisma relational foundation
- JWT authentication with bcrypt password hashing
- Server-side organization isolation and reusable RBAC middleware
- English, French, and Arabic locale switching with Arabic RTL support
- DZD, date, number, and Algerian wilaya utilities
- Deterministic synthetic demo seed data
- Products, categories, suppliers, customers, and warehouses
- Inventory levels, initial stock, adjustments, and movement history
- Purchase orders with partial/full receiving and atomic inventory updates
- Sales orders with stock-checked atomic completion
- Warehouse transfers with atomic transfer-in/transfer-out movements
- Organization-scoped APIs and frontend screens for all Phase 1 workflows
- API integration tests for auth, RBAC, tenant isolation, and transactional workflows
- Explainable inventory health, demand, coverage, aging, turnover, slow-moving, overstock, and ABC analytics
- Stockout risk, reorder points, replenishment recommendations, supplier performance, warehouse comparison, and deduplicated operational alerts
- Intelligence dashboard and detail screens at `/intelligence`, `/intelligence/inventory`, `/intelligence/suppliers`, `/intelligence/warehouses`, `/intelligence/recommendations`, and `/intelligence/alerts`
See docs/ARCHITECTURE.md for the implemented boundaries and decisions. docs/PRODUCT_SPEC.md remains the product source of truth.
## Run locally
Replit provides `DATABASE_URL` for its managed PostgreSQL database. For another environment:
```bash
cp .env.example .env
npm install
npm run db:generate
npm run db:migrate -- --name foundation
npm run db:seed
npm run dev
```
The app serves the frontend and API on port 5000. Run `n …