A self-hosted, real-time chat and voice platform. Think Discord, but simpler and completely yours.
Cordit is a lightweight communication platform with text chat, voice channels, and a unique browser-based music sharing feature. Built with modern web technologies, it's designed to be easy to deploy and simple to use.
- Instant messaging with typing indicators
- Multiple rooms/channels
- System notifications
- Message history
- High-quality voice chat powered by LiveKit
- Individual volume controls per participant
- Visual speaking indicators
- Low latency WebRTC connections
- Share audio from any browser tab (YouTube, Spotify, etc.)
- No server-side processing - streams directly from your browser
- Desktop only (Chrome/Firefox)
- Works with any audio source
- JWT-based authentication
- Admin and user roles
- Invite code system
- Rate limiting protection
- Works on desktop and mobile
- Brutal/neobrutalism UI design
- Dark theme optimized
- Real-time messaging with Socket.io
- Multiple chat rooms
- Typing indicators
- Message history
- Voice channels with LiveKit
- Individual volume controls
- Speaking indicators
- Music sharing from browser tabs
- JWT authentication
- Admin panel
- Invite code system
- Rate limiting
- Responsive design
- Docker deployment
- Create new channels (text & voice)
- File & image uploads
- Emoji reactions
- Edit/delete messages
- @mention system
- Direct messages (DM)
- User avatars & status
- Push notifications
- Screen sharing
- Role/permission system
# Clone the repository
git clone https://github.com/yourusername/cordit.git
cd cordit
# Copy environment template
cp .env.sample .env
# Edit .env with your settings (see Configuration section)
# Start services
docker compose up -dAccess at: http://localhost:3000
Prerequisites:
- Node.js 20+
- MongoDB (running locally or Docker)
- LiveKit Server (optional, for voice features)
- Yarn or npm
Backend:
cd backend
cp .env.sample .env
yarn install
yarn devFrontend:
cd frontend
yarn install
yarn devMongoDB (if using Docker):
docker run -d -p 27017:27017 --name cordit-mongo mongo:latestLiveKit (if using Docker):
docker run -d -p 7880:7880 \
-e LIVEKIT_KEYS="devkey: secret" \
--name cordit-livekit \
livekit/livekit-server:latest --devCreate a .env file in the project root:
# Required
FRONTEND_URL=http://localhost:3000
BACKEND_URL=http://localhost:3000/api
LIVEKIT_URL=ws://localhost:7880
# Security - Change these!
ACCESS_TOKEN_SECRET=your-random-secret-key-at-least-32-chars
ADMIN_USERNAME=admin
ADMIN_PASSWORD=changeme
# LiveKit (for voice chat)
LIVEKIT_API_KEY=devkey
LIVEKIT_API_SECRET=secretImportant:
ACCESS_TOKEN_SECRETmust be at least 32 characters- Change
ADMIN_PASSWORDin production - For production, use HTTPS URLs and WSS for LiveKit
cordit/
βββ backend/ # Express.js API
β βββ src/
β β βββ models/ # MongoDB schemas
β β βββ routes/ # API endpoints
β β βββ middlewares/ # Auth & validation
β β βββ utils/ # Socket.io & helpers
β β βββ app.ts # App entry point
β βββ Dockerfile
β
βββ frontend/ # Next.js app
β βββ app/ # Pages (App Router)
β βββ components/ # React components
β β βββ VoiceChat.tsx # Voice channel UI
β β βββ MusicShare.tsx # Music sharing feature
β βββ lib/ # API client & state
β βββ Dockerfile
β
βββ docker-compose.yml # Container orchestration
βββ .env.sample # Environment template
Frontend:
- Next.js 15 (React 19)
- LiveKit Client SDK (voice/audio)
- Socket.io Client (real-time chat)
- Zustand (state management)
Backend:
- Express.js (Node.js)
- MongoDB + Mongoose
- Socket.io (WebSocket)
- LiveKit Server SDK
- JWT authentication
Infrastructure:
- Docker & Docker Compose
- LiveKit Server (WebRTC SFU)
- MongoDB
cd backend
yarn dev # Start with nodemon
yarn build # Compile TypeScript
yarn start # Run production buildcd frontend
yarn dev # Start Next.js dev server
yarn build # Build for production
yarn start # Run production buildOn first run, the backend automatically:
- Creates an admin user (from env variables)
- Creates a default "General" room
Backend reads from .env in project root. Frontend needs:
NEXT_PUBLIC_BACKEND_URL(set via docker-compose build args)NEXT_PUBLIC_LIVEKIT_URL(set via docker-compose build args)
- Import
docker-compose.yml - Set environment variables
- Configure domains for each service:
frontendβ your-domain.combackendβ api.your-domain.comlivekitβ livekit.your-domain.com
Important for LiveKit:
- Enable WebSocket support in reverse proxy
- Add
UpgradeandConnectionheaders - If using Cloudflare: set to "DNS only" (not proxied)
We welcome contributions! Here's how:
- Fork the repository
- Create a branch:
git checkout -b feature/your-feature - Make your changes and test locally
- Commit:
git commit -m 'Add some feature' - Push:
git push origin feature/your-feature - Open a Pull Request
- Follow existing code style
- Write clear commit messages
- Test your changes before submitting
- Update documentation if needed
Open an issue with:
- Description of the bug
- Steps to reproduce
- Expected vs actual behavior
- Screenshots (if applicable)
MIT License - see LICENSE file for details.
Built with: