Skip to content

Jayeshkhandelwal09/CRM-with-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

53 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ AI-Powered CRM with Intelligent Sales Assistant

AI CRM Banner Next.js Node.js MongoDB OpenAI ChromaDB

A next-generation CRM that functions as a real-time AI assistant for sales professionals

๐ŸŽฏ Features โ€ข ๐Ÿ—๏ธ Architecture โ€ข ๐Ÿค– AI Implementation โ€ข ๐Ÿš€ Quick Start โ€ข ๐Ÿ“Š Demo


๐Ÿ“‹ Table of Contents


๐ŸŽฏ Core AI Features

Our AI-powered CRM transforms traditional sales processes with four intelligent modules that provide real-time, contextual assistance:

๐Ÿง  1. Deal Coach AI

Intelligent Deal Progression Assistant

The Deal Coach AI analyzes your deals and provides actionable next steps based on:

  • Historical Deal Patterns: Leverages similar successful deals from your database
  • Stage-Specific Logic: Tailored suggestions based on current deal stage
  • Time-Based Triggers: Identifies stagnant deals and suggests re-engagement strategies
  • Value-Based Prioritization: Higher-value deals receive more sophisticated coaching

Key Capabilities:

  • โœ… Analyzes deal metadata, past interactions, and objection patterns
  • โœ… Provides 2-3 prioritized action items with confidence scores
  • โœ… Uses RAG to retrieve top 5 most similar historical successful deals
  • โœ… Considers industry match (40%), deal size (30%), and objection type (30%)

Example Output:

๐ŸŽฏ HIGH PRIORITY: Schedule decision-maker call
   Confidence: 85% | Based on 3 similar $50K+ deals
   
โฐ MEDIUM: Send detailed ROI proposal
   Confidence: 72% | 2 similar deals closed after ROI presentation
   
๐Ÿ“ž LOW: Follow up on technical questions
   Confidence: 65% | Standard follow-up for this stage

๐Ÿ‘ค 2. Customer Persona Builder

AI-Powered Behavioral Analysis

Automatically generates comprehensive customer profiles by analyzing:

  • Communication Patterns: Formal vs. casual, response times, preferred channels
  • Decision-Making Style: Analytical vs. intuitive, solo vs. committee-based
  • Objection Patterns: Price-focused, feature-focused, or timeline-focused
  • Engagement Levels: High, medium, or low responsiveness

Intelligence Features:

  • ๐Ÿ”„ Auto-Updates: Refreshes after every 3 new interactions
  • ๐ŸŽฏ Contextual Insights: Tailors communication recommendations
  • ๐Ÿ“Š Behavioral Scoring: Quantifies engagement and buying signals
  • ๐Ÿ” Pattern Recognition: Identifies similar customer archetypes

๐Ÿ›ก๏ธ 3. Objection Handler

Smart Response Generation System

Provides intelligent, contextual responses to customer objections:

  • Multi-Angle Approach: Logical, emotional, and social proof strategies
  • Tone Matching: Adapts to customer's communication style
  • Context Awareness: Considers deal stage, customer persona, and objection history
  • Follow-up Integration: Includes conversation-continuing questions

Response Strategy Framework:

  1. Acknowledge the concern professionally
  2. Address with 2-3 different approach angles
  3. Advance the conversation with strategic questions

๐Ÿ“Š 4. Win/Loss Explainer

Deal Outcome Analysis Engine

Provides comprehensive analysis of closed deals to improve future performance:

  • Timeline Analysis: Compares deal duration to industry averages
  • Objection Impact: Analyzes how objections affected the outcome
  • Stakeholder Engagement: Evaluates decision-maker involvement
  • Competitive Factors: Identifies competitive advantages/disadvantages

๐ŸŽฏ ScreenShots

Screenshot 2025-06-03 at 9 07 09โ€ฏAM Screenshot 2025-06-03 at 9 07 21โ€ฏAM Screenshot 2025-06-03 at 9 07 34โ€ฏAM Screenshot 2025-06-03 at 9 07 52โ€ฏAM Screenshot 2025-06-03 at 9 08 03โ€ฏAM Screenshot 2025-06-03 at 9 08 14โ€ฏAM Screenshot 2025-06-03 at 9 09 13โ€ฏAM Screenshot 2025-06-03 at 9 09 25โ€ฏAM Screenshot 2025-06-03 at 9 09 35โ€ฏAM Screenshot 2025-06-03 at 9 09 47โ€ฏAM Screenshot 2025-06-03 at 9 10 11โ€ฏAM Screenshot 2025-06-03 at 9 10 33โ€ฏAM Screenshot 2025-06-03 at 9 10 48โ€ฏAM Screenshot 2025-06-03 at 9 10 55โ€ฏAM Screenshot 2025-06-03 at 9 11 15โ€ฏAM

๐Ÿ—๏ธ System Architecture

Mermaid System Arch link : https://spiffy-dodol-911dbe.netlify.app/

graph TB
    subgraph "Frontend Layer"
        UI[Next.js UI Components]
        AI_COMP[AI Feature Components]
        DASH[Dashboard & Analytics]
    end
    
    subgraph "API Gateway"
        AUTH[Authentication Middleware]
        RATE[Rate Limiting]
        VALID[Input Validation]
    end
    
    subgraph "Business Logic Layer"
        AI_CTRL[AI Controller]
        DEAL_CTRL[Deal Controller]
        CONTACT_CTRL[Contact Controller]
    end
    
    subgraph "AI Services Layer"
        AI_SVC[AI Service]
        RAG_SVC[RAG Indexing Service]
        VECTOR_SVC[Vector Service]
        CONTENT_FILTER[Content Filter]
    end
    
    subgraph "External AI Services"
        OPENAI[OpenAI GPT-4 API]
        EMBED[OpenAI Embeddings API]
    end
    
    subgraph "Data Layer"
        MONGO[(MongoDB)]
        CHROMA[(ChromaDB Vector Store)]
        CACHE[In-Memory Cache]
    end
    
    UI --> AUTH
    AI_COMP --> AUTH
    DASH --> AUTH
    
    AUTH --> RATE
    RATE --> VALID
    VALID --> AI_CTRL
    VALID --> DEAL_CTRL
    VALID --> CONTACT_CTRL
    
    AI_CTRL --> AI_SVC
    AI_CTRL --> RAG_SVC
    
    AI_SVC --> VECTOR_SVC
    AI_SVC --> CONTENT_FILTER
    AI_SVC --> OPENAI
    
    VECTOR_SVC --> EMBED
    VECTOR_SVC --> CHROMA
    
    RAG_SVC --> VECTOR_SVC
    RAG_SVC --> MONGO
    
    DEAL_CTRL --> MONGO
    CONTACT_CTRL --> MONGO
    
    AI_SVC --> CACHE
    
    classDef frontend fill:#e1f5fe
    classDef api fill:#f3e5f5
    classDef business fill:#e8f5e8
    classDef ai fill:#fff3e0
    classDef external fill:#ffebee
    classDef data fill:#f1f8e9
    
    class UI,AI_COMP,DASH frontend
    class AUTH,RATE,VALID api
    class AI_CTRL,DEAL_CTRL,CONTACT_CTRL business
    class AI_SVC,RAG_SVC,VECTOR_SVC,CONTENT_FILTER ai
    class OPENAI,EMBED external
    class MONGO,CHROMA,CACHE data
Loading

๐Ÿค– AI & RAG Implementation

๐Ÿง  Retrieval-Augmented Generation (RAG) Architecture

Our RAG implementation enhances AI responses with contextual historical data:

sequenceDiagram
    participant User
    participant Frontend
    participant AI_Controller
    participant AI_Service
    participant Vector_Service
    participant ChromaDB
    participant OpenAI
    participant MongoDB
    
    User->>Frontend: Request AI Suggestion
    Frontend->>AI_Controller: API Call with Context
    AI_Controller->>AI_Service: Process Request
    
    Note over AI_Service: Rate Limit Check (500/day)
    AI_Service->>AI_Service: Check Cache
    
    alt Cache Miss
        AI_Service->>Vector_Service: Search Similar Context
        Vector_Service->>OpenAI: Generate Query Embedding
        OpenAI-->>Vector_Service: Embedding Vector
        Vector_Service->>ChromaDB: Similarity Search
        ChromaDB-->>Vector_Service: Top 5 Similar Records
        Vector_Service-->>AI_Service: RAG Context
        
        AI_Service->>OpenAI: Generate Response with Context
        OpenAI-->>AI_Service: AI Response
        AI_Service->>AI_Service: Cache Response
    else Cache Hit
        AI_Service->>AI_Service: Return Cached Response
    end
    
    AI_Service->>MongoDB: Log AI Request
    AI_Service-->>AI_Controller: Structured Response
    AI_Controller-->>Frontend: JSON Response
    Frontend-->>User: Display AI Suggestions
Loading

๐Ÿ” Vector Database Strategy

ChromaDB Collections:

  1. historical_deals - Deal Coach Context

    • Stores: Deal outcomes, timelines, objections, industry data
    • Similarity Factors: Industry (40%), Deal Size (30%), Objection Type (30%)
    • Time Limit: Last 12 months only
  2. objection_responses - Objection Handler Context

    • Stores: Successful objection handling patterns
    • Metadata: Objection category, resolution success rate, industry
  3. customer_interactions - Persona Builder Context

    • Stores: Communication patterns, response behaviors
    • Analysis: Tone, frequency, engagement levels
  4. customer_personas - Persona Patterns

    • Stores: Behavioral profiles and traits
    • Matching: Similar personality patterns and decision-making styles

๐ŸŽฏ Context Retrieval Logic

// Example: Deal Coach RAG Query
const dealContext = {
  industry: "SaaS",
  dealValue: 50000,
  stage: "proposal",
  objections: ["price", "timeline"],
  duration: 45 // days
};

// Vector search with weighted similarity
const similarDeals = await vectorService.searchSimilar('deals', dealContext, 5, {
  industry: dealContext.industry,
  outcome: 'closed_won',
  value: { $gte: dealContext.dealValue * 0.5, $lte: dealContext.dealValue * 2 }
});

// AI prompt with RAG context
const prompt = `
Based on these similar successful deals:
${similarDeals.map(deal => deal.summary).join('\n')}

Provide 3 actionable suggestions for current deal:
Industry: ${dealContext.industry}
Value: $${dealContext.dealValue}
Stage: ${dealContext.stage}
`;

๐Ÿ›ก๏ธ Content Filtering & Safety

Multi-Layer Content Security:

  1. Input Sanitization: DOMPurify for XSS prevention
  2. Content Classification: Inappropriate content detection
  3. Business Context Validation: Ensures professional sales context
  4. Rate Limiting: 500 AI requests per user per day
  5. Audit Logging: Complete request/response tracking

๐Ÿ—„๏ธ Vector Database Integration

๐Ÿ“Š Embedding Generation Process

flowchart TD
    A[New CRM Data] --> B{Data Type?}
    
    B -->|Deal Closed| C[Extract Deal Context]
    B -->|Objection Resolved| D[Extract Objection Pattern]
    B -->|Interaction Logged| E[Extract Communication Pattern]
    
    C --> F[Generate Deal Summary]
    D --> G[Generate Objection Summary]
    E --> H[Generate Interaction Summary]
    
    F --> I[OpenAI Embedding API]
    G --> I
    H --> I
    
    I --> J[1536-dim Vector]
    
    J --> K{Store in ChromaDB}
    
    K --> L[historical_deals Collection]
    K --> M[objection_responses Collection]
    K --> N[customer_interactions Collection]
    
    L --> O[Available for Deal Coach]
    M --> P[Available for Objection Handler]
    N --> Q[Available for Persona Builder]
    
    style A fill:#e3f2fd
    style I fill:#fff3e0
    style K fill:#f3e5f5
Loading

๐Ÿ”„ Real-time Indexing Pipeline

Automatic Data Indexing:

  • Trigger Events: Deal closure, objection resolution, interaction logging
  • Batch Processing: 10 records per batch to optimize performance
  • Incremental Updates: Only new/modified data is re-indexed
  • Background Processing: Non-blocking indexing operations

Index Optimization:

// Automatic reindexing on data changes
class RAGIndexingService {
  async handleDataUpdate(modelType, documentId, action = 'update') {
    switch (modelType) {
      case 'Deal':
        if (action === 'closed') {
          await this.reindexDeal(documentId);
        }
        break;
      case 'Objection':
        if (action === 'resolved') {
          await this.reindexObjection(documentId);
        }
        break;
      case 'Interaction':
        await this.reindexInteraction(documentId);
        break;
    }
  }
}

๐Ÿ”„ Data Flow & Processing

๐Ÿ“ˆ AI Request Processing Pipeline

graph LR
    subgraph "Request Processing"
        A[User Request] --> B[Authentication]
        B --> C[Rate Limiting]
        C --> D[Input Validation]
        D --> E[Content Filtering]
    end
    
    subgraph "AI Processing"
        E --> F[Cache Check]
        F --> G{Cache Hit?}
        G -->|Yes| H[Return Cached]
        G -->|No| I[RAG Context Retrieval]
        I --> J[Generate AI Response]
        J --> K[Cache Response]
    end
    
    subgraph "Response Delivery"
        H --> L[Structure Response]
        K --> L
        L --> M[Add Metadata]
        M --> N[Log Request]
        N --> O[Return to User]
    end
    
    style A fill:#e8f5e8
    style J fill:#fff3e0
    style O fill:#e3f2fd
Loading

๐ŸŽฏ Confidence Scoring Algorithm

calculateConfidence(response, ragContext = []) {
  let confidence = 50; // Base confidence
  
  // RAG context quality
  if (ragContext.length >= 3) confidence += 20;
  if (ragContext.some(ctx => ctx.similarity > 0.8)) confidence += 15;
  
  // Response characteristics
  if (response.includes('specific') || response.includes('based on')) confidence += 10;
  if (response.length > 100 && response.length < 300) confidence += 5;
  
  // Historical accuracy (if available)
  const historicalAccuracy = this.getHistoricalAccuracy(feature);
  confidence = Math.round(confidence * (historicalAccuracy / 100));
  
  return Math.min(Math.max(confidence, 10), 95); // Cap between 10-95%
}

๐Ÿ’ป Technology Stack

๐ŸŽจ Frontend Architecture

Next.js 15.3.3 (React 19)
โ”œโ”€โ”€ ๐ŸŽจ Styling: Tailwind CSS + ShadCN UI
โ”œโ”€โ”€ ๐Ÿ”„ State Management: React Hooks + Context
โ”œโ”€โ”€ ๐Ÿ“ฑ Responsive Design: Mobile-first approach
โ”œโ”€โ”€ ๐ŸŒ™ Theme Support: Dark/Light mode toggle
โ”œโ”€โ”€ โšก Performance: Turbopack for fast builds
โ””โ”€โ”€ ๐ŸŽญ Animations: Framer Motion + CSS transitions

โš™๏ธ Backend Architecture

Node.js 18+ (Express.js)
โ”œโ”€โ”€ ๐Ÿ—„๏ธ Database: MongoDB with Mongoose ODM
โ”œโ”€โ”€ ๐Ÿค– AI Integration: OpenAI GPT-4 + Embeddings API
โ”œโ”€โ”€ ๐Ÿ” Vector Database: ChromaDB for RAG
โ”œโ”€โ”€ ๐Ÿ” Authentication: JWT with bcrypt
โ”œโ”€โ”€ ๐Ÿ›ก๏ธ Security: Helmet, CORS, Rate Limiting
โ”œโ”€โ”€ ๐Ÿ“ Logging: Winston with structured logs
โ”œโ”€โ”€ โœ… Validation: Express-validator + Joi
โ””โ”€โ”€ ๐Ÿงช Testing: Jest + Supertest

๐Ÿค– AI & ML Stack

OpenAI Integration
โ”œโ”€โ”€ ๐Ÿง  Language Model: GPT-4 (gpt-4)
โ”œโ”€โ”€ ๐Ÿ“Š Embeddings: text-embedding-3-small (1536 dimensions)
โ”œโ”€โ”€ ๐ŸŽฏ Temperature: 0.7 for balanced creativity/consistency
โ”œโ”€โ”€ ๐Ÿ“ Token Limits: 400 tokens for suggestions, 800 for analysis
โ””โ”€โ”€ ๐Ÿ’ฐ Cost Optimization: Response caching + rate limiting

๐Ÿ—„๏ธ Data Architecture

Data Layer
โ”œโ”€โ”€ ๐Ÿ“Š Primary Database: MongoDB
โ”‚   โ”œโ”€โ”€ Users, Contacts, Deals, Interactions
โ”‚   โ”œโ”€โ”€ AI Logs, Sessions, Objections
โ”‚   โ””โ”€โ”€ Indexes on userId, dealId, timestamps
โ”œโ”€โ”€ ๐Ÿ” Vector Database: ChromaDB
โ”‚   โ”œโ”€โ”€ 4 Collections (deals, objections, interactions, personas)
โ”‚   โ”œโ”€โ”€ Cosine similarity search
โ”‚   โ””โ”€โ”€ Metadata filtering
โ””โ”€โ”€ โšก Caching: In-memory cache (15min TTL)

๐Ÿš€ Quick Start

๐Ÿ“‹ Prerequisites

# Required versions
Node.js >= 18.0.0
MongoDB >= 5.0
Python >= 3.8 (for ChromaDB)

๐Ÿ”ง Installation

  1. Clone the repository
git clone https://github.com/your-org/ai-powered-crm.git
cd ai-powered-crm
  1. Setup Backend
cd backend
npm install

# Environment configuration
cp .env.example .env
# Add your OpenAI API key and MongoDB connection string
  1. Setup Frontend
cd ../frontend
npm install
  1. Setup ChromaDB
# Install ChromaDB
pip install chromadb

# Start ChromaDB server
chroma run --host localhost --port 8000
  1. Environment Variables
# Backend .env
# =============================================================================
# CRM AI Backend Environment Configuration
# =============================================================================

# Server Configuration
PORT=5000
NODE_ENV=development

# Database Configuration
MONGODB_URI=mongodb://localhost:27017/crm-ai-dev
MONGODB_TEST_URI=mongodb://localhost:27017/crm-ai-test

# JWT Configuration
JWT_SECRET=your-super-secret-jwt-key-change-in-production-min-32-chars
JWT_REFRESH_SECRET=your-super-secret-refresh-key-change-in-production-min-32-chars
JWT_EXPIRE=24h
JWT_REFRESH_EXPIRE=7d

# CORS Configuration
FRONTEND_URL=http://localhost:3000

# Rate Limiting Configuration
RATE_LIMIT_WINDOW_MS=900000
RATE_LIMIT_MAX_REQUESTS=100

# AI Configuration
OPENAI_API_KEY=your-openai-api-key-here
AI_REQUESTS_PER_DAY=500

# File Upload Configuration
MAX_FILE_SIZE=5242880
UPLOAD_PATH=uploads/

# Email Configuration (SMTP)
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASS=your-app-password

# Logging Configuration
LOG_LEVEL=info
LOG_FILE=logs/combined.log
ERROR_LOG_FILE=logs/error.log

# =============================================================================
# Development Notes:
# =============================================================================
# 1. Replace JWT secrets with strong random strings (min 32 characters)
# 2. Add your OpenAI API key for AI features to work
# 3. Configure SMTP settings for email functionality
# 4. For production, use environment-specific values
# =============================================================================

