A modern, full-stack real-time chat application built with the MERN stack, featuring instant messaging and comprehensive user management.
π Live Demo
- Real-time Messaging: Instant message delivery powered by Socket.io
- User Authentication: Secure JWT-based authentication and authorization
- Friend System: Add, manage, and chat with friends
- Online Status: Real-time user presence indicators
- Image Sharing: Upload and share images in conversations
- Notifications System: Real-time friend request notifications with sound alerts
- Message Status: Read receipts and delivery status indicators
- Responsive Design: Mobile-first design with TailwindCSS and DaisyUI
- Modern UI: Clean, intuitive interface with emoji support
- Global State Management: Efficient state handling with Zustand
- React 18 - Modern React with hooks
- Vite - Fast build tool and development server
- TailwindCSS - Utility-first CSS framework
- DaisyUI - Component library for TailwindCSS
- Socket.io Client - Real-time communication
- Zustand - Lightweight state management
- React Router - Client-side routing
- Lucide React - Beautiful icons
- Node.js - JavaScript runtime
- Express.js - Web application framework
- MongoDB - NoSQL database
- Mongoose - MongoDB object modeling
- Socket.io - Real-time bidirectional communication
- JWT - JSON Web Tokens for authentication
- Cloudinary - Image upload and management
- bcryptjs - Password hashing
Before running this application, make sure you have the following installed:
- Node.js (v16 or higher)
- npm or yarn
- MongoDB (local installation or MongoDB Atlas)
- Cloudinary Account (for image uploads)
git clone https://github.com/your-username/linkclub.git
cd linkclub# Install backend dependencies
cd backend
npm install
# Install frontend dependencies
cd ../frontend
npm installCreate .env files in both backend and frontend directories:
MONGODB_URI=mongodb://localhost:27017/linkclub
# or for MongoDB Atlas:
PORT=5001
JWT_SECRET=your-super-secret-jwt-key
CLOUDINARY_CLOUD_NAME=your-cloudinary-cloud-name
CLOUDINARY_API_KEY=your-cloudinary-api-key
CLOUDINARY_API_SECRET=your-cloudinary-api-secret
NODE_ENV=development
FRONTEND_URL=http://localhost:5173VITE_BACKEND_URL=http://localhost:5001Ensure MongoDB is running on your system or configure MongoDB Atlas connection in your backend .env file.
- Start the Backend Server
cd backend
npm run dev- Start the Frontend Development Server
cd frontend
npm run devThe application will be available at:
- Frontend:
http://localhost:5173 - Backend API:
http://localhost:5001
- Build the Frontend
cd frontend
npm run build- Start the Production Server
cd backend
npm startlinkclub/
βββ backend/
β βββ src/
β β βββ controllers/ # Route controllers
β β βββ middleware/ # Custom middleware
β β βββ models/ # MongoDB models
β β βββ routes/ # API routes
β β βββ lib/ # Utility functions
β β βββ index.js # Server entry point
β βββ package.json
β βββ .env
βββ frontend/
β βββ src/
β β βββ components/ # React components
β β βββ pages/ # Page components
β β βββ store/ # Zustand stores
β β βββ lib/ # Utility functions
β β βββ App.jsx # Main App component
β βββ public/
β βββ package.json
β βββ .env
βββ README.md
βββ package.json
POST /api/auth/signup- User registrationPOST /api/auth/login- User loginPOST /api/auth/logout- User logoutGET /api/auth/check- Check authentication status
GET /api/messages/:userId- Get messages with a userPOST /api/messages/send/:userId- Send a message
GET /api/friends- Get user's friends listPOST /api/friends/add- Send friend requestPOST /api/friends/accept/:requestId- Accept friend requestDELETE /api/friends/remove/:friendId- Remove friend
- Connect your repository to Railway
- Set environment variables in Railway dashboard
- Deploy automatically on push to main branch
- Build the frontend:
npm run build - Deploy the
distfolder to Netlify - Configure environment variables in Netlify dashboard
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Socket.io for real-time communication
- MongoDB for database solutions
- Cloudinary for image management
- TailwindCSS and DaisyUI for beautiful UI components
If you have any questions or need help, please open an issue or contact the development team.
Developed by Phyo Min Thein
