A modern, feature-rich real-time messaging platform built with React, Node.js, Express, and WebSocket technology. MindChat enables seamless communication with advanced authentication, intelligent messaging, and scalable infrastructure.
Intelligent message discovery powered by Vector Embeddings & Pinecone
MindChat's flagship feature is its advanced semantic search capability that goes beyond simple keyword matching. Using cutting-edge AI technology:
- ๐ค Vector-Based Intelligence - Messages are automatically converted into semantic embeddings using transformers
- ๐ Intelligent Retrieval - Find messages by meaning, not just keywords. Search "happy moments" and get all positive conversations
- โก Pinecone Integration - Lightning-fast vector similarity search across millions of messages
- ๐ก Context-Aware Results - Understand the intent behind your search query
- ๐ฏ Smart Recommendations - Get personalized message suggestions based on conversation patterns
- Every message sent is automatically indexed with semantic embeddings
- Search queries are converted to the same vector space
- Pinecone computes similarity scores to find the most relevant messages
- Results are ranked by semantic relevance, not just text matching
- โ Magic Link Authentication - Secure passwordless login via email
- โ Google OAuth Integration - Quick sign-up with Google accounts
- โ JWT-Based Sessions - Secure token management with refresh tokens
- โ Email Verification - Verification tokens for account validation
- โ Rate Limiting - Protection against brute force and abuse
- โ WebSocket Communication - Instant message delivery using Socket.IO
- โ Live Direct Messaging - One-on-one private conversations
- โ Contact Management - Add and manage contacts easily
- โ Message History - Persistent message storage in PostgreSQL
- โ Real-time Status Updates - See when users are online/offline
- โ AI-Powered Semantic Search - โญ CORE FEATURE - Vector-based intelligent search using Pinecone and AI embeddings
- โ Message Indexing - Automatic conversion of messages to semantic embeddings
- โ Meaning-Based Retrieval - Find messages by context and intent, not just keywords
- โ Smart Recommendations - Contextual suggestions based on messaging patterns and conversation semantics
- โ User Search - Find and connect with other users using semantic understanding
- โ Kafka Message Queue - Asynchronous message processing with Apache Kafka
- โ Redis Caching - High-performance caching layer for sessions and data
- โ PostgreSQL Database - Reliable and scalable relational database
- โ Docker Support - Containerized deployment for easy scaling
- โ Prisma ORM - Type-safe database operations
- โ Modern React UI - Built with Vite for fast development
- โ Shadcn/UI Components - Beautiful, accessible UI components
- โ Responsive Design - Works seamlessly on desktop and mobile
- โ Tailwind CSS - Utility-first styling framework
- โ Dark Mode Support - Eye-friendly interface themes
- โ Email Notifications - Send emails via Resend/Nodemailer
- โ Magic Link Emails - Beautiful HTML email templates
- โ Real-time Email Updates - Instant notification delivery
| Technology | Purpose |
|---|---|
| Node.js | Runtime environment |
| Express.js | Web framework |
| TypeScript | Type-safe JavaScript |
| PostgreSQL | Primary database |
| Prisma | ORM & database management |
| Socket.IO | Real-time WebSocket communication |
| Apache Kafka | Message queue & event streaming |
| Redis | Caching & session storage |
| Pinecone | Vector database for semantic search |
| Nodemailer/Resend | Email service |
| JWT | Token-based authentication |
| Technology | Purpose |
|---|---|
| React 18+ | UI framework |
| TypeScript | Type-safe development |
| Vite | Build tool & dev server |
| Tailwind CSS | Styling |
| Shadcn/UI | Component library |
| Socket.IO Client | Real-time communication |
| Axios | HTTP client |
| React Query | Data fetching & caching |
| React Hook Form | Form management |
| Google OAuth | Social authentication |
Before you begin, ensure you have the following installed:
- Node.js (v18+)
- npm or bun (v1.0+)
- PostgreSQL (v14+)
- Redis (v6+)
- Apache Kafka (optional, for message queue features)
- Docker (optional, for containerized setup)
- Git
- Pinecone API Key - For vector search capabilities
- Google OAuth Credentials - For social authentication
- SMTP/Email Service - For sending emails
- JWT Secret Key - For token generation
git clone https://github.com/yourusername/mindchat.git
cd MindChatNavigate to the backend directory:
cd backendnpm install
# or
bun installCreate a .env file in the backend directory:
# Get these from Google Cloud Console
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
# Backend URL
BACKEND_URL=http://localhost:3000
# Database Configuration
DATABASE_URL=postgresql://user:password@localhost:5432/mindchat
# JWT Configuration
JWT_SECRET=your-secret-key-here
# Frontend URL for CORS
FRONTEND_URL=http://localhost:5173
# Node Environment
NODE_ENV=development
# Server Port
PORT=3000
# Create database and run migrations
npm run prisma:migrate
# Seed database (optional)
npm run prisma:seed# Development mode with auto-reload
npm run dev
# or build and start production
npm run build
npm startThe backend server will run on http://localhost:5000
In a separate terminal:
npm run consumerIn a new terminal, navigate to the frontend directory:
cd frontendnpm install
# or
bun installCreate a .env.local file in the frontend directory:
# Google OAuth
VITE_GOOGLE_CLIENT_ID=your_google_client_id
# API Configuration
VITE_BACKEND_URL="http://localhost:3000"npm run devThe frontend application will be available at http://localhost:5173
For a containerized setup using Docker Compose:
# From the project root
docker-compose up -dThis will start:
- PostgreSQL database
- Redis cache
- Backend API server
- Frontend development server
npm run dev # Start development server with hot reload
npm run build # Build TypeScript to JavaScript
npm run start # Start production server
npm run consumer # Start Kafka consumer
npm run prisma:migrate # Run database migrations
npm run prisma:studio # Open Prisma Studio (database GUI)npm run dev # Start development server
npm run build # Build for production
npm run build:dev # Build in development mode
npm run lint # Run ESLint
npm run preview # Preview production build locallyMindChat/
โโโ backend/ # Backend application
โ โโโ controllers/ # Route controllers
โ โโโ lib/ # Utilities & services
โ โ โโโ kafka.ts # Kafka producer
โ โ โโโ kafkaConsumer.ts # Kafka consumer
โ โ โโโ pinecone.ts # Vector search
โ โ โโโ socket.ts # WebSocket setup
โ โ โโโ mailer.ts # Email service
โ โ โโโ prisma.ts # Database client
โ โโโ middleware/ # Express middleware
โ โโโ routes/ # API routes
โ โโโ prisma/ # Database schema
โ โโโ utils/ # Helper functions
โ โโโ consumer.ts # Kafka consumer script
โ โโโ index.ts # Server entry point
| โโโ package.json
โ โโโ docker-compose.yml # Docker configuration
โ
โโโ frontend/ # Frontend application
โ โโโ src/
โ โ โโโ components/ # React components
โ โ โ โโโ auth/ # Auth components
โ โ โ โโโ chat/ # Chat components
โ โ โ โโโ DirectMessage/ # DM components
โ โ โ โโโ ui/ # Shadcn UI components
โ โ โโโ pages/ # Page components
โ โ โโโ hooks/ # Custom React hooks
โ โ โโโ lib/ # Utilities
โ โ โโโ contextAPI/ # Context providers
โ โ โโโ main.tsx # App entry point
โ โโโ public/ # Static assets
โ โโโ tailwind.config.ts # Tailwind configuration
โ โโโ vite.config.ts # Vite configuration
โ โโโ package.json
โ
โโโ README.md # Project documentation
POST /auth/magic-link- Request magic linkPOST /auth/verify-token- Verify magic link tokenPOST /auth/google- Google OAuth authenticationPOST /auth/logout- Logout user
GET /user/profile- Get user profilePUT /user/profile- Update user profileGET /user/search- Search usersGET /user/:id- Get user by ID
GET /contacts- Get user contactsPOST /contacts- Add contactDELETE /contacts/:id- Remove contact
GET /messages/:contactId- Get message historyPOST /messages- Send messageGET /messages/search- Semantic search across messages - Main feature for finding messages by meaning
send_message- Send a new messagetyping- User is typinguser_online- User comes onlineuser_offline- User goes offline
receive_message- New message receiveduser_typing- User typing notificationuser_online- User came onlineuser_offline- User went offline
- Ensure Kafka broker is running on configured host:port
- Check Kafka topic exists:
kafka-topics --list --bootstrap-server localhost:9092
We welcome contributions! Please follow these steps:
This project is licensed under the ISC License - see the LICENSE file for details.
For support, open an issue on GitHub.
- Shadcn/UI - Beautiful component library
- Prisma - Amazing ORM
- Socket.IO - Real-time communication
- Pinecone - Vector search platform
- Redis caching reduces database queries
- Kafka decouples message processing
- Vector embeddings enable semantic search - Core intelligence layer using Pinecone
- WebSocket reduces HTTP overhead
- Prisma query optimization with indexes
Message Input โ @xenova/transformers โ Vector Embedding โ Pinecone Index โ Similarity Search โ Ranked Results
| Component | Technology | Purpose |
|---|---|---|
| Embedding Model | @xenova/transformers | Converts text to semantic vectors |
| Vector DB | Pinecone | Stores and searches embeddings |
| Processing | Kafka | Async message embedding pipeline |
| Caching | Redis | Caches frequently searched embeddings |
- Group chat support
- Voice/Video calling integration
- File sharing and media upload
- Message encryption
- Mobile app (React Native)
- Message reactions and emojis
- Read receipts and typing indicators
- User presence status
- Channel-based communication
Built with โค๏ธ by the MindChat Team