Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

SentimentAura

Full-stack live “Sentiment Aura” demo using React + FastAPI with Deepgram Realtime and OpenRouter.

Quickstart

  1. Backend (FastAPI)
  • Python 3.11+
  • Create a virtualenv and install deps:
    • pip install -r backend/requirements.txt
  • Set env (create .env in backend/ directory):
    • OPENROUTER_API_KEY=<your_key>
    • DEEPGRAM_API_KEY=<your_key>
    • ALLOWED_ORIGINS=http://localhost:5173
    • Optional:
      • OPENROUTER_MODEL=openai/gpt-4o-mini
      • OPENROUTER_BASE_URL=https://openrouter.ai/api/v1
      • REQUEST_TIMEOUT_SECONDS=12.0
  • Run:
    • uvicorn app.main:app --reload --port 8000 --app-dir backend
  1. Frontend (React + Vite + TS)
  • cd frontend
  • npm install
  • Create .env.local:
    • VITE_BACKEND_URL=http://localhost:8000
    • VITE_DEEPGRAM_API_KEY=<your_key>
    • VITE_DEEPGRAM_WSS=wss://api.deepgram.com/v1/listen?model=nova-2&encoding=linear16&sample_rate=16000
  • npm run dev then open http://localhost:5173

How it works

  • Frontend streams mic audio to Deepgram Realtime over WebSocket (16k PCM).
  • Finalized transcript segments are sent to FastAPI /process_text.
  • Backend calls OpenRouter (provider-agnostic) to extract sentiment score/label and keywords.
  • Visualization (p5.js) maps sentiment to color and energy; keywords cause subtle flares.

Scripts

  • Backend: uvicorn app.main:app --reload --port 8000 --app-dir backend
  • Frontend: npm run dev (in frontend)

About

Interview for Memory Machines. Full Live AI-Powered "Sentiment Aura" Application using React, FastAPI/Python Proxy, and other relevant technologies.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages