AI-powered automation platform built for Rayeva World Pvt Ltd π
Features β’ Quick Start β’ API Docs β’ Tech Stack β’ Demo
- About
- Features
- Tech Stack
- Architecture
- Quick Start
- Module Details
- API Reference
- Database Schema
- Environment Setup
- Project Structure
- Demo
Rayeva is revolutionizing sustainable e-commerce with eco-friendly products. This dashboard automates their most time-intensive operations using Google Gemini AI, reducing manual work by 80% while improving accuracy and customer experience.
π‘ Built as an internship project to demonstrate real-world AI integration in sustainable business operations.
|
Automatically categorize products and generate SEO-optimized tags with sustainability filters. Key Benefits:
|
Create customized bulk purchase proposals that maximize budget utilization. Key Benefits:
|
|
Calculate environmental impact with precision β plastic saved, carbon avoided, and local sourcing metrics. Key Benefits:
|
Intelligent customer support via WhatsApp with automatic intent detection and routing. Key Benefits:
|
graph TB
A[React Frontend<br/>Vite + CSS Variables] -->|HTTP/JSON| B[FastAPI Backend<br/>Python 3.11]
B --> C[Module 1: Product Tagger<br/>/api/categorize-product]
B --> D[Module 2: Proposal Generator<br/>/api/generate-proposal]
B --> E[Module 3: Impact Report<br/>/api/generate-impact-report]
B --> F[Module 4: WhatsApp Bot<br/>/api/whatsapp/webhook]
C --> G[Google Gemini AI]
D --> G
E --> G
F --> G
C --> H[(SQLite Database<br/>7 Tables)]
D --> H
E --> H
F --> H
style A fill:#00c4a7,stroke:#009688,color:#fff
style B fill:#00c4a7,stroke:#009688,color:#fff
style G fill:#00c4a7,stroke:#009688,color:#fff
style H fill:#00c4a7,stroke:#009688,color:#fff
System Flow: React frontend communicates with FastAPI backend via REST API. Each module leverages Google Gemini AI for intelligent processing, with all data persisted in SQLite.
- Python 3.11+
- Node.js 18+
- Google Gemini API Key (Get one free)
# 1οΈβ£ Clone the repository
git clone https://github.com/YOUR_USERNAME/rayeva-ai-modules.git
cd rayeva-ai-modules
# 2οΈβ£ Create and activate virtual environment
python -m venv venv
# Windows
venv\Scripts\activate
# Mac/Linux
source venv/bin/activate
# 3οΈβ£ Install dependencies
pip install -r requirements.txt
# 4οΈβ£ Configure environment variables
cp .env.example .env
# Edit .env and add your GEMINI_API_KEY
# 5οΈβ£ Seed database with test data
python seed_data.py
# 6οΈβ£ Start the server
uvicorn main:app --reloadβ
Backend running at: http://127.0.0.1:8000
π API Documentation: http://127.0.0.1:8000/docs
# 1οΈβ£ Navigate to frontend directory
cd frontend
# 2οΈβ£ Install dependencies
npm install
# 3οΈβ£ Start development server
npm run devβ
Dashboard running at: http://localhost:5173
π You're all set! Open the dashboard and start exploring the modules.
π·οΈ Module 1 β Smart Product Tagger
π― Purpose: Automatically categorize products and generate SEO-optimized tags with sustainability scoring.
π₯ Input: Product name + description
π€ Output: Category, sub-category, SEO tags, sustainability filters, confidence score
{
"product_name": "BambooFresh Toothbrush",
"product_description": "Biodegradable bamboo, plastic-free packaging"
}{
"category": "Personal Care",
"sub_category": "Oral Hygiene",
"seo_tags": ["bamboo toothbrush", "plastic-free", "eco toothbrush"],
"sustainability_filters": ["plastic-free", "biodegradable"],
"confidence_score": 0.95
}- Role-based prompting with predefined category taxonomy
- Strict JSON output enforcement
- Temperature: 0.3 for consistency
- Validation: Confidence scoring for quality assurance
πΌ Module 2 β B2B Proposal Generator
π― Purpose: Generate customized bulk purchase proposals that maximize budget utilization while meeting client preferences.
π₯ Input: Client details, budget, employee count, sustainability preferences
π€ Output: Product recommendations, pricing breakdown, impact summary, ESG positioning
{
"client_name": "GreenTech Pvt Ltd",
"industry": "Technology",
"budget": 50000,
"num_employees": 50,
"preferences": ["plastic-free", "recycled"]
}{
"recommended_products": [
{
"product_name": "Bamboo Desk Organizer",
"category": "Office & Stationery",
"quantity": 50,
"unit_price": 299,
"total_price": 14950,
"sustainability_features": ["plastic-free", "biodegradable"]
}
],
"total_cost": 49850,
"budget_utilization_percent": 99.7,
"impact_summary": "Eliminates approximately 600 single-use plastic items",
"impact_positioning": "Perfect for ESG goals and CSR reporting"
}- Role: B2B sales consultant persona
- Budget constraint: Strict adherence with 90-100% utilization target
- Temperature: 0.5 for balanced creativity
- Output: Professional proposal format with impact metrics
π Module 3 β Impact Report Generator
π― Purpose: Calculate precise environmental impact metrics and generate human-readable sustainability reports.
π₯ Input: Order ID + product list with sustainability attributes
π€ Output: Plastic saved, carbon avoided, local sourcing %, impact statement
Step 1: Python Calculations (No AI guessing)
plastic_saved_grams = weight Γ quantity Γ 0.8 # plastic-free items
carbon_avoided_kg = weight Γ quantity Γ 0.002 # local/organic items
local_sourcing_% = local_items / total Γ 100Step 2: AI Communication (Gemini writes engaging statement)
"Your order saved 144g of plastic β like removing
96 straws from the ocean! π"
{
"plastic_saved_grams": 144.0,
"carbon_avoided_kg": 0.36,
"local_sourcing_percent": 50.0,
"impact_statement": "Amazing! Your order saved 144g of plastic β equivalent to removing 96 plastic straws from the ocean! π You also avoided 0.36kg of carbon emissions. Keep making a difference! π±"
}- Hybrid approach: Python for math, AI for communication
- Temperature: 0.7 for warm, engaging tone
- Max tokens: 500 for concise statements
- Validation: Math verified before AI processing
π¬ Module 4 β WhatsApp Support Bot
π― Purpose: Provide 24/7 intelligent customer support via WhatsApp with automatic intent detection and routing.
π₯ Input: Twilio webhook POST (customer WhatsApp message)
π€ Output: TwiML XML response sent back to customer
graph LR
A[Customer WhatsApp] --> B[Twilio]
B --> C[POST /api/whatsapp/webhook]
C --> D{AI Intent Detection}
D -->|order_status| E[Query Database]
D -->|return_policy| F[Return Policy Text]
D -->|refund_escalation| G[Create Escalation]
D -->|general| H[AI Response]
E --> I[Format TwiML]
F --> I
G --> I
H --> I
I --> B
B --> A
style D fill:#00c4a7,stroke:#009688,color:#fff
style I fill:#00c4a7,stroke:#009688,color:#fff
order_statusβ Query database for order trackingreturn_policyβ Return hardcoded policy textrefund_escalationβ Log to database, alert teamgeneralβ AI-generated response
"Where is my order ORD-001?" β Order found, status returned
"What is your return policy?" β Policy text returned
"I want a refund now!" β Escalation created, team alerted
- Strict classification: Single-word intent output
- Temperature: 0.3 for consistent routing
- Fallback: Always defaults to "general" on failure
- Logging: All conversations stored for analysis
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/categorize-product |
Tag a product with AI |
GET |
/api/products |
List all tagged products |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/generate-proposal |
Generate B2B proposal |
GET |
/api/proposals |
List all proposals |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/generate-impact-report |
Calculate order impact |
GET |
/api/impact-reports |
List all impact reports |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/whatsapp/webhook |
Twilio webhook handler |
GET |
/api/whatsapp/logs |
View conversations |
GET |
/api/escalations |
View escalations |
π Interactive API Docs: Visit
http://127.0.0.1:8000/docsfor full Swagger documentation with live testing.
7 SQLAlchemy Tables:
| Table | Purpose | Key Fields |
|---|---|---|
product_tags |
Module 1 outputs | category, sub_category, seo_tags, sustainability_filters |
b2b_proposals |
Module 2 outputs | client_name, recommended_products, total_cost, budget_utilization |
impact_reports |
Module 3 outputs | plastic_saved_grams, carbon_avoided_kg, impact_statement |
orders |
Seed data for testing | order_id, customer_name, products, status |
whatsapp_logs |
Module 4 conversations | message, intent, response, timestamp |
escalation_logs |
Flagged customer issues | customer_message, status (pending/resolved) |
ai_logs |
AI call tracking | module, prompt, response, success, timestamp |
πΎ Database: SQLite for simplicity. Production-ready with easy migration to PostgreSQL/MySQL.
# .env file
# π Google Gemini API Key (Required)
# Get your free key: https://aistudio.google.com/app/apikey
GEMINI_API_KEY=your_api_key_here
# π± Twilio Configuration (Optional - only for live WhatsApp testing)
TWILIO_ACCOUNT_SID=your_account_sid
TWILIO_AUTH_TOKEN=your_auth_token
TWILIO_WHATSAPP_NUMBER=whatsapp:+14155238886
# π Frontend Configuration
VITE_API_BASE_URL=http://127.0.0.1:8000
β οΈ Important: Never commit your.envfile. Use.env.exampleas a template.
rayeva-ai-dashboard/
β
βββ π modules/ # AI Module Implementations
β βββ module1_tagger.py # π·οΈ Product categorization & tagging
β βββ module2_proposal.py # πΌ B2B proposal generation
β βββ module3_impact.py # π Environmental impact calculations
β βββ module4_whatsapp.py # π¬ WhatsApp bot with intent routing
β
βββ π frontend/ # React Dashboard
β βββ π src/
β β βββ π pages/
β β β βββ Home.jsx # Landing page
β β β βββ ProductTagger.jsx # Module 1 interface
β β β βββ ProposalGenerator.jsx # Module 2 interface
β β β βββ ImpactReport.jsx # Module 3 interface
β β β βββ WhatsAppBot.jsx # Module 4 interface
β β β
β β βββ π components/
β β β βββ Navbar.jsx # Navigation with teal theme
β β β βββ JsonDisplay.jsx # Formatted JSON viewer
β β β
β β βββ π api/
β β β βββ client.js # Axios API client
β β β
β β βββ App.jsx # Main app component
β β βββ index.css # Global styles (CSS Variables)
β β
β βββ index.html
β βββ package.json
β βββ vite.config.js
β
βββ π main.py # FastAPI app with all routes + CORS
βββ π models.py # SQLAlchemy table definitions (7 tables)
βββ π database.py # SQLite engine + session management
βββ π ai_client.py # Google Gemini API client wrapper
βββ π seed_data.py # Test data generator (5 sample orders)
β
βββ π requirements.txt # Python dependencies
βββ π .env.example # Environment template
βββ π .gitignore
βββ π README.md # You are here! π
The system comes pre-seeded with 5 sample orders for testing the WhatsApp bot:
| Order ID | Customer | Product | Status | Test Query |
|---|---|---|---|---|
ORD-001 |
Priya Sharma | Bamboo Toothbrush Γ 2 | β Delivered | "Where is my order ORD-001?" |
ORD-002 |
Rahul Mehta | Reusable Water Bottle Γ 1 | π¦ Shipped | "Track order ORD-002" |
ORD-003 |
Ananya Singh | Organic Cotton Tote Γ 3 | β³ Processing | "Status of ORD-003?" |
ORD-004 |
Vikram Patel | Compostable Plates Γ 10 | β Delivered | "Where is ORD-004?" |
ORD-005 |
Sneha Joshi | Beeswax Food Wraps Γ 5 | π¦ Shipped | "Check ORD-005 status" |
π https://rayeva-ai-modules.vercel.app/
Backend runs locally β clone the repo and run
uvicorn main:app --reloadto connect the AI modules.
This project was built as an internship assignment, but contributions are welcome!
Areas for improvement:
- π¨ Enhanced UI/UX designs
- π§ͺ Unit and integration tests
- π Analytics dashboard
- π Authentication system
- π Multi-language support
- π± Mobile app integration
This project is part of an internship assignment for Rayeva World Pvt Ltd.
Rushikesh Randive
Full Stack / AI Intern
Rayeva World Pvt Ltd β’ 2026