Recorded trial CSVs -> real gait metrics (Python) -> AI explanation (Gemini / Groq / Claude / ...) -> web dashboard.
foot-imu-ai/
├── start.sh one command that starts everything
├── backend/ Python + FastAPI (port 8000)
│ ├── app/analysis.py computes stride, stance, swing, cadence, data-quality checks
│ ├── app/llm.py talks to the AI provider, checks every claim against the data
│ ├── app/main.py the API
│ ├── data/ your trial CSVs live here
│ ├── tests/ automated tests
│ ├── requirements.txt
│ └── .env.example copy to .env and paste your key
└── frontend/ React + Vite (port 5173)
├── package.json
├── vite.config.js forwards /api to the backend (this is the link between them)
└── src/ App.jsx, components/, api/api.js
- Get a free key: https://aistudio.google.com/apikey (Google Gemini)
- In Terminal:
cd foot-imu-ai ./start.sh - First run only: the script creates
backend/.env. Open it, replaceyour-keyafterGEMINI_API_KEY=with your key, save, then press Ctrl+C and run./start.shagain. - The browser opens at http://localhost:5173
Terminal 1, backend:
cd foot-imu-ai/backend
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env # then edit .env and paste your key
uvicorn app.main:app --reload --port 8000Terminal 2, frontend:
cd foot-imu-ai/frontend
npm install
npm run devOpen http://localhost:5173. Keep both terminals running.
- Backend: http://localhost:8000/api/providers (shows which keys were found)
- Backend: http://localhost:8000/api/trials/001/summary (metrics, works with no key)
- Backend docs: http://localhost:8000/docs
- Tests:
cd backend && source .venv/bin/activate && python -m pytest -q
- Pick a trial, read the metrics and charts. They never need an AI key.
- Choose an AI provider (only ones with a key in
.envare enabled) and click "Analyse trial". - Green ticks mean the AI's number matches the computed data. A red cross shows the correct value.
- "Upload trial CSVs" adds new trials. Name files
trial_<id>_right.csv,trial_<id>_right_events.csv, and the same withleft.
| Problem | Fix |
|---|---|
| Page says "Backend offline" | The backend terminal is not running. Start it and click "try again". |
| "No API key" banner | Edit backend/.env, paste the key, save, restart the backend. |
| Error mentioning the model name | The provider renamed its model. Put a current model name in .env (GEMINI_MODEL, GROQ_MODEL, ...) from the provider's model list. |
| 429 / quota error | You hit the free limit. Wait a minute, or choose another provider in the dropdown. |
npm: command not found |
Install Node.js from https://nodejs.org |
| Port already in use | Close the old terminals, or run lsof -ti :8000 | xargs kill (or :5173). |
- Free tiers change often. Check each provider's current limits. Google may use free-tier prompts to improve its products, so for real participant data prefer Groq or local Ollama.
- Trial 001 shows bursty timestamps (about 28 usable samples/s), accelerometer clipping, no left foot data and no calibration. The app reports these instead of hiding them.
- Output is for research use only, not a medical assessment.