Multi-Objective Supply Chain Optimisation Platform - BSc Computer Science, De Montfort University
Live Demo »
·
API Docs »
Table of Contents
Intelli-Factory is a B2B2C platform that automates supply chain matching between manufacturers, customers, and logistics providers. It solves the Supply Chain Trilemma - balancing cost, delivery speed, and reliability - using evolutionary computation (NSGA-II genetic algorithm via DEAP).
Research question: does weighted multi-objective matching outperform a greedy, cheapest-first baseline under defined criteria? Answer: yes - measurably (see Benchmark Results).
The real-world motivation is the manual phone-and-WhatsApp coordination still common in the Almaty trading sector. The measured comparison, though, is algorithm against algorithm: the Greedy baseline strategy against the Deep GA, both implemented in this codebase and run over identical scenarios.
The platform covers the full workflow - request → bidding → optimisation → three-party contract signing → payment → fulfilment tracking - across four user roles (Customer, Factory, Logistics Provider, Administrator), with a nine-state request lifecycle enforced by explicit state machines and atomic database transactions.
Three optimisation strategies are available per admin request:
| Mode | Description | Speed |
|---|---|---|
| Greedy | Sort by lowest raw cost (baseline) | instant |
| Fast | Min-max normalised weighted-sum scoring | < 0.001 s |
| Deep (GA) | NSGA-II Pareto-front search via DEAP - population 100, 80 generations, tournament selection (k=3), Hall-of-Fame elitism, knee-point selection by customer weight profile | 0.069 s avg |
Every screenshot below is the deployed system at https://intelli-factory-frontend.vercel.app/, not a mockup.
Landing page - trilingual (EN / RU / KK) with six selectable themes.
Registration with Brevo email verification. Argon2id hashing and server-side sessions behind it - see Security.
Customer workspace - raise a request and track it through the nine-state lifecycle.
Factory workspace - publish inventory once, get matched automatically.
Logistics workspace - coverage, pricing constraints, and execution tracking.
Waking the demo: the backend runs on a free Render tier and the database on a free Aiven tier, so both spin down when idle. Open the site, then allow roughly 90 seconds on first load - the country list populating on the register page is the signal that the API is up.
3,600 evaluations - 120 synthetic scenarios × 30 random seeds - run on the production engine code (benchmark_evaluation.py):
| Metric | Greedy baseline | Optimised (Fast / Deep GA) | Change |
|---|---|---|---|
| Composite fitness | 0.682 | 0.801 | +17.5% |
| Delivery time | 8.02 days | 4.67 days | 41.8% faster |
| Reliability score | 0.824 | 0.891 | +8.1% |
| Raw cost (avg KZT) | 21,296 | 51,648 | +142.5% - deliberate trilemma trade-off |
- Deep GA Pareto-front hypervolume: 0.852 ± 0.12 (normalised), converging by generations 50-60
- Feasibility rate: 100% across all 120 scenarios
- Deep GA response time: 0.069 s ± 0.015 s
- Datasets: 55+ products, 12 manufacturers, 9 logistics providers
flowchart LR
U[Browser / PWA] --> FE["Next.js App Router<br/>TypeScript · Tailwind · Recharts<br/>(Vercel)"]
FE --> API["FastAPI · Python 3.12 · Uvicorn<br/>(Render)"]
API --> ENGINE["Optimisation engine<br/>DEAP · NSGA-II"]
API --> DB[("PostgreSQL 15<br/>~25 Prisma models<br/>(Aiven)")]
API --> MAIL["Brevo SMTP<br/>email verification"]
Three-tier production deployment (Vercel + Render + Aiven); Docker Compose for local development. Role-based guards at the API layer across four task-separated routers (/auth, /requests, /pairing, /automations); Pydantic validation on all payloads; auto-generated OpenAPI docs.
Python 3.12 · DEAP · Prisma ORM · Uvicorn
TypeScript · React · Tailwind CSS
Aiven managed · Docker (local)
- Email: Brevo SMTP · Auth: HttpOnly sessions · Testing: pytest / Vitest
- Python 3.12+
- Node.js 18+
- Docker & Docker Compose
- Poetry
- Clone the repo
git clone https://github.com/igor-vuta/intelli-factory.git
cd intelli-factory- Install root Node.js dependencies (frontend + scripts)
npm install- Install backend dependencies
cd backend/app/api
poetry install- Configure environment variables
Create backend/app/api/.env:
DATABASE_URL=postgresql://USER:PASSWORD@HOST:PORT/DB
SECRET_KEY=your-secret-key
BREVO_API_KEY=your-brevo-keyCreate frontend/.env.local:
BACKEND_API_URL=http://localhost:8000- Start PostgreSQL (Docker)
# from project root
docker-compose up -d- Run database migrations
cd backend/app/api
poetry run prisma migrate devThe seed scripts populate reference data (countries, regions, cities) and workflow demo scenarios.
cd backend/app/api
# 1 - Reference geography (countries / regions / cities)
poetry run python seed_reference_geo.py
# 2 - All workflow scenarios + large-scale optimisation demo
poetry run python seed.py# from project root - starts backend + frontend via concurrently
npm run dev# Terminal 1 - backend (http://localhost:8000)
npm run dev:backend
# Terminal 2 - frontend (http://localhost:3000)
npm run dev:frontendhttp://localhost:8000/docs
POST /api/automations/optimize
curl -X POST http://localhost:8000/api/automations/optimize \
-H "Content-Type: application/json" \
-d '{
"request_id": "<uuid>",
"mode": "deep"
}'mode options: fast (default) · deep (NSGA-II GA)
Response:
{
"status": "success",
"request_id": "...",
"mode": "deep",
"solution_count": 5,
"solutions": [
{
"rank": 1,
"candidate_id": "...",
"total_cost": 124500.0,
"delivery_days": 4.0,
"reliability": 0.934,
"fitness_score": 0.8712,
"score_breakdown": {
"cost_norm": 0.31,
"time_norm": 0.18,
"reliability_norm": 0.91,
"final_score": 0.8712,
"weights": { "cost": 0.34, "time": 0.33, "reliability": 0.33 }
}
}
]
}GET /api/automations/compare/{request_id} - runs greedy, fast, and deep GA in parallel and returns a side-by-side scoreboard.
Validated against the OWASP Password Storage and Session Management Cheat Sheets; no vulnerabilities found in manual code review or automated penetration testing.
- Argon2id password hashing (argon2-cffi) with transparent legacy PBKDF2-SHA256 upgrade-on-login
- CSPRNG session tokens (
secrets.token_urlsafe, 48 bytes) stored server-side as SHA-256 hashes only, 24 h TTL - HttpOnly / Secure / SameSite cookies; session ID regeneration on privilege change
- Login rate limiting (lockout after 5 failures / 15 min) with IP + user-agent logging
51 automated pytest unit & integration tests - optimisation engine (normalisation, weight profiles, feasibility, seeded reproducibility, large-scale pools), comparison router, requests router, and the full transaction → contract → fulfilment flow. TDD applied to the engine.
cd backend/app/api
# full test suite
poetry run pytest tests/ -v
# optimisation engine only
poetry run pytest tests/test_optimization_engine.py -v
# benchmark evaluation (120 synthetic scenarios)
poetry run python benchmark_evaluation.py| Service | Platform | URL |
|---|---|---|
| Frontend | Vercel (auto-deploy main) |
https://intelli-factory-frontend.vercel.app/ |
| Backend | Render free tier | https://intelli-factory-api.onrender.com |
| Database | Aiven PostgreSQL 15 | via DATABASE_URL env var |
Note: free-tier Render & Aiven spin down idle instances. After opening the register page, allow ~90 s for the backend to wake — the country list loads from the backend once it's up.
Igor Vuta - BSc (Hons) Computer Science, First-Class Honours, De Montfort University - igor_vuta@proton.me Supervisor: Dr Shengxiang Yang, School of Computer Science and Informatics
GitHub: https://github.com/igor-vuta · LinkedIn: https://www.linkedin.com/in/igor-vuta-b88017390
- DEAP - genetic algorithm / NSGA-II framework
- FastAPI - modern Python web framework
- Prisma - type-safe ORM
- Best-README-Template - README structure