Meridian AI is a monorepo for supply-chain disruption intelligence. It combines a React frontend (dashboard, maps, charts, lane intelligence) with backend services for route enrichment, AI analysis, and the new Python migration scaffold.
frontend/React (CRA) app with Tailwind, Radix UI primitives, Framer Motion, ECharts, TanStack Table, andreact-map-gl.backend/Express + TypeScript API for:- route enrichment (
/api/v1/routes/enrich) - AI analysis (
/api/v1/analyze-supply-chain)
- route enrichment (
backend_py/FastAPI scaffold (Phase 0A) with:- request-id middleware + JSON logging
- dependency-aware health checks (
/health,/api/v1/health) - compatibility proxy endpoints for gradual migration from
backend/ - Phase 1 ingestion endpoints (
/api/v1/ingest/*) with upload hashing + dedupe metadata - Phase 1B normalization endpoints for canonical shipment validation + quarantine artifacts
- Root workspace scripts orchestrate frontend/backend via npm.
- Dashboard: KPI cards, disruption feed, global map overlays, trend charts.
- Insights: filter panel, risk charts, lane table with sorting/pagination.
- Disruption Detail: focused incident map, timeline, impacted lanes, mitigation actions.
- Data Upload: CSV/XLS/XLSX ingest + field mapping/validation.
- OpenAI Config: API key setup and connection test.
Base URL: http://localhost:5050/api/v1
POST /analyze-supply-chainPOST /routes/enrichGET /analysis/healthGET /analysis/statsGET /health(server)
- Node.js 18+
- npm 10+
- Python 3.11+ (for
backend_py)
This repo is npm-only.
- Do not use
yarnorpnpmhere. - Lockfiles are npm lockfiles (
package-lock.json) at root, frontend, and backend.
This repo is root .env only.
- Use
/.envas the single source of truth for frontend,backend/, andbackend_py/. - Do not maintain separate
frontend/.env,backend/.env, orbackend_py/.envfiles.
npm run install:allnpm run setup:envMinimum recommended values:
REACT_APP_API_BASE_URL=http://localhost:5050/api/v1REACT_APP_MAPBOX_ACCESS_TOKEN=...(recommended for map rendering)OPENAI_API_KEY=...FRONTEND_PORT=3000LEGACY_BACKEND_BASE_URL=http://localhost:5050/api/v1(for backend_py compatibility proxy)
For Python ingestion/normalization APIs, point frontend to backend_py:
REACT_APP_API_BASE_URL=http://localhost:8000/api/v1- keep
LEGACY_BACKEND_BASE_URL=http://localhost:5050/api/v1sobackend_pycan proxy route enrichment + analysis during migration.
Use two terminals:
Terminal 1 (backend):
npm run dev:backendTerminal 2 (frontend):
npm run dev:frontendFrontend: http://localhost:3000
Backend: http://localhost:5050
Run in a separate terminal:
cd backend_py
uv sync
uv run uvicorn app.main:app --host 0.0.0.0 --port 8000 --reloadHealth endpoints:
http://localhost:8000/healthhttp://localhost:8000/api/v1/health
Compatibility proxy endpoints (served by backend_py):
POST http://localhost:8000/api/v1/routes/enrichPOST http://localhost:8000/api/v1/analyze-supply-chainGET http://localhost:8000/api/v1/analysis/healthGET http://localhost:8000/api/v1/analysis/stats
npm run compose:up
npm run compose:logsServices:
postgres(default port5432)redis(default port6379)backend_py_api(default port8000)backend_py_worker(background heartbeat worker)
Notes:
- Compose now persists Python ingestion artifacts in a named volume (
meridian_backend_py_data) so uploads/normalization outputs survive container restarts. - To use
backend_pyendpoints directly from frontend, setREACT_APP_API_BASE_URL=http://localhost:8000/api/v1in root.envand restart frontend.
npm run build
npm test- Open
http://localhost:3000. - Toggle light/dark theme and refresh (theme persists).
- Upload sample data and verify Dashboard KPIs/charts render.
- Confirm map renders (if not, set
REACT_APP_MAPBOX_ACCESS_TOKENin root.envand restart frontend). - Open Insights and verify filter + lane table interactions.
- Open Disruption Detail and verify timeline/action dialog behavior.
Legacy frontend modules from earlier map/analysis implementations were removed from active codepaths to keep the current Meridian AI shell and design system maintainable.
Root:
npm run install:allnpm run setup:envnpm run dev:frontendnpm run dev:backendnpm run buildnpm testnpm run compose:upnpm run compose:downnpm run compose:logs
Backend:
npm --prefix backend startnpm --prefix backend run build
Frontend:
npm --prefix frontend startnpm --prefix frontend run build