# Frontend .env.local
NEXT_PUBLIC_API_URL=http://localhost:3001

๐Ÿš€ Running the Application

# Terminal 1: Start ChromaDB
chroma run --host localhost --port 8000

# Terminal 2: Start Backend
cd backend
npm run dev

# Terminal 3: Start Frontend
cd frontend
npm run dev

Access the application:

๐Ÿ“Š Initial Data Setup

# Seed database with sample data
cd backend
npm run seed

# Index existing data for RAG
curl -X POST http://localhost:3001/api/admin/index-data

๐Ÿ“Š Interactive Demo

๐ŸŽฎ Try the AI Features

1. Deal Coach Demo:

# Create a sample deal
curl -X POST http://localhost:3001/api/deals \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -d '{
    "title": "Enterprise SaaS Deal",
    "value": 50000,
    "stage": "proposal",
    "contactId": "CONTACT_ID"
  }'

# Get AI coaching suggestions
curl -X GET http://localhost:3001/api/deals/DEAL_ID/coach \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

2. Objection Handler Demo:

# Handle a price objection
curl -X POST http://localhost:3001/api/objections/handle \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -d '{
    "objectionText": "Your solution is too expensive for our budget",
    "dealId": "DEAL_ID",
    "category": "price",
    "severity": "high"
  }'

๐Ÿ“ˆ Sample AI Responses

Deal Coach Response:

{
  "success": true,
  "data": {
    "suggestions": [
      {
        "action": "Schedule decision-maker call",
        "priority": "high",
        "confidence": 85,
        "reasoning": "Based on 3 similar $50K+ deals that closed after executive involvement"
      },
      {
        "action": "Send detailed ROI analysis",
        "priority": "medium", 
        "confidence": 72,
        "reasoning": "2 similar deals in your industry closed after ROI presentation"
      }
    ],
    "ragContext": [
      {
        "similarity": 0.89,
        "industry": "SaaS",
        "outcome": "closed_won",
        "value": 45000
      }
    ]
  }
}

๐Ÿ”’ Security & Privacy

๐Ÿ›ก๏ธ Security Measures

Authentication & Authorization:

  • JWT-based authentication with secure token storage
  • Password hashing using bcryptjs (12 rounds)
  • Session management with automatic expiration
  • Role-based access control (planned for v2.0)

API Security:

  • Rate limiting: 500 AI requests per user per day
  • Input validation and sanitization
  • CORS configuration for cross-origin requests
  • Helmet.js for security headers
  • Request/response logging for audit trails

Data Protection:

  • Content filtering for inappropriate inputs
  • PII data handling with MongoDB encryption
  • Secure API key management
  • Regular security audits and updates

AI Safety:

  • Content moderation for all AI inputs/outputs
  • Prompt injection prevention
  • Response filtering and validation
  • Usage monitoring and anomaly detection

๐Ÿ” Privacy Compliance

Data Handling:

  • Minimal data collection principle
  • User consent for AI processing
  • Data retention policies (2 years for interactions)
  • Soft delete with 30-day recovery window
  • Export functionality for data portability

๐Ÿ“ˆ Performance & Scalability

โšก Performance Optimizations

Frontend Performance:

  • Next.js 15 with Turbopack for fast builds
  • Component lazy loading and code splitting
  • Image optimization and caching
  • Service worker for offline functionality
  • Bundle size optimization (< 500KB gzipped)

Backend Performance:

  • Response caching (15-minute TTL)
  • Database query optimization with indexes
  • Connection pooling for MongoDB
  • Batch processing for vector operations
  • Background job processing for indexing

AI Performance:

  • Response caching to reduce API calls
  • Batch embedding generation
  • Vector search optimization
  • Token usage optimization
  • Fallback responses for API failures

๐Ÿ“Š Scalability Architecture

Horizontal Scaling:

  • Stateless API design for load balancing
  • Database sharding strategies
  • CDN integration for static assets
  • Microservices architecture (planned)
  • Container orchestration with Docker

Monitoring & Analytics:

  • Real-time performance monitoring
  • AI usage analytics and cost tracking
  • Error tracking and alerting
  • User behavior analytics
  • System health dashboards

๐Ÿงช Testing

๐Ÿ”ฌ Test Coverage

Backend Testing:

# Run all tests
npm test

# Run with coverage
npm run test:coverage

# Watch mode for development
npm run test:watch

Test Categories:

  • Unit Tests: Individual function testing (85% coverage)
  • Integration Tests: API endpoint testing
  • AI Service Tests: Mock OpenAI responses
  • Database Tests: MongoDB operations
  • Security Tests: Input validation and sanitization

Frontend Testing:

# Component testing with React Testing Library
npm run test:components

# E2E testing with Playwright
npm run test:e2e

๐Ÿ“Š Test Results

Test Suites: 45 passed, 45 total
Tests:       312 passed, 312 total
Coverage:    85.2% statements, 82.1% branches
Time:        45.2s

๐Ÿ“š API Documentation

๐Ÿ”— Core Endpoints

Authentication:

POST /api/auth/login     - User login
POST /api/auth/register  - User registration
POST /api/auth/refresh   - Token refresh
DELETE /api/auth/logout  - User logout

AI Features:

GET    /api/deals/:id/coach           - Get deal coaching suggestions
POST   /api/objections/handle         - Handle customer objections
GET    /api/contacts/:id/persona      - Get customer persona analysis
POST   /api/deals/:id/win-loss        - Analyze deal outcome
POST   /api/ai/feedback               - Submit AI feedback

CRM Operations:

GET    /api/deals                     - List deals with filters
POST   /api/deals                     - Create new deal
PUT    /api/deals/:id                 - Update deal
DELETE /api/deals/:id                 - Delete deal

GET    /api/contacts                  - List contacts
POST   /api/contacts                  - Create contact
PUT    /api/contacts/:id              - Update contact

Analytics:

GET    /api/analytics/dashboard       - Dashboard metrics
GET    /api/analytics/ai-usage        - AI usage statistics
GET    /api/analytics/performance     - Performance metrics

๐Ÿ“– Detailed API Documentation

Full API documentation with examples, request/response schemas, and authentication details is available at:


๐Ÿค Contributing

๐Ÿ› ๏ธ Development Setup

  1. Fork the repository
  2. Create a feature branch
git checkout -b feature/amazing-feature
  1. Make your changes
  2. Add tests for new functionality
  3. Run the test suite
npm test
  1. Commit your changes
git commit -m "Add amazing feature"
  1. Push to your branch
git push origin feature/amazing-feature
  1. Open a Pull Request

๐Ÿ“ Contribution Guidelines

Code Standards:

  • Follow ESLint and Prettier configurations
  • Write comprehensive tests for new features
  • Update documentation for API changes
  • Use conventional commit messages
  • Maintain backward compatibility

AI Feature Development:

  • Test with multiple scenarios and edge cases
  • Implement proper error handling and fallbacks
  • Add content filtering for new AI inputs
  • Update RAG indexing for new data types
  • Monitor token usage and costs

๐Ÿ› Bug Reports

Please use the GitHub Issues page to report bugs. Include:

  • Detailed description of the issue
  • Steps to reproduce
  • Expected vs actual behavior
  • Environment details (OS, Node version, etc.)
  • Screenshots or logs if applicable

๐Ÿ™ Acknowledgments

  • OpenAI for providing the GPT-4 and Embeddings APIs
  • ChromaDB for the excellent vector database solution
  • Next.js Team for the amazing React framework
  • MongoDB for the flexible document database
  • ShadCN for the beautiful UI components
  • Vercel for deployment and hosting solutions

\

Built with โค๏ธ by the AI CRM Team

GitHub stars GitHub forks GitHub issues

Releases

No releases published

Packages

No packages published