Local-first prototype with:
backend/FastAPI APIfrontend/Vite + React app (main UI currently used)apps/web/Next.js scaffold (secondary/legacy in this repo)
- JWT auth:
POST /auth/registerPOST /auth/loginGET /auth/mePUT /auth/me
- Buddy workflows:
- invite/accept/block/list buddies
- Mood check-ins:
- create + list current user check-ins
- Presence/location:
- update presence
- update location
- nearby buddies lookup
- SOS workflows + realtime support endpoints
- User settings + reporting endpoints
- AI provider abstraction:
- Gemini + Ollama behind one structured API service
- Internal provider selection via
AI_PROVIDER(geminiorollama)
- Translation Layer:
POST /translateGET /translate/history- stores history in MongoDB (
komrade.translations)
- Voice input (Phase 4):
POST /stt/elevenlabsmultipart audio (webm/wav)- validates type/size and calls ElevenLabs STT
- AI structured test route:
POST /ai/test-structured
- Health:
GET /health
- Auth pages and protected app shell
- Dashboard, buddies, map, SOS history, profile, settings
- Chat page (
/translate) labeled as Chat - Chat response mode focused on personalized answer
- History panel with user label +
komradeAIresponse - Optional microphone recording:
- record audio in browser
- upload to
/stt/elevenlabs - transcript auto-fills chat input
- Branding updates:
- custom logo support via
frontend/public/komrade_logo.png - favicon set to
komrade_logo.png
- custom logo support via
backend/ # FastAPI app (active backend)
frontend/ # Vite React app (active frontend)
apps/
api/ # older API scaffold
web/ # Next.js scaffold
cd backend
cp .env.example .envCreate/activate venv and install deps:
python3 -m venv ../env
source ../env/bin/activate
pip install -r requirements.txtRun migrations and start API:
alembic upgrade head
uvicorn app.main:app --reload --host 127.0.0.1 --port 8000Backend URL: http://localhost:8000
backend/.env:
APP_NAMEDEBUGDATABASE_URLJWT_SECRETJWT_ALGORITHMJWT_EXPIRE_MINUTESGEMINI_API_KEYGEMINI_MODEL(defaultgemini-1.5-flash)OLLAMA_BASE_URL(defaulthttp://localhost:11434)OLLAMA_MODEL(defaultllama3.1)AI_PROVIDER(geminiorollama)MONGO_URI(defaultmongodb://localhost:27017)ELEVENLABS_API_KEY(required for/stt/elevenlabs)
cd frontend
npm install
npm run devFrontend URL: http://localhost:5173
Notes:
- Vite proxies API routes to
http://localhost:8000infrontend/vite.config.ts. - If you change proxy settings, restart the frontend dev server.
Health:
curl http://localhost:8000/healthSTT (authenticated, sample):
curl -X POST http://localhost:8000/stt/elevenlabs \
-H "Authorization: Bearer <TOKEN>" \
-F "audio=@/path/to/sample.webm;type=audio/webm"Translate:
curl -X POST http://localhost:8000/translate \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"message":"I am overwhelmed today"}'Backend:
cd backend
../env/bin/pytest -qFrontend:
cd frontend
npm test -- --run