A modern, scalable real-time messaging platform built for the next generation of communication
Live Demo โข Documentation โข API Reference โข Report Bug
ChatVerse is a production-ready, real-time messaging platform designed for modern communication needs. Built with scalability, performance, and user experience in mind, it provides a WhatsApp-like experience with enterprise-grade features.
- ๐ Real-time Everything: Instant messaging, typing indicators, presence status
- ๐ Enterprise Security: JWT authentication, rate limiting, input validation
- ๐ฑ Cross-Platform: PWA support for mobile and desktop installations
- โ๏ธ Cloud-Ready: Docker containerization with Kubernetes deployment configs
- ๐จ Modern UI/UX: Responsive design with dark/light theme support
- ๐ Scalable Architecture: Microservices-ready with monitoring and observability
|
|
|
|
graph TD
A[React 18 + TypeScript] --> B[Vite Build Tool]
B --> C[Tailwind CSS]
C --> D[Zustand State Management]
D --> E[React Query Data Fetching]
E --> F[Socket.io Client]
F --> G[PWA Service Worker]
graph TD
A[Node.js + Express] --> B[TypeScript]
B --> C[Socket.io Server]
C --> D[MongoDB + Mongoose]
D --> E[Redis Caching]
E --> F[AWS S3 Storage]
F --> G[JWT Authentication]
- Containerization: Docker & Docker Compose
- Orchestration: Kubernetes manifests
- Monitoring: OpenTelemetry, Prometheus metrics
- CI/CD: GitHub Actions workflows
- Cloud: AWS (S3, CloudFront, ECS ready)
ChatVerse/
โโโ ๐ฑ apps/
โ โโโ ๐ web/ # React frontend application
โ โ โโโ src/
โ โ โ โโโ components/ # Reusable UI components
โ โ โ โโโ hooks/ # Custom React hooks
โ โ โ โโโ services/ # API clients & utilities
โ โ โ โโโ store/ # Zustand state management
โ โ โ โโโ utils/ # Helper functions
โ โ โโโ public/ # Static assets
โ โโโ ๐ง api/ # Node.js backend API
โ โโโ src/
โ โ โโโ controllers/ # Route handlers
โ โ โโโ middlewares/ # Express middlewares
โ โ โโโ models/ # MongoDB schemas
โ โ โโโ services/ # Business logic
โ โ โโโ realtime/ # Socket.io handlers
โ โ โโโ tests/ # Test suites
โ โโโ dist/ # Compiled JavaScript
โโโ ๐ฆ packages/
โ โโโ types/ # Shared TypeScript definitions
โ โโโ ui/ # Reusable UI components
โ โโโ eslint-config/ # Shared linting rules
โโโ ๐ณ infra/
โ โโโ docker/ # Docker configurations
โ โโโ k8s/ # Kubernetes manifests
โ โโโ terraform/ # Infrastructure as Code
โโโ ๐ docs/ # Comprehensive documentation
โโโ ๐จ scripts/ # Build & deployment scripts
Ensure you have the following installed:
- Node.js 18+ (Download)
- PNPM 8+ (Install Guide)
- Docker & Docker Compose (Install Guide)
- Git (Download)
-
Clone the repository
git clone https://github.com/SatvikPraveen/ChatVerse.git cd ChatVerse -
Install dependencies
pnpm install
-
Set up environment variables
# Backend configuration cp apps/api/.env.example apps/api/.env # Frontend configuration cp apps/web/.env.example apps/web/.env
-
Start development services
# Start MongoDB & Redis containers pnpm docker:dev # Start development servers (separate terminal) pnpm dev
-
Access the application
- ๐ Frontend: http://localhost:3000
- ๐ง API: http://localhost:3001
- ๐ API Docs: http://localhost:3001/docs
- ๐๏ธ MongoDB: localhost:27017
- ๐ด Redis: localhost:6379
Create apps/api/.env from the example file:
# Application
NODE_ENV=development
PORT=3001
# Database
MONGODB_URI=mongodb://admin:password@localhost:27017/ChatVerse?authSource=admin
REDIS_URL=redis://localhost:6379
# Authentication
JWT_SECRET=your-super-secret-jwt-key-minimum-32-characters-long
JWT_EXPIRES_IN=7d
# Security
CORS_ORIGINS=http://localhost:3000,https://yourdomain.com
# File Storage (AWS S3)
AWS_REGION=us-east-1
AWS_S3_BUCKET=ChatVerse-uploads
AWS_ACCESS_KEY_ID=your-access-key
AWS_SECRET_ACCESS_KEY=your-secret-key
# Push Notifications (Optional)
VAPID_PUBLIC_KEY=your-vapid-public-key
VAPID_PRIVATE_KEY=your-vapid-private-key
VAPID_EMAIL=your-email@domain.com
# Monitoring (Optional)
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318Create apps/web/.env:
# API Configuration
VITE_API_URL=http://localhost:3001/api
VITE_WS_URL=http://localhost:3001
# Features
VITE_ENABLE_PWA=true
VITE_ENABLE_NOTIFICATIONS=true
# Analytics (Optional)
VITE_GA_MEASUREMENT_ID=G-XXXXXXXXXX# ๐ Development
pnpm dev # Start both frontend and backend in watch mode
pnpm dev:web # Start only React development server
pnpm dev:api # Start only Node.js API server
# ๐ Building
pnpm build # Build all packages for production
pnpm build:web # Build React app only
pnpm build:api # Build Node.js API only
# ๐งช Testing & Quality
pnpm test # Run all test suites
pnpm test:unit # Run unit tests only
pnpm test:integration # Run integration tests
pnpm test:e2e # Run end-to-end tests
pnpm test:watch # Run tests in watch mode
pnpm lint # Lint all packages
pnpm lint:fix # Fix linting issues
pnpm type-check # TypeScript type checking
# ๐ณ Docker Operations
pnpm docker:dev # Start development database services
pnpm docker:down # Stop all development services
pnpm docker:logs # View service logs
pnpm docker:clean # Clean up containers and volumes
# ๐ Database Operations
pnpm db:migrate # Run database migrations
pnpm db:seed # Seed database with sample data
pnpm db:reset # Reset database to clean state# Unit Tests - Business logic & utilities
pnpm test:unit
# Integration Tests - API endpoints & database operations
pnpm test:integration
# End-to-End Tests - Complete user workflows
pnpm test:e2e
# Coverage Report
pnpm test:coverage-
Feature Development
git checkout -b feature/awesome-feature pnpm dev # Start development environment # Make your changes... pnpm test # Ensure tests pass pnpm lint # Check code quality
-
Code Quality Checks
pnpm type-check # TypeScript validation pnpm lint:fix # Auto-fix linting issues pnpm test:coverage # Ensure adequate test coverage
-
Commit & Push
git add . git commit -m "feat: add awesome feature" git push origin feature/awesome-feature
POST /api/auth/register # User registration
POST /api/auth/login # User authentication
POST /api/auth/refresh # Refresh JWT token
POST /api/auth/logout # User logoutGET /api/conversations # List user conversations
POST /api/conversations # Create new conversation
GET /api/conversations/:id # Get conversation details
POST /api/conversations/:id/join # Join group conversation
GET /api/messages/:conversationId # Get conversation messages
POST /api/messages # Send new message
PUT /api/messages/:id # Edit message
DELETE /api/messages/:id # Delete messagePOST /api/uploads/presign # Get S3 pre-signed URL
POST /api/uploads/complete # Complete file upload// Client to Server
socket.emit('conversation:join', { conversationId })
socket.emit('message:send', { conversationId, content, type })
socket.emit('typing:start', { conversationId })
socket.emit('typing:stop', { conversationId })
// Server to Client
socket.on('message:received', (message) => {})
socket.on('typing:update', ({ userId, isTyping }) => {})
socket.on('presence:update', ({ userId, status }) => {})For detailed API documentation, see API_REFERENCE.md.
-
Build production images
# Build all services docker-compose -f infra/docker/docker-compose.prod.yml build -
Deploy with Docker Compose
# Start production stack docker-compose -f infra/docker/docker-compose.prod.yml up -d # View logs docker-compose -f infra/docker/docker-compose.prod.yml logs -f
-
Apply Kubernetes manifests
# Create namespace and secrets kubectl apply -f infra/k8s/namespace.yaml kubectl apply -f infra/k8s/secrets.yaml # Deploy applications kubectl apply -f infra/k8s/
-
Monitor deployment
kubectl get pods -n ChatVerse kubectl logs -f deployment/ChatVerse-api -n ChatVerse
cd infra/terraform/aws
terraform init
terraform plan
terraform applyEnsure these are properly configured for production:
NODE_ENV=production
JWT_SECRET=<strong-production-secret>
MONGODB_URI=<production-mongodb-uri>
REDIS_URL=<production-redis-uri>
AWS_S3_BUCKET=<production-s3-bucket>
CORS_ORIGINS=https://yourdomain.com- Application Metrics: Custom Prometheus metrics
- Health Checks: Liveness and readiness probes
- Error Tracking: Comprehensive error logging
- Performance: Response time and throughput monitoring
GET /health/liveness # Application liveness check
GET /health/readiness # Application readiness check
GET /metrics # Prometheus metrics endpointStructured JSON logging with different levels:
- Error: Application errors and exceptions
- Warn: Performance issues and warnings
- Info: General application flow
- Debug: Detailed debugging information
We welcome contributions! Here's how to get started:
- ๐ Bug Reports: Open an issue
- โจ Feature Requests: Request a feature
- ๐ Documentation: Improve docs and guides
- ๐ป Code: Submit pull requests
- Fork the repository and create a feature branch
- Follow coding standards: ESLint + Prettier configuration
- Write tests: Maintain >80% code coverage
- Update documentation: Keep README and docs current
- Submit a pull request: Clear description of changes
# 1. Fork and clone
git clone https://github.com/yourusername/ChatVerse.git
# 2. Create feature branch
git checkout -b feature/your-feature-name
# 3. Make changes and test
pnpm test
pnpm lint
# 4. Commit with conventional commits
git commit -m "feat: add your feature description"
# 5. Push and create PR
git push origin feature/your-feature-name- TypeScript: Strict mode enabled
- Formatting: Prettier with 2-space indentation
- Linting: ESLint with custom rules
- Commits: Conventional Commits
Comprehensive documentation is available in the /docs directory:
| Document | Description |
|---|---|
| ๐ API Reference | Complete API endpoint documentation |
| ๐ Architecture Guide | System design and architecture decisions |
| ๐ Deployment Guide | Production deployment instructions |
| ๐ Security Guide | Security best practices and policies |
| ๐ Runbooks | Operational guides and troubleshooting |
- Voice messages support
- Message search functionality
- Dark/light theme toggle
- Improved mobile experience
- Video calling integration
- Message threading
- Custom emoji reactions
- Message scheduling
- AI-powered features
- Advanced admin dashboard
- Message encryption
- Plugin architecture
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2024 Satvik Praveen
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction...
Special thanks to the amazing open-source community and these fantastic projects:
- Socket.io - Real-time bidirectional event-based communication
- React - A JavaScript library for building user interfaces
- Node.js - JavaScript runtime built on Chrome's V8 engine
- MongoDB - The most popular NoSQL database
- Tailwind CSS - A utility-first CSS framework
- TypeScript - JavaScript with syntax for types
- ๐ Issues: GitHub Issues
- ๐ฌ Discussions: GitHub Discussions
โญ Star this repo if you find it helpful!
Built with โค๏ธ by Satvik Praveen and the ChatVerse community
Empowering real-time communication for the modern world