Skip to content

ChampionNinja/setu.ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

setu.ai

AI-Powered Customer Feedback Intelligence Platform

TypeScript Node.js Python React Supabase License


Overview

setu.ai is an end-to-end customer feedback intelligence platform that transforms raw reviews from any source into actionable business insights. It combines local-first AI inference with a production-grade API layer and a real-time analytics dashboard.

The platform ingests reviews from Google Play, Amazon, Google Maps, and Reddit — runs them through a multi-stage NLP pipeline (sentiment, emotion, topic classification, urgency scoring, LLM-generated insights) — and surfaces the results through a React dashboard and a developer-facing REST API with TypeScript SDK.


Architecture

┌─────────────────────────────────────────────────────────────────┐
│                        setu.ai Platform                         │
├──────────────┬──────────────┬───────────────┬───────────────────┤
│   Scrapers   │  AI Service  │      SDK      │     Frontend      │
│   (Python)   │ (TypeScript) │  (TypeScript) │   (React + Vite)  │
├──────────────┼──────────────┼───────────────┼───────────────────┤
│ • Amazon     │ • Analysis   │ • REST Client │ • Dashboard       │
│ • Play Store │   Pipeline   │ • Type-safe   │ • Charts          │
│ • Google Maps│ • REST API   │ • Error       │ • LLM Reports     │
│ • Reddit     │ • Auth/Usage │   Handling    │ • Geo View        │
│              │ • Supabase   │               │                   │
└──────────────┴──────────────┴───────────────┴───────────────────┘

Project Structure

setu.ai/
├── ai service/          # Core AI engine + REST API server
│   ├── src/
│   │   ├── ai/          # Analysis pipeline, models, scoring
│   │   ├── api/         # Express server, auth, routes
│   │   └── db_migrations/
│   └── package.json
│
├── sdk/                 # TypeScript client SDK (@setu/sdk)
│   ├── src/
│   │   ├── client.ts    # SetuClient class
│   │   ├── types.ts     # Response/request types
│   │   └── errors.ts    # Typed error classes
│   └── package.json
│
├── scrapers/            # Multi-platform review scrapers (Python)
│   ├── amazon_review_scraper.py
│   ├── play_store_api.py
│   ├── play_store_reviews.py
│   ├── map_review.py
│   └── boat_reddit_scraper.py
│
├── reply bot/           # Reddit automated DM bot (Python)
│   └── reddit_bot.py
│
└── Nirmit-Bharat/       # Frontend dashboard (React + Vite)
    └── client/
        └── src/

Components

1. AI Service

The core analysis engine and production API. Processes customer reviews through a multi-stage NLP pipeline using local ONNX models via Transformers.js.

Pipeline stages:

  1. Preprocessing — Language detection, translation (Google Cloud), text cleaning, tokenization
  2. Sentiment Analysis — DistilBERT SST-2 model (ONNX, local inference)
  3. Emotion Detection — DistilRoBERTa emotion model (7-class: joy, sadness, anger, fear, surprise, disgust, neutral)
  4. Topic Classification — Keyword-based extraction across 9 categories (UI/UX, performance, bugs, features, pricing, support, security, updates, general)
  5. Keyword Extraction — TF-IDF scoring with domain-aware IDF approximation
  6. Urgency Scoring — Composite 0–100 score from sentiment, emotion, topics, and keyword signals
  7. Insight Generation — Ollama SLM (phi3) with rule-based template fallback

API features:

  • RESTful endpoints (POST /v1/analyze, POST /v1/analyze/batch)
  • API key authentication (SHA-256 hashed, Supabase-backed)
  • Usage tracking and rate limiting tiers (free → enterprise)
  • In-memory LRU result caching

Full AI Service Documentation


2. TypeScript SDK

A lightweight, type-safe client library for integrating with the setu.ai API from any TypeScript/JavaScript project.

import { SetuClient } from '@setu/sdk';

const client = new SetuClient({ apiKey: 'ra_live_...' });

const result = await client.analyze('This product is amazing!');
console.log(result.sentiment.label);  // 'positive'
console.log(result.urgency.level);    // 'low'

Full SDK Documentation


3. Scrapers

Python-based review collection scripts for multiple platforms. All scrapers normalize output to a unified JSON schema.

Scraper Platform Method Output
play_store_api.py Google Play SerpAPI Paginated, up to N reviews
play_store_reviews.py Google Play google-play-scraper Direct, up to 3000 reviews
amazon_review_scraper.py Amazon SerpAPI Product page reviews
map_review.py Google Maps SerpAPI Location reviews
boat_reddit_scraper.py Reddit Public JSON API Comment-level filtering

Full Scrapers Documentation


4. Reply Bot

A Reddit direct message automation bot built with PRAW. Sends personalized messages to a list of usernames from a JSON file.

Full Reply Bot Documentation


5. Frontend Dashboard

A React + Vite analytics dashboard that visualizes AI analysis results with interactive charts, geographic maps, sentiment distributions, and LLM-generated executive summaries.

Stack: React 19 · Vite 8 · Recharts · Leaflet · Framer Motion · Supabase

→ See Nirmit-Bharat/client/ for source


Quick Start

Prerequisites

Tool Version Purpose
Node.js ≥ 22 AI Service, SDK, Frontend
Python ≥ 3.11 Scrapers, Reply Bot
Supabase Database, Auth storage
Ollama Optional Local LLM insights (phi3)

1. Set Up the AI Service

cd "ai service"
npm install

# Configure environment
cp .env.example .env
# Edit .env with your Supabase + API keys

# Run database migrations in Supabase SQL Editor
# → src/db_migrations/api_keys_migration.sql
# → src/db_migrations/analytics_summaries.sql

# Generate an API key
npm run keygen -- --org "Your Org" --tier pro

# Start the API server
npm run api:dev

2. Install the SDK

cd sdk
npm install
npm run build

3. Run the Frontend

cd Nirmit-Bharat/client
npm install
npm run dev

4. Run a Scraper

cd scrapers
pip install serpapi google-play-scraper requests
python play_store_reviews.py

Environment Variables

Variable Service Description
HF_TOKEN AI Service HuggingFace API token for model downloads
GOOGLE_CLOUD_API_KEY AI Service Google Cloud Translation API key
VITE_SUPABASE_URL AI Service / Frontend Supabase project URL
VITE_SUPABASE_ANON_KEY AI Service / Frontend Supabase anonymous key
GROQ_API_KEY AI Service Groq API key for LLM summaries
SERPAPI_KEY Scrapers SerpAPI key for review collection

API Reference (Summary)

Method Endpoint Auth Description
GET / No Service info and available routes
GET /health No Health check
POST /v1/analyze Yes Analyze a single review
POST /v1/analyze/batch Yes Analyze up to 100 reviews
GET /v1/status Yes Server status, cache stats, account info

→ See AI Service docs for full request/response schemas.


License

MIT

About

End-to-end customer feedback intelligence platform for transforming reviews into actionable insights using NLP, local-first AI inference, and real-time analytics.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors