Skip to content

clobig/contact

Repository files navigation

Contact Center Analysis Application

A comprehensive web application for analyzing contact center conversations with sentiment analysis, entity recognition, script compliance checking, and call quality assessment.

Features

  • Conversation Upload: Upload conversation transcriptions via Excel files
  • Text Analysis: Sentiment analysis, entity extraction, and conversational categorization
  • Script Compliance: Verify agents followed the prescribed call script
  • Call Quality Scoring: Comprehensive call quality metrics based on multiple factors
  • Multi-Client Support: Support for multiple clients, products, and agents
  • RESTful API: Complete API for all operations
  • Real-time Dashboard: Monitor conversations and analysis in real-time

Tech Stack

  • Frontend: Next.js 16, React 19, TypeScript
  • Backend: Next.js API Routes
  • Database: MySQL 8.0+
  • Styling: Tailwind CSS 4, Radix UI
  • File Upload: XLSX parsing
  • UI Components: Radix UI, Lucide Icons

Prerequisites

  • Node.js 20.9.0 or higher
  • MySQL 8.0 or higher
  • npm or yarn

Installation

  1. Clone and navigate to the project

    cd app
  2. Install dependencies

    npm install
  3. Set up environment variables

    cp .env.example .env.local
    # Edit .env.local with your MySQL credentials
  4. Create the database

    mysql -u root -p < scripts/schema.sql

Project Structure

src/
├── app/
│   ├── api/
│   │   ├── analyze/          # Conversation analysis endpoint
│   │   ├── clients/          # Client management
│   │   ├── conversations/    # Conversation CRUD
│   │   ├── products/         # Product management
│   │   └── upload/           # File upload handler
│   ├── globals.css
│   ├── layout.tsx
│   └── page.tsx
├── components/
│   ├── AnalyzeConversation.tsx
│   ├── AnalysisResults.tsx
│   ├── ConversationUpload.tsx
│   └── ui/
│       └── button.tsx
├── lib/
│   ├── db.ts                 # Database connection
│   └── helpers.ts            # Helper functions
├── services/
│   ├── analysisService.ts    # Text analysis logic
│   └── excelService.ts       # Excel parsing
├── types/
│   └── index.ts              # TypeScript types
└── utils/
scripts/
└── schema.sql                # MySQL schema

API Endpoints

Clients

  • GET /api/clients - List all clients
  • POST /api/clients - Create a new client

Products

  • GET /api/products?client_id={id} - List products
  • POST /api/products - Create a new product

Conversations

  • GET /api/conversations?client_id={id}&analyzed=true|false - List conversations
  • POST /api/conversations - Create a conversation

Analysis

  • POST /api/analyze - Analyze a conversation
  • GET /api/analyze?conversation_id={id} - Get analysis results

File Upload

  • POST /api/upload - Upload Excel file with conversations

Database Schema

Tables

  • clients - Client organization records
  • products - Products/services offered by clients
  • product_questions - Questions agents should ask for each product
  • conversations - Call transcriptions
  • sentiment_analysis - Sentiment analysis results
  • entities - Extracted entities from conversations
  • analysis_results - Overall analysis results
  • conversation_categories - Categorized conversation topics
  • call_quality_history - Agent performance tracking

Running the Application

Development

npm run dev

The app will be available at http://localhost:3002

Production Build

npm run build
npm start

Linting

npm run lint

Excel Upload Format

Expected columns in the Excel file:

  • transcription - The conversation text (required)
  • agent_id - ID of the agent handling the call
  • duration_seconds - Call duration in seconds
  • product_name - Optional product name reference
  • client_name - Optional client name reference

Analysis Features

Sentiment Analysis

  • Positive, negative, or neutral classification
  • Confidence scoring based on keyword analysis
  • Customizable sentiment keywords

Entity Extraction

  • Email addresses
  • Phone numbers
  • Product mentions
  • Organization names

Script Compliance

  • Measures adherence to the prescribed call script
  • Identifies script deviations
  • Tracks questions asked vs. required questions

Call Quality Score

  • Script Compliance Score (40% weight)
  • Question Coverage Score (40% weight)
  • Sentiment Score (20% weight)
  • Overall quality range: 0-100

Configuration

Edit .env.local to configure:

  • MySQL connection details
  • Server port
  • Node environment

Future Enhancements

  • Real NLP/ML models for sentiment and NER
  • Advanced analytics and reporting
  • Agent performance dashboards
  • Keyword spotting for competitive intelligence
  • Call recordings storage and player
  • Integration with contact center systems
  • Custom script templates per product
  • A/B testing for call scripts
  • Multi-language support

License

This project is proprietary and confidential.

Support

For issues or questions, please contact the development team.

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out our Next.js deployment documentation for more details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages