Skip to content

SaDA AI is a next-gen platform combining advanced document intelligence with multimodal AI customer support. Upload docs, ask questions, and get instant insights via cutting-edge LLMs and real-time media understanding β€” all in one sleek, animated interface. Built for speed, scale, and production.

Notifications You must be signed in to change notification settings

SamparkBhol/SaDA-Ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ‰ SaDA AI - Smart Document Analysis & Customer Support Automation

πŸš€ Project Overview

SaDA AI is an end-to-end AI-powered system for intelligent document analysis and multimodal customer support automation. It combines advanced LLM integrations with a modern, animated React frontend and robust backend using FastAPI. The system provides real-time chat, smart analysis of documents, and intuitive user experiences.


Screenshots

image image image image


πŸ›  Technology Stack

  • Frontend: React 19.0.0 + Three.js + GSAP + Framer Motion + Tailwind CSS
  • Backend: FastAPI + Python 3.11
  • Database: MongoDB
  • AI Integration: Gemini API (Google)
  • Animations: Three.js, GSAP, Framer Motion
  • Styling: Tailwind CSS + Custom 3D CSS

πŸ”‘ Required API Keys & Configuration

1. Gemini API Key (Required)

# Current Key (provided in project)
GEMINI_API_KEY=A...


# To get your own key:
# 1. Go to: https://aistudio.google.com/app/apikey
# 2. Create new project or select existing
# 3. Generate API key
# 4. Replace in /app/backend/server.py line 18

2. MongoDB Database

# Current Configuration
MONGO_URL=mongodb://localhost:27017
DB_NAME=sada_ai

# To use different database:
# 1. Update /app/backend/.env file
# 2. Change MONGO_URL and DB_NAME variables

πŸ“ Environment Variables

Backend (.env file location: /app/backend/.env)

MONGO_URL=mongodb://localhost:27017
DB_NAME=sada_ai

Frontend (.env file location: /app/frontend/.env)

REACT_APP_BACKEND_URL=http://your-backend-url

πŸ”„ API Replacement Guide

Replacing Gemini API with Other LLM Providers:

Option 1: OpenAI Integration

# Change model configuration:
chat = LlmChat(
    api_key="your-openai-key",
    session_id=session_id,
    system_message="Your system message"
).with_model("openai", "gpt-4o")  # or other OpenAI models

Option 2: Anthropic Claude Integration

# Change model configuration:
chat = LlmChat(
    api_key="your-anthropic-key",
    session_id=session_id,
    system_message="Your system message"
).with_model("anthropic", "claude-sonnet-4-20250514")

Available Models:

# OpenAI Models:
'gpt-4.1', 'gpt-4.1-mini', 'o4-mini', 'o3-mini', 'o3', 'gpt-4o', 'o1-pro'

# Anthropic Models:
'claude-sonnet-4-20250514', 'claude-opus-4-20250514', 'claude-3-5-sonnet-20241022'

# Gemini Models:
'gemini-2.5-flash-preview-04-17', 'gemini-2.0-flash', 'gemini-1.5-pro'

API Key Replacement Steps:

  1. Update API Key: Replace in /app/backend/server.py line 18
  2. Change Model: Update .with_model() calls (lines ~85, ~165)
  3. Restart Backend: sudo supervisorctl restart backend

πŸ—„ Database Configuration

MongoDB Setup:

# Default connection (already configured)
MONGO_URL=mongodb://localhost:27017
DB_NAME=sada_ai

# Collections created automatically:
- chat_sessions
- document_analyses  
- chat_messages
- status_checks

Using Different Database:

# 1. Update /app/backend/.env
MONGO_URL=mongodb://your-mongo-host:27017
DB_NAME=your_database_name

# 2. Or use MongoDB Atlas (cloud):
MONGO_URL=mongodb+srv://username:[email protected]/
DB_NAME=your_database_name

# 3. Restart backend
sudo supervisorctl restart backend

πŸ“¦ Installation & Setup

Backend Dependencies:

cd /app/backend
pip install -r requirements.txt

# Key packages:
- fastapi==0.110.1
- motor==3.3.1 (MongoDB async driver)
- python-multipart (file uploads)

Frontend Dependencies:

cd /app/frontend
yarn install

# Key packages:
- [email protected]
- [email protected]
- @react-three/[email protected]
- @react-three/[email protected]
- [email protected]
- [email protected]

🌐 Backend API Endpoints

Core Endpoints:

# Health Check
GET /api/

# Session Management
POST /api/chat/sessions
GET /api/chat/sessions
GET /api/chat/sessions/{session_id}

# Document Analysis
POST /api/documents/analyze
GET /api/documents/analyses
GET /api/documents/analyses/{session_id}

# Multimodal Chat
POST /api/chat/message
GET /api/chat/messages/{session_id}

# File Upload
POST /api/upload

Backend URL Configuration:

  • Development: http://localhost:8001
  • All API routes must have /api prefix
  • CORS enabled for all origins

🎨 Frontend Configuration

3D Graphics (Three.js):

// Located in /app/frontend/src/App.js
// 3D Components:
- FloatingOrb (animated spheres)
- AI_Brain (rotating torus rings)
- BackgroundScene (3D environment)

Animations (GSAP):

// Animation features:
- Hero section timeline animations
- Scroll-triggered animations
- Hover effect animations
- Loading state animations

Color Scheme:

/* Current: Cyan-Pink-Orange */
Primary: #06b6d4 (Cyan)
Secondary: #ec4899 (Pink)  
Accent: #f97316 (Orange)

/* To change colors, update in /app/frontend/src/App.css */

πŸ”§ Service Management

Start/Stop Services:

# Restart all services
sudo supervisorctl restart all

# Individual services
sudo supervisorctl restart frontend
sudo supervisorctl restart backend

# Check status
sudo supervisorctl status

Service URLs:

  • Frontend: http://localhost:3000
  • Backend: http://localhost:8001
  • API Base: http://localhost:8001/api

πŸ“‹ File Structure & Key Files

/app/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ server.py          # Main FastAPI application
β”‚   β”œβ”€β”€ requirements.txt   # Python dependencies  
β”‚   └── .env              # Backend environment vars
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ App.js        # Main React component with 3D
β”‚   β”‚   └── App.css       # Enhanced styles & animations
β”‚   β”œβ”€β”€ package.json      # Node dependencies
β”‚   └── .env             # Frontend environment vars
└── test_result.md        # Testing documentation

πŸ§ͺ Testing

Backend Testing:

# All backend APIs tested and working:
βœ… LLM Integration (Gemini API)
βœ… Document Analysis 
βœ… Chat Sessions
βœ… Multimodal Chat
βœ… File Upload System

Frontend Features:

βœ… 3D Animations (Three.js)
βœ… Advanced GSAP Effects
βœ… Framer Motion Transitions
βœ… Responsive Design
βœ… File Upload Interface
βœ… Real-time Chat

🚨 Important Notes

API Key Security:

  • Never commit API keys to version control
  • Use environment variables in production
  • Rotate keys regularly

Performance:

  • 3D animations are GPU-accelerated
  • File uploads use base64 encoding
  • MongoDB indexes recommended for production

Browser Compatibility:

  • Chrome 90+ (recommended)
  • Firefox 88+
  • Safari 14+
  • Mobile browsers supported

πŸ†˜ Troubleshooting

Common Issues:

  1. Backend not starting:

    tail -n 100 /var/log/supervisor/backend.*.log
  2. Frontend build errors:

    cd /app/frontend
    yarn install
  3. API connection issues:

    • Check REACT_APP_BACKEND_URL in frontend/.env
    • Ensure backend is running on correct port
  4. 3D animations not working:

    • Check browser WebGL support
    • Update graphics drivers

πŸ“ž Support

For issues with:

  • LLM Integration: Check API key validity
  • Database: Verify MongoDB connection
  • 3D Graphics: Ensure WebGL support
  • Animations: Check browser compatibility

Project Status: βœ… Production Ready
Backend Tests: βœ… 11/11 Passed
Frontend: βœ… Fully Functionals

-------- And then --------

Status: βœ… Ok! all ready to go .....

About

SaDA AI is a next-gen platform combining advanced document intelligence with multimodal AI customer support. Upload docs, ask questions, and get instant insights via cutting-edge LLMs and real-time media understanding β€” all in one sleek, animated interface. Built for speed, scale, and production.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published