This is a comprehensive Discord clone built with the MERN stack (MongoDB, Express.js, React, Node.js) featuring real-time messaging, server management, and voice channel support.
- JWT-based authentication
- Google OAuth integration
- Email/password registration and login
- User profiles with avatars
- Online/offline status tracking
- Create and manage Discord-like servers
- Text and voice channels
- Server templates (Gaming, School, Work, Community, etc.)
- Role-based permissions (Owner, Co-owner, Admin, Mod, NETA ji, Member)
- Server icons and descriptions
- Instant messaging with Socket.io
- Message reactions and emoji support
- Message editing and deletion
- Typing indicators
- Message history and pagination
- File upload support (future feature)
- Private conversations between users
- User status indicators
- Voice/video call UI (future implementation)
- Voice channel support
- Push-to-talk functionality
- Voice settings and controls
- Node.js with Express.js framework
- MongoDB with Mongoose ODM
- Socket.io for real-time communication
- JWT for authentication
- Passport.js for Google OAuth
- bcrypt for password hashing
- helmet and cors for security
- rate-limiting for API protection
- React 18 with hooks and functional components
- Redux Toolkit for state management
- React Router for navigation
- styled-components for component styling
- Socket.io Client for real-time features
- axios for API requests
- react-hot-toast for notifications
- react-hook-form for form handling
- react-icons for UI icons
DISCORD_CLONE/
โโโ backend/
โ โโโ controllers/ # API route handlers
โ โโโ db/ # Database connection
โ โโโ models/ # Mongoose schemas
โ โโโ routes/ # Express routes
โ โโโ middleware/ # Custom middleware
โ โโโ utils/ # Utility functions
โ โโโ server.js # Server entry point
โโโ frontend/
โโโ public/ # Static files
โโโ src/
โ โโโ components/ # React components
โ โ โโโ auth/ # Authentication components
โ โ โโโ chat/ # Chat and messaging
โ โ โโโ layout/ # Layout components
โ โ โโโ modals/ # Modal components
โ โโโ store/ # Redux store and slices
โ โโโ services/ # API and socket services
โ โโโ styles/ # Global styles
โ โโโ App.js # Main app component
โโโ package.json
- Node.js (v14 or higher)
- MongoDB (local or MongoDB Atlas)
- npm or yarn package manager
- Navigate to the backend directory:
cd backend- Install dependencies:
npm install- Create a
.envfile with the following variables:
PORT=5000
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret_here
JWT_EXPIRE=7d
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
CLIENT_URL=http://localhost:3000- Start the backend server:
npm run devThe backend server will start on http://localhost:5000
- Navigate to the frontend directory:
cd frontend- Install dependencies:
npm install- Create a
.envfile with:
REACT_APP_API_URL=http://localhost:5000/api
REACT_APP_SOCKET_URL=http://localhost:5000- Start the frontend development server:
npm startThe frontend application will start on http://localhost:3000
npm run dev- Start development server with nodemonnpm start- Start production servernpm test- Run tests (to be implemented)
npm start- Start development servernpm run build- Build for productionnpm test- Run testsnpm run eject- Eject from Create React App
- Registration: Create an account using email/password or Google OAuth
- Login: Sign in to access the main application
- Server Creation: Create a new server using various templates
- Channels: Navigate between text and voice channels
- Messaging: Send messages, add reactions, edit/delete messages
- Direct Messages: Have private conversations with other users
- Voice Channels: Join voice channels (UI ready, WebRTC to be implemented)
- User registers or logs in
- Server generates JWT token
- Token stored in localStorage
- Token sent with API requests via axios interceptors
- Socket.io connection authenticated with token
- Real-time features activated for authenticated users
POST /api/auth/register- User registrationPOST /api/auth/login- User loginGET /api/auth/me- Get current userGET /api/auth/google- Google OAuth
GET /api/servers- Get user serversPOST /api/servers- Create new serverPUT /api/servers/:id- Update serverDELETE /api/servers/:id- Delete server
GET /api/channels/:serverId- Get server channelsPOST /api/channels- Create channelPUT /api/channels/:id- Update channelDELETE /api/channels/:id- Delete channel
GET /api/messages/:channelId- Get channel messagesPOST /api/messages- Send messagePUT /api/messages/:id- Edit messageDELETE /api/messages/:id- Delete message
GET /api/dm/:userId- Get DM conversationPOST /api/dm- Send direct message
- Discord-like dark theme
- Responsive design for mobile and desktop
- Smooth animations and transitions
- Toast notifications for user feedback
- Loading states and error handling
- Typing indicators
- Online status indicators
- Server and user avatars
- Message reactions with emoji
- Channel and server navigation
- Modal dialogs for server creation
- WebRTC integration for voice channels
- Video calling support
- Screen sharing
- Push-to-talk functionality
- File and image sharing
- Message search functionality
- User roles and permissions management
- Server discovery and joining
- Message threads and replies
- Custom emoji support
- Bot integration support
- Mobile app development
- Message pagination and infinite scroll
- Image optimization and CDN integration
- Database indexing optimization
- Redis caching for sessions
- WebSocket clustering for scalability
This is a learning project showcasing full-stack development skills. Contributions are welcome for educational purposes.
This project is for educational and portfolio purposes.
Built with โค๏ธ as a comprehensive MERN stack learning project demonstrating:
- Modern React development with hooks and Redux Toolkit
- Express.js API development with MongoDB
- Real-time communication with Socket.io
- Authentication and authorization
- UI/UX design principles
- Full-stack application architecture