A lightweight dashboard to analyze player/chat conversations in real-time using sentiment analysis, entity extraction, and topic clustering.
+----------------------+ +----------------------+ +----------------------+
| Frontend | <----> | Backend | <----> | NLP Worker |
| (React, Chart.js) | HTTP | (FastAPI/Express) | Queue | (Python: HF,spaCy, |
| - Live dashboards | | - REST / SSE / WS | <----> | s-transformers) |
+----------------------+ +---------+------------+ +---------+------------+
| |
| DB / Vector Store | Object storage (logs)
v v
+----------------------+ +----------------------+
| Postgres / Redis | | Faiss / Milvus |
| (OLTP, sessions, CV) | | (vector index for |
+----------------------+ | topic clustering) |
+----------------------+
Optional: Alerting -> (Slack/Discord webhook) and Deployment -> Docker, GitHub Actions, Vercel (frontend) / Render or Cloud Run (backend)
conversational-analytics/
├── frontend/ # React app (dashboard)
│ ├── public/
│ └── src/
│ ├── components/
│ ├── pages/
│ ├── api/ # client API wrappers
│ └── styles/
├── backend/ # FastAPI (or Express) server
│ ├── app/
│ │ ├── api/ # REST endpoints, SSE/ws
│ │ ├── core/ # config, logging, auth
│ │ ├── db/ # models, migrations
│ │ └── services/ # ingestion, alerting
│ └── tests/
├── nlp_worker/ # NLP pipelines / batch & streaming jobs
│ ├── models/ # model config and wrappers
│ ├── pipelines/ # sentiment.py, ner.py, embeddings.py
│ └── tasks/ # worker entrypoints (celery / rq / simple loop)
├── data/ # sample datasets, synthetic generators
├── infra/ # docker-compose, terraform / k8s manifests
├── scripts/ # helpers: seed_db.py, gen_synthetic_chat.py
├── docs/ # architecture diagrams, notes
├── .env.example
├── docker-compose.yml
├── README.md # this file (starter template)
└── LICENSE
Notes:
- Keep
nlp_workerseparate so you can scale/replace it independently. Use Redis/RQ, Celery, or simple Pub/Sub depending on scale. backend/servicesshould expose a streaming endpoint (SSE or WebSocket) for the dashboard's live updates.
- Live demo: (add link if deployed)
- Screenshot:
docs/screenshot.png
- Quickly surfaces player issues and trends from chat logs.
- Useful for product decisions, QA triage, and monitoring player sentiment around releases.
- Frontend: React, Chart.js / Recharts, Tailwind CSS
- Backend: FastAPI (or Express), SSE / WebSockets for streaming
- NLP: Hugging Face Transformers (DistilBERT), spaCy, sentence-transformers
- Vector store / search: Faiss (local) or Milvus
- Queue/Cache: Redis (pub/sub or RQ)
- Storage: Postgres (metadata), optionally S3 for raw logs
- Deployment: Docker, Vercel (frontend), Render/Cloud Run (backend)
(Include the ASCII diagram or paste a rendered image from docs/architecture.png.)
- Docker & Docker Compose
- Node 18+ and npm/yarn (for frontend dev)
# copy env example
cp .env.example .env
# build and run
docker-compose up --buildFrontend will be at http://localhost:3000 and backend at http://localhost:8000 by default.
cd backend
pip install -r requirements.txt
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000cd frontend
npm install
npm run dev# Backend
BACKEND_PORT=8000
DATABASE_URL=postgresql://user:pass@db:5432/conv_analytics
REDIS_URL=redis://redis:6379/0
VECTOR_INDEX_DIR=/data/faiss
# NLP
SENTIMENT_MODEL=distilbert-base-...-finetuned-sentiment
EMBEDDING_MODEL=sentence-transformers/all-MiniLM-L6-v2
- Message-level sentiment & conversation-level aggregation
- Named-entity frequency and co-occurrence
- Topic clustering (embeddings + k-means / HDBSCAN)
- Live dashboard with filters (region, VIP status, time range)
- Alerting via Slack/Discord webhook for sentiment spikes
- Full conversation pipeline with conversation-level metrics
- Entity Recognition & Topic Tagging using spaCy and Hugging Face models
- Vector Database for Search & Clustering using FAISS
GET /— root endpointGET /vector-stats— get statistics about the vector databasePOST /ingest— submit chat messages (bulk)GET /conversation/{conversation_id}— get a full conversation with all messages and metricsGET /search?text={text}&k={k}— search for messages similar to the provided textGET /api/sentiment?start=...&end=...— aggregated sentiment time seriesGET /api/topics?limit=10— top N topicsGET /api/stream— SSE stream of processed messages
data/sample_chat.jsonl— one message per line:{"user_id":..., "timestamp":..., "text":...}- A synthetic generator is available at
scripts/gen_synthetic_chat.py.
- Use small holdout to sanity-check sentiment & topic coherence.
- Strip PII before storing logs; mention in docs how you anonymize.
- Frontend: Vercel (connect repo)
- Backend: Render / Cloud Run / Heroku
- Use GitHub Actions for CI: run linters and tests, build Docker image and push to container registry
- Fine-tune a sentiment model on game-chat style data
- Add real-time anomaly detection (seasonal-ESD)
- Slack integration for triage channels
- Support for Milvus as an alternative to FAISS
- Integration with NeonDatabase as requested
- See
CONTRIBUTING.mdfor code standards
MIT
- Author:
Utkarsh Gual