A modern, full-stack messaging application with real-time communication, AI-powered chat assistance, task management, and smart notifications built with React, Node.js, and WebSockets.
- Real-Time Messaging: Instant message delivery with live read receipts and typing indicators
- AI-Powered Chat: AI assistance for writing suggestions, smart replies, message translation, and chat summarization
- Task Management: Integrated task management with subtasks, priorities, tags, and due dates
- Smart Notifications: Web push notifications with optional email alerts
- File & Media Sharing: Send images, documents, and files with instant previews
- User Authentication: Secure JWT-based authentication with OTP verification
- OAuth Integration: Supports login with Google and GitHub
- Privacy Controls: Blocked-user management and private/public chat options
- Group Chats: Create and manage group conversations with admin roles
Create a .env file in the server/ directory with the following variables:
# Database
DATABASE_URL="mysql://user:password@localhost:3306/swifttalk"
# Redis
REDIS_URL="redis://localhost:6379"
# JWT Configuration
JWT_SECRET=your_jwt_secret_key
JWT_REFRESH_SECRET=your_refresh_secret_key
# OAuth — Google
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
GOOGLE_CALLBACK_URL=http://localhost:3001/api/auth/google/callback
# OAuth — GitHub
GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret
GITHUB_CALLBACK_URL=http://localhost:3001/api/auth/github/callback
# Frontend URL (used for OAuth redirects)
FRONTEND_URL=http://localhost:3000
ALLOWED_ORIGINS=http://localhost:3000
# Web Push Notification (VAPID Keys)
VAPID_PUBLIC_KEY=your_vapid_public_key
VAPID_PRIVATE_KEY=your_vapid_private_key
VAPID_EMAIL=mailto:your_email@example.com
# AI Integration
GEMINI_API_KEY=your_gemini_api_key
# Email / OTP
EMAIL_USER=your_email@example.com
EMAIL_PASS=your_email_password- Docker (v20.10+)
- Docker Compose (v2.0+)
- Modern web browser with JavaScript enabled
cd SwitftTalkCreate the .env file in the root directory as described in Environment Configuration.
The .env file is automatically loaded by Docker Compose.
# This starts all services
docker-compose up -d# Start only the backend server
docker-compose up -d mysql redis server# Start only the frontend client
docker-compose up -d clientThis starts the following services:
| Service | Port | Description |
|---|---|---|
| MySQL Database | 3306 | Primary database |
| Redis Cache | 6379 | Session and cache store |
| Node.js Server | 3001 | REST API & WebSocket server |
| React Client | 3000 | Web application |
- Frontend: http://localhost:3000
- API Server: http://localhost:3001
# Stop all services (keeps data volumes)
docker-compose down
# Stop and remove all data (hard reset)
docker-compose down -v# Create a new migration
docker exec switfttalk-server-1 npx prisma migrate dev --name your_migration_name
# Open Prisma Studio (GUI for database)
docker exec switfttalk-server-1 npx prisma studio# Test frontend
curl http://localhost:3000
- Node.js (v18+)
- MySQL (v8.0+) — running locally or remotely
- Redis (v6.2+) — running locally or remotely
- npm or yarn
cd SwitftTalkCreate the .env file in the root directory as described in Environment Configuration.
Additionally, configure database and Redis connections in server/.env:
# Database
DATABASE_URL="mysql://root:your_password@localhost:3306/swifttalk"
# Redis
REDIS_URL="redis://localhost:6379"# Install backend dependencies
cd server
npm install
# Install frontend dependencies
cd ../client
npm installcd server
# Run migrations to create schema
npx prisma migrate dev
# (Optional) Seed initial data
npx prisma db seedOpen two terminal windows:
# Terminal 1 — Start backend server (from /server)
cd server
npm run dev
# Terminal 2 — Start frontend (from /client)
cd client
npm start- Frontend: http://localhost:3000
- API Server: http://localhost:3001
- Health Check: http://localhost:3001/health
# Create a new migration
cd server
npx prisma migrate dev --name your_migration_name
# Open Prisma Studio (GUI for database)
npx prisma studioPOST /api/auth/register- Register new userPOST /api/auth/verify-registration-otp- Verify OTP to complete registrationPOST /api/auth/resend-registration-otp- Resend registration OTPPOST /api/auth/cancel-registration- Cancel pending registrationPOST /api/auth/login- Login user (initiates OTP flow)POST /api/auth/verify-otp- Verify login OTPPOST /api/auth/resend-otp- Resend login OTPPOST /api/auth/logout- Logout userPOST /api/auth/refresh-token- Refresh access tokenGET /api/auth/me- Get current authenticated userPOST /api/auth/request-password-reset- Request password reset emailPOST /api/auth/reset-password- Reset password with tokenGET /api/auth/google- Initiate Google OAuth loginGET /api/auth/google/callback- Google OAuth callbackGET /api/auth/github- Initiate GitHub OAuth loginGET /api/auth/github/callback- GitHub OAuth callback
GET /api/users/profile- Get current user profilePUT /api/users/profile- Update user profileGET /api/users/:id- Get user by IDPOST /api/users/block/:id- Block a user
GET /api/chats- List all chatsPOST /api/chats- Create new chatGET /api/chats/:id- Get chat detailsDELETE /api/chats/:id- Delete chat
GET /api/messages/:chatId- Get chat messagesPOST /api/messages- Send messageDELETE /api/messages/:id- Delete message
GET /api/tasks- List tasksPOST /api/tasks- Create taskPUT /api/tasks/:id- Update taskDELETE /api/tasks/:id- Delete task
POST /api/upload- Upload a file (image, document, etc.)
GET /api/notifications- Get notificationsPOST /api/notifications/subscribe- Subscribe to push notificationsPOST /api/notifications/send- Send notification
POST /api/ai/smart-replies- Get AI generated smart repliesPOST /api/ai/translate- Translate a message to a target languagePOST /api/ai/summarize- Summarize the current chatPOST /api/ai/sessions- Create new AI chat sessionGET /api/ai/sessions- Get all AI sessions for current userGET /api/ai/sessions/:id- Get AI session by IDDELETE /api/ai/sessions/:id- Delete AI session by ID
Real-time communication uses Socket.IO:
// Client connects
io.on('connect', () => { /* handle connection */ })
// Listen for new messages
socket.on('message:new', (data) => { /* handle new message */ })
// Listen for typing indicators
socket.on('user:typing', (data) => { /* handle typing */ })
// Listen for read receipts
socket.on('message:read', (data) => { /* handle read */ })
// Listen for online status
socket.on('user:online', (data) => { /* handle online status */ })- React 19 - UI framework
- React Router 7 - Client-side routing
- Socket.IO Client - Real-time communication
- Axios - HTTP client
- React Helmet - Document head management
- Node.js 18 - Runtime
- Express.js - Web framework
- Prisma - Database ORM
- Socket.IO - WebSocket library
- Passport.js - OAuth authentication (Google, GitHub strategies)
- JWT - Authentication tokens
- Redis - Caching & session management
- Langchain - AI pipeline
- Gemini API - AI integration (smart replies, translation, summarization)
- Nodemailer - Email delivery for OTP & notifications
- node-cron - Scheduled background jobs
- MySQL 8.0 - Primary database
- Redis 6.2 - Cache & session store
- Nginx - Reverse proxy & static file server
- Docker - Containerization
- Docker Compose - Service orchestration
- GitHub Actions - CI/CD pipelines
- ✅ JWT-based authentication with refresh tokens
- ✅ OTP email verification for login and registration
- ✅ OAuth 2.0 via Google and GitHub (Passport.js)
- ✅ Password hashing with bcrypt
- ✅ CORS protection with allowlist
- ✅ Rate limiting on API endpoints
- ✅ User blocking/privacy controls
- ✅ Secure WebSocket connections
- ✅ Environment variable isolation
See LICENSE file for details.
Created by Rushikesh
Last Updated: June 16, 2026
