NeuraTalk is a modern real-time chat application with AI-powered conversations, built with React, Node.js, and Socket.io.
- Real-time Messaging: Instant messaging with WebSocket connections
- Group Chat: Create groups and add multiple users for collaborative conversations
- AI-Powered Chat: Integrated with Google Gemini AI for intelligent conversations
- User Authentication: Secure JWT-based authentication system
- File Sharing: Support for image uploads with Cloudinary integration
- Modern UI: Beautiful, responsive interface built with Tailwind CSS and Radix UI
- Dark/Light Theme: Theme switching with next-themes
- Message Reactions: Interactive message replies and reactions
- Online Status: Real-time user presence indicators
- Typing Indicators: See when others are typing
- Message Status: Delivery and read status indicators
- React 19 - Modern React with hooks and concurrent features
- TypeScript - Type-safe JavaScript
- Vite - Fast build tool and dev server
- Tailwind CSS - Utility-first CSS framework
- Zustand - Lightweight state management
- React Router - Client-side routing
- Socket.io Client - Real-time communication
- React Hook Form - Form handling with validation
- Radix UI - Accessible UI components
- Lucide React - Beautiful icons
- Node.js - JavaScript runtime
- Express.js - Web framework
- TypeScript - Type-safe backend
- MongoDB - NoSQL database
- Mongoose - MongoDB object modeling
- Socket.io - Real-time bidirectional communication
- JWT - JSON Web Tokens for authentication
- bcrypt - Password hashing
- Google AI SDK - AI integration
- Cloudinary - Image hosting and optimization
Before running this application, make sure you have:
- Node.js (v18 or higher)
- MongoDB (local or cloud instance)
- npm or yarn package manager
- Google AI API Key (for AI features)
- Cloudinary Account (for image uploads)
-
Clone the repository
git clone https://github.com/den319/neuratalk.git cd neuratalk -
Install backend dependencies
cd backend npm install -
Install frontend dependencies
cd ../frontend npm install -
Environment Setup
Backend (.env)
PORT=5000 NODE_ENV=development MONGO_URI=mongodb_uri JWT_SECRET=your_jwt_secret_here FRONTEND_ORIGIN=http://localhost:5173 GOOGLE_GENERATIVE_AI_API_KEY=your_google_ai_api_key CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name CLOUDINARY_API_KEY=your_cloudinary_api_key CLOUDINARY_API_SECRET=your_cloudinary_api_secret
Frontend (.env)
VITE_API_URL=http://localhost:5000
-
Start the backend server
cd backend npm run dev -
Start the frontend development server
cd frontend npm run dev -
Access the application
- Frontend: http://localhost:5173
- Backend: http://localhost:5000
-
Build the frontend
cd frontend npm run build -
Build the backend
cd backend npm run build -
Start the production server
cd backend npm start
Chat with AI |
Different Chats of User |
Sign-in Page |
neuratalk/
βββ backend/
β βββ src/
β β βββ config/ # Configuration files
β β βββ controllers/ # Route controllers
β β βββ lib/ # Socket.io setup
β β βββ middlewares/ # Express middlewares
β β βββ models/ # MongoDB models
β β βββ routes/ # API routes
β β βββ services/ # Business logic
β β βββ utils/ # Utility functions
β β βββ validators/ # Input validation
β β βββ index.ts # Server entry point
β βββ dist/ # Compiled JavaScript
β βββ package.json
βββ frontend/
β βββ src/
β β βββ components/ # React components
β β βββ hooks/ # Custom React hooks
β β βββ layouts/ # Layout components
β β βββ lib/ # Utility functions
β β βββ pages/ # Page components
β β βββ routes/ # Routing configuration
β β βββ types/ # TypeScript types
β β βββ App.tsx # Main app component
β βββ public/ # Static assets
β βββ dist/ # Built files
β βββ package.json
βββ README.md
POST /api/auth/register- User registrationPOST /api/auth/login- User loginGET /api/auth/me- Get current user
GET /api/chat/all- Get all user chatsPOST /api/chat/create- Create new chatGET /api/chat/:id- Get chat details
POST /api/chat/message/send- Send message
GET /api/user/all- Get all users
chat:join- Join a chat roomchat:leave- Leave a chat roomtyping- Send typing indicatorremove:typing-user- Remove typing indicator
message:new- New message in chatchat:update- Chat information updatedchat:ai- AI response (streaming or complete)online:users- List of online userstyping:users- Users currently typing
NeuraTalk integrates with Google Gemini AI to provide intelligent chat responses. The AI features include:
- Context-aware responses based on chat history
- Streaming responses for real-time text generation
- Image analysis capabilities
- Multi-modal conversations (text + images)
- Instant message delivery with WebSocket
- Message read receipts and status indicators
- Typing indicators
- Online presence status
- Chat with AI assistant powered by Google Gemini
- Streaming responses for smooth UX
- Context preservation across messages
- Image understanding capabilities
- Modern, responsive design
- Dark and light theme support
- Mobile-friendly interface
- Intuitive navigation
- JWT-based authentication
- Password hashing with bcrypt
- CORS protection
- Helmet security headers
Backend:
NODE_ENV=production
PORT=5000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_secure_jwt_secret
FRONTEND_ORIGIN=https://yourdomain.com
GOOGLE_GENERATIVE_AI_API_KEY=your_google_ai_key
CLOUDINARY_CLOUD_NAME=your_cloudinary_name
CLOUDINARY_API_KEY=your_cloudinary_key
CLOUDINARY_API_SECRET=your_cloudinary_secretFrontend:
VITE_API_URL=https://your-backend-url.com# Install dependencies and build
npm install --include=dev --prefix frontend && npm run build --prefix frontend
npm install --include=dev --prefix backend && npm run build --prefix backend
# Start production server
npm start --prefix backend# Run frontend tests
cd frontend
npm run lint
# Run backend type checking
cd backend
npm run build- 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
This project is licensed under the ISC License - see the LICENSE file for details.
- Google AI for the Gemini AI integration
- Socket.io for real-time communication
- Tailwind CSS for styling
- Radix UI for accessible components


