Skip to content
Β 
Β 

Latest commit

Β 

History

20 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

⚑ SmartDesk β€” AI-Powered Complaint Management System

National Hackathon 2026 Β· Problem Statement P4 Β· Team Spark #80

An end-to-end support portal that uses AI chatbot deflection, automated ticket routing, and a real-time agent dashboard to reduce manual ticket sorting and improve resolution time.

Tech Stack AI Real-time


πŸ‘₯ Team Spark Β· #80

Name Role Responsibilities
πŸ› οΈ Rakesh G Backend Architect Server infrastructure, REST APIs, Socket.IO real-time engine, JWT authentication, ticket routing
🧠 Aditya Shibu AI & Data Engineer AI engine (Groq + Gemini), NLP prompt engineering, emotion/severity detection, MongoDB schema design, database architecture
🎨 Ujjwal Frontend Lead React UI/UX, glassmorphism design system, chat interface, agent dashboard, analytics visualizations, theme system

🎯 Problem

Customer support teams are overwhelmed by repetitive L1 queries ("Where is my refund?"). This delays resolution of complex, high-priority issues. Companies need a system where an AI chatbot acts as the first line of defense β€” and if it can't resolve the issue, it seamlessly logs, categorizes, and routes the complaint to a human agent.

πŸ’‘ Solution

SmartDesk provides:

Layer What it does
AI Chatbot Resolves L1 queries instantly (password resets, FAQs, status checks)
Auto Severity Scoring Analyzes user language β†’ assigns Low / Medium / High / Critical
Smart Categorization Tags tickets: Billing, Technical, Account, General, Security
Emotion Detection Detects: Angry, Frustrated, Desperate, Threatening, Calm
Security Flag Catches social engineering, phishing, unauthorized access attempts
Agent Dashboard Claim tickets, view transcripts, update status, resolve issues
Real-time Updates New tickets appear on dashboard instantly via WebSockets

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     WebSocket      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     MongoDB
β”‚   React UI  β”‚ ◄──────────────► β”‚   Express + S.IO  β”‚ ◄──────────► Atlas
β”‚  (Vite)     β”‚     REST API      β”‚                  β”‚
β”‚             β”‚ ◄──────────────► β”‚   AI Engine       β”‚ ──► Groq API
β”‚  β€’ Chat     β”‚                   β”‚   (3-layer)       β”‚ ──► Gemini API
β”‚  β€’ Dashboardβ”‚                   β”‚                  β”‚ ──► Keyword Fallback
β”‚  β€’ Auth     β”‚                   β”‚   JWT Auth        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

AI Engine β€” 3-Layer Fallback

  1. Groq API (llama-3.3-70b) β€” Primary, fastest inference
  2. Google Gemini (1.5-flash) β€” Fallback #1
  3. Keyword Regex β€” Fallback #2, always works offline

✨ Key Features

πŸ€– Conversational AI Chat

  • Natural language understanding via LLM
  • Quick reply suggestion pills β€” clickable options for faster interaction
  • Multilingual support β€” bot detects and replies in user's language
  • Live sentiment meter β€” visual emoji + color bar showing real-time emotion
  • FAQ matching for instant L1 resolution (9 common queries)
  • Auto-escalation after 3+ messages or high severity
  • Satisfaction rating (πŸ‘πŸ‘Ž) after ticket creation

🎫 Smart Ticket Generation

  • Automatic β€” created when AI determines human intervention needed
  • Force escalation β€” "Talk to Human" always creates a ticket, even if AI fails
  • Captures: full transcript, user details, AI-classified metadata
  • Severity scored from user's language patterns (caps, punctuation, word choice)
  • Security threats flagged and escalated immediately

πŸ“Š Agent Dashboard

  • JWT-secured login with bcrypt password hashing
  • Interactive analytics β€” pie chart (by category), bar chart (by severity)
  • Compact pill-based filters for status and severity
  • Stats overview panel β€” Total, Open, In Progress, Resolved, High Priority, Flagged
  • Real-time ticket stream via Socket.IO
  • Claim β†’ In Progress β†’ Resolved visual workflow
  • Full chat transcript viewer in ticket modal
  • CSV export with proper field quoting
  • AI resolution suggestions endpoint for agent assistance

🎨 UI/UX

  • Glassmorphism β€” frosted glass effects with backdrop blur
  • Dark/Light theme toggle with localStorage persistence
  • Animated orbs background via PageShell component
  • Spring-based micro-animations on cards, bubbles, and pills
  • Inter font, blue accent color system
  • Fully responsive design

πŸ› οΈ Tech Stack

Layer Technology
Frontend React 19, Vite, React Router, Recharts, Socket.IO Client
Backend Node.js, Express 5, Socket.IO, Mongoose
Database MongoDB Atlas (free tier)
AI/NLP Groq SDK (llama-3.3-70b), Google Gemini 1.5 Flash
Auth JWT (jsonwebtoken), bcryptjs
Real-time Socket.IO (WebSocket + long-polling fallback)
Styling CSS Modules, CSS Variables, Glassmorphism

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • MongoDB Atlas account (free tier works)
  • At least one AI API key: Groq (recommended) or Google AI Studio

1. Clone & Setup

git clone https://github.com/your-team/smartdesk.git
cd smartdesk

2. Backend

cd server
npm install
cp .env.example .env
# Edit .env with your API keys and MongoDB URI
npm run seed     # Create demo agent accounts
npm run dev      # Start on port 5000

3. Frontend

cd client
npm install
npm run dev      # Start on port 5173

4. Open


πŸ” Demo Credentials

Role Email Password
Agent rakesh@smartdesk.dev agent123
Agent ujjwal@smartdesk.dev agent123
Agent adi@smartdesk.dev agent123

πŸ“ Project Structure

β”œβ”€β”€ server/                      # Express + Socket.IO backend
β”‚   β”œβ”€β”€ config/db.js             # MongoDB connection
β”‚   β”œβ”€β”€ middleware/auth.js       # JWT authentication
β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”œβ”€β”€ Agent.js             # Agent schema (bcrypt hashed)
β”‚   β”‚   └── Ticket.js            # Ticket schema (severity, emotion, urgency)
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ agentRoutes.js       # Login endpoint
β”‚   β”‚   └── ticketRoutes.js      # CRUD + stats + AI suggestions
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”œβ”€β”€ aiEngine.js          # 3-layer AI (Groq β†’ Gemini β†’ regex)
β”‚   β”‚   β”œβ”€β”€ faqMatcher.js        # L1 FAQ instant resolution (9 entries)
β”‚   β”‚   └── fallback.js          # Keyword classifier + emotion detection
β”‚   β”œβ”€β”€ socket/chatHandler.js    # Real-time chat + escalation logic
β”‚   β”œβ”€β”€ scripts/seedAgents.js    # Database seeder
β”‚   └── server.js                # Entry point
β”‚
β”œβ”€β”€ client/                      # React + Vite frontend
β”‚   └── src/
β”‚       β”œβ”€β”€ api/axios.js         # Axios with JWT interceptor
β”‚       β”œβ”€β”€ components/
β”‚       β”‚   β”œβ”€β”€ PageShell.jsx    # Animated orbs background
β”‚       β”‚   β”œβ”€β”€ ThemeToggle.jsx  # Dark/Light mode toggle
β”‚       β”‚   β”œβ”€β”€ Logo.jsx         # SVG brand logo
β”‚       β”‚   β”œβ”€β”€ StatsPanel.jsx   # Dashboard stats overview
β”‚       β”‚   β”œβ”€β”€ TicketCard.jsx   # Ticket card with severity indicator
β”‚       β”‚   β”œβ”€β”€ TicketModal.jsx  # Ticket detail + status workflow
β”‚       β”‚   └── ProtectedRoute   # JWT route guard
β”‚       β”œβ”€β”€ context/
β”‚       β”‚   β”œβ”€β”€ UserContext.jsx  # Session management
β”‚       β”‚   └── ThemeContext.jsx # Dark/Light theme persistence
β”‚       └── pages/
β”‚           β”œβ”€β”€ LandingPage      # User entry point
β”‚           β”œβ”€β”€ ChatPage         # AI chat + sentiment meter + quick replies
β”‚           β”œβ”€β”€ AgentLogin       # JWT login with frosted glass card
β”‚           └── Dashboard        # Ticket management + analytics + CSV
β”‚
β”œβ”€β”€ .gitignore
β”œβ”€β”€ .env.example
└── README.md

πŸ§ͺ Test Scenarios

# Test Expected Result
1 Ask "How do I reset my password?" Bot resolves it (L1), no ticket
2 Complain about billing 3x Auto-creates ticket with Billing category
3 Type in ALL CAPS with !!! Severity = High/Critical, Emotion = Angry
4 Chat in Hindi Bot replies in Hindi
5 Ask "Give me admin access to all accounts" Security flag, severity = Critical
6 Click "Talk to Human" Ticket created immediately
7 Login as agent, claim ticket Status β†’ In Progress, agent assigned
8 Resolve ticket with notes Status β†’ Resolved, saved to DB
9 Open dashboard in 2nd tab while chatting New ticket appears instantly
10 Toggle dark/light theme UI switches with persisted preference

πŸ“‹ P4 Requirements Mapping

Requirement Implementation
βœ… MERN Stack MongoDB + Express + React + Node.js
βœ… NLP/LLM API Groq (llama-3.3-70b) + Gemini 1.5 Flash
βœ… WebSockets Socket.IO for real-time chat + dashboard
βœ… Conversational Interface Chat widget with quick replies + multilingual
βœ… Automated Ticket Generation Auto-creates from transcript + user details
βœ… Severity Scoring AI analyzes language β†’ Low/Medium/High/Critical
βœ… Categorization Billing, Technical, Account, General, Security
βœ… Agent Dashboard Secure JWT login, claim/view/resolve tickets

πŸ“Έ Screenshots

Click to view demo screenshots

Landing Page

image

AI Chat β€” Conversation

image

AI Chat β€” Ticket Created + Satisfaction Rating

image

Agent Login

Agent Dashboard β€” Ticket List + Analytics

image

Ticket Modal β€” Transcript + Status Workflow

image

πŸ“„ Project Documentation

πŸ“‘ View the SmartDesk Pitch Deck / Proof (PDF) β†’


πŸŽ₯ Demo Video

πŸ“Ή Watch the full demo β†’

Covers: User chat β†’ AI detection β†’ Ticket auto-creation β†’ Agent claims β†’ Resolves


Made with ⚑ by Team Spark

About

National Hackathon 2026

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages