Skip to content

imhrsit/Branch-chat-system-application

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Branch Customer Messaging System

A full-stack customer messaging application with AI-powered analysis, real-time updates and a web dashboard.

Branch Messages Node.js React

🌐 Live Demo

Service URL
Frontend https://branch-chat-system-application.vercel.app
Backend API https://branch-chat-system-application-1.onrender.com/api/health

🌟 Features

Core Functionality

  • Customer Message Management: View, filter and respond to customer messages
  • AI-Powered Analysis: Automatic message analysis for urgency, sentiment and suggested responses using Google Gemini AI
  • Real-time Updates: Server-Sent Events (SSE) for live message notifications
  • CSV Import: Bulk import messages from CSV files
  • Canned Responses: Pre-built response templates for quick replies

User Experience

  • Advanced Search: Search by customer name, email or message content with debouncing
  • Pagination: Load more functionality for large message volumes
  • Offline Detection: Visual indicator and graceful handling of offline states
  • Keyboard Shortcuts: Quick actions (Escape to close modals, Ctrl+R to refresh)
  • Responsive Design: Works on desktop and mobile devices

Technical Features

  • Request Caching: Optimized API calls with client-side caching
  • Error Boundaries: Graceful error handling with recovery options
  • Skeleton Loading: Smooth loading states for better perceived performance
  • Memoized Components: Optimized React rendering with React.memo

πŸ› οΈ Tech Stack

Backend

  • Framework: Express.js
  • Database: SQLite
  • AI: Google Gemini 2.0 Flash
  • Real-time: Server-Sent Events

Frontend

  • Framework: React.js
  • Styling: Tailwind CSS

πŸ“‹ Prerequisites

  • Node.js v18.0.0 or higher
  • npm or yarn package manager
  • Google Gemini API key (optional, for AI features)

πŸš€ Quick Start

1. Clone the Repository

git clone https://github.com/imhrsit/Branch-chat-system-application.git
cd Branch-chat-system-application

2. Backend Setup

cd server

# Install dependencies
npm install

# Create environment file
cp .env.example .env

# Edit .env with your configuration
# Add your Gemini API key if you want AI features

# Start the server
npm start

The backend will start on http://localhost:3001

3. Frontend Setup

cd client

# Install dependencies
npm install

# Start the development server
npm run dev

The frontend will start on http://localhost:5173

πŸ“„ CSV Import Format

The CSV file should contain the following columns:

customer_name,customer_email,customer_phone,message_content,account_type
John Smith,john@example.com,+1234567890,I need help with my account billing,premium
Jane Doe,jane@example.com,+0987654321,How do I reset my password?,standard
Bob Wilson,bob@company.com,+1122334455,URGENT: System is down for our team,enterprise

Required Columns

  • customer_name - Customer's full name
  • customer_email - Customer's email address
  • message_content - The message content

Optional Columns

  • customer_phone - Customer's phone number
  • account_type - Account type: standard, premium, enterprise

⌨️ Keyboard Shortcuts

Shortcut Action
Escape Close modals or go back from conversation view
Ctrl + R Refresh message list
Ctrl + Shift + I Open CSV import modal

πŸ”§ Development

Project Structure

branch_assignment/
β”œβ”€β”€ server/                 # Backend application
β”‚   β”œβ”€β”€ app.js             # Express app entry point
β”‚   β”œβ”€β”€ routes/            # API route handlers
β”‚   β”‚   β”œβ”€β”€ messages.js    # Message endpoints
β”‚   β”‚   β”œβ”€β”€ customers.js   # Customer endpoints
β”‚   β”‚   β”œβ”€β”€ agents.js      # Agent endpoints
β”‚   β”‚   └── cannedResponses.js
β”‚   β”œβ”€β”€ services/          # Business logic
β”‚   β”‚   └── aiService.js   # Gemini AI integration
β”‚   β”œβ”€β”€ db/                # Database
β”‚   β”‚   └── init.js        # Database initialization
β”‚   β”œβ”€β”€ utils/             # Utility functions
β”‚   β”‚   └── csvParser.js   # CSV parsing
β”‚   └── data/              # Sample data
β”‚
β”œβ”€β”€ client/                 # Frontend application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/    # React components
β”‚   β”‚   β”‚   β”œβ”€β”€ Navbar.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Sidebar.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ MessageList.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ MessageCard.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ConversationView.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Toast.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ImportCSVModal.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ CannedResponsesModal.jsx
β”‚   β”‚   β”‚   └── ErrorBoundary.jsx
β”‚   β”‚   β”œβ”€β”€ hooks/         # Custom React hooks
β”‚   β”‚   β”‚   └── useSSE.js  # SSE, debounce, online status hooks
β”‚   β”‚   β”œβ”€β”€ services/      # API services
β”‚   β”‚   β”‚   └── api.js     # API client with caching
β”‚   β”‚   β”œβ”€β”€ utils/         # Utility functions
β”‚   β”‚   β”‚   └── helpers.js
β”‚   β”‚   β”œβ”€β”€ App.jsx        # Main app component
β”‚   β”‚   β”œβ”€β”€ main.jsx       # App entry point
β”‚   β”‚   └── index.css      # Global styles
β”‚   └── index.html
β”‚
└── README.md

πŸ“ License

This project is created as an assignment for Branch International and is not licensed for commercial use.

🀝 Contact

For questions or feedback about this project:

  • Developer: Harsh Tiwari

About

A full-stack customer messaging application with AI-powered analysis, real-time updates and a dashboard.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors