An intelligent full-stack decision support system that helps users identify and rank smartphones using computer vision, multi-criteria decision analysis, and optional AI-generated explanations.
- Identify smartphone models from uploaded images or live camera.
- Rank devices with Direct Weighting + TOPSIS or optional Pairwise AHP + TOPSIS.
- Compare raw specifications side-by-side with bar charts.
- Show transparent scoring inputs, sensitivity analysis, and comparison results.
- Generate natural-language explanations with OpenRouter or Groq when configured.
- Durable per-analysis URLs that survive refresh.
- Run a React frontend and FastAPI backend together from the project root.
- Backend: FastAPI, SQLite, SQLAlchemy, pytest, ONNX Runtime
- Frontend: React, Vite, TypeScript, Recharts, Framer Motion, Axios
- Vision: ONNX Runtime with 3 trained YOLO models
src/
api/ API endpoints and schemas
database/ Database models, connection, and seed data
decision_engine/ Preference validation, AHP, and TOPSIS analysis
vision/ Image transforms, model lifecycle, and inference
assistant/ Shared provider adapters, context, and fallback behavior
catalog/ Active catalog and retirement-aware queries
runtime/ Validated settings and capability configuration
saved_analysis/ Durable ranking persistence operations
frontend/
src/ React application source
e2e/ Playwright browser journey tests
tests/ Unit and integration tests
computer_vision/ Training artifacts and exported models
docs/ ADRs, verification evidence, defense artifacts
Copy .env.example to .env and add only the values you plan to use:
OPENROUTER_API_KEY=your_openrouter_keyIf OpenRouter or Groq keys are missing, tests remain offline and the app uses local fallback answers.
Training notebooks read ROBOFLOW_API_KEY from the environment and do not contain a key.
From the project root:
python -m venv .venv
.\.venv\Scripts\activate
npm run install:allStart the backend and frontend together:
npm run devExpected local services:
- Backend:
http://127.0.0.1:8000 - Frontend:
http://localhost:5173
Run the authoritative local verification command:
npm run verifyArchitecture terms and decisions are documented in CONTEXT.md
Upgrade an existing database:
python -m alembic upgrade headFresh databases use the same command before startup seeding. Application startup also runs pending migrations automatically.