README Documentation
MCP Chat Support System
A comprehensive chat support system with React frontend and Node.js backend, featuring real-time messaging, knowledge base management, and multi-tenant architecture.
š Features
Frontend (React + TypeScript)
- Modern UI/UX: Responsive design with mobile optimization
- Real-time Chat: WebSocket-based live messaging
- Authentication: Google OAuth integration
- Demo Mode: Interactive demo with simulated features
- Payment Integration: Stripe payment processing
- Video Calls: WebRTC video conferencing
- Knowledge Base: Searchable documentation system
- Admin Dashboard: Multi-tenant management interface
- Offline Support: Service worker for offline functionality
Backend (Node.js + TypeScript)
- RESTful API: Express.js server with TypeScript
- WebSocket Server: Real-time communication
- Database: SQLite with TypeORM
- Authentication: JWT token-based auth
- Multi-tenancy: Tenant isolation and management
- File Upload: Secure file handling
- Analytics: Usage tracking and reporting
- Widget System: Embeddable chat widgets
š Project Structure
project/
āāā src/ # React frontend
ā āāā components/ # Reusable UI components
ā āāā pages/ # Page components
ā āāā contexts/ # React contexts
ā āāā hooks/ # Custom React hooks
ā āāā lib/ # Utility functions
ā āāā types/ # TypeScript type definitions
āāā server/ # Node.js backend
ā āāā src/
ā ā āāā routes/ # API route handlers
ā ā āāā middleware/ # Express middleware
ā ā āāā services/ # Business logic
ā ā āāā db/ # Database models
ā āāā package.json
ā āāā tsconfig.json
āāā gemini-mcp-server/ # Gemini MCP integration
āāā public/ # Static assets
āāā docs/ # Documentation
š ļø Tech Stack
Frontend
- React 18 with TypeScript
- Vite for build tooling
- Tailwind CSS for styling
- React Router for navigation
- Socket.io Client for real-time features
- Stripe for payments
- WebRTC for video calls
Backend
- Node.js with TypeScript
- Express.js framework
- Socket.io for WebSocket server
- SQLite database with TypeORM
- JWT for authentication
- Multer for file uploads
- Cors for cross-origin requests
š Quick Start
Prerequisites
- Node.js 18+
- npm or yarn
- Git
Frontend Setup
# Install dependencies
npm install
# Start development server
npm run dev
# Build for production
npm run build
Backend Setup
# Navigate to server directory
cd server
# Install dependencies
npm install
# Copy environment variables
cp env.example .env
# Start development server
npm run dev
# Build for production
npm run build
Environment Variables
Create a .env file in the server directory:
# Server Configuration
PORT=3001
NODE_ENV=development
# Database
DATABASE_URL=sqlite:./database.sqlite
# JWT Secret
JWT_SECRET=your-jwt-secret-here
# Google OAuth
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
# Stripe (for payments)
STRIPE_SECRET_KEY=your-stripe-secret-key
STRIPE_PUBLISHABLE_KEY=your-stripe-publishable-key
# File Upload
UPLOAD_DIR=uploads/
MAX_FILE_SIZE=5242880
š± Features Overview
Chat Interface
- Real-time messaging with typing indicators
- File sharing and image uploads
- Message history and search
- Read receipts and delivery status
Knowledge Base
- Searchable documentation
- Category organization
- Rich text editing
- Version control
Admin Dashboard
- Multi-tenant management
- User analytics and reporting
- System configuration
- Widget customization
Widget System
- Embeddable chat widgets
- Customizable appearance
- Multi-language support
- Mobile responsive
š§ Development
Code Style
- TypeScript for type safety
- ESLint for code linting
- Prettier for code formatting
- Husky for git hooks
Testing
# Run frontend tests
npm test
# Run backend tests
cd server && npm test
Database Migrations
cd server
npm run migration:generate
npm run migration:run
š Deployment
Frontend (Vercel/Netlify)
npm run build
# Deploy the dist/ folder
Backend (Render/Railway)
cd server
npm run build
npm start
Gemini MCP Server (Hugging Face Spaces)
The Gemini MCP Server can be deployed to Hugging Face Spaces for free:
š For detailed deployment instructions, see: gemini-mcp-server/README_HF_SPACES.md
Quick Steps:
- Get a free Google Gemini API key from Google AI Studio
- Create a new Space on Hugging Face Spaces
- Choose "Docker" as the SDK
- Connect your GitHub repository
- Set the
GEMINI_API_KEYenvironment variable - Deploy!
Cost: $0 (free tier available for both Hugging Face Spaces and Google Gemini API)
Node.js Backend (Hugging Face Spaces)
The Node.js/Express backend can also be deployed to Hugging Face Spaces:
š For detailed deployment instructions, see: server/README_HF_SPACES.md
Quick Steps:
- Create a new Space on Hugging Face Spaces
- Choose "Docker" as the SDK
- Connect your GitHub repository
- Set the
JWT_SECRETenvironment variable - Deploy!
Cost: $0 (free tier available for Hugging Face Spaces)
Docker Deployment
# Build and run with Docker Compose
docker-compose up -d
š API Documentation
Authentication Endpoints
POST /api/auth/login- User loginPOST /api/auth/register- User registrationPOST /api/auth/google- Google OAuthGET /api/auth/profile- Get user profile
Chat Endpoints
GET /api/chat/messages- Get chat historyPOST /api/chat/messages- Send messageGET /api/chat/rooms- Get chat rooms
Knowledge Base Endpoints
GET /api/knowledge- Get knowledge articlesPOST /api/knowledge- Create articlePUT /api/knowledge/:id- Update articleDELETE /api/knowledge/:id- Delete article
š¤ Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
š License
This project is licensed under the MIT License - see the LICENSE file for details.
š Support
For support and questions:
- Create an issue on GitHub
- Check the documentation in the
/docsfolder - Review the deployment guides
š Links
Made with ā¤ļø by Chirag