A modern, modular, and customizable web-based chat platform that empowers users to host their own servers and control their communication environment fully.
Cipher is a next-generation open-source chat platform designed from the ground up to provide full user control, customization, and extensibility. Unlike traditional chat services, Cipher allows anyone to host their own chat server, customize the client UI, and manage user accounts and friend lists with complete flexibility.
The platform focuses on:
- Modularity: Both server and client are designed to be extensible and customizable.
- Privacy & Control: Users control their data and how it flows.
- Cross-Platform: Primarily web-based with plans for multiple client interfaces.
- Innovative Features: P2P direct messaging, advanced theming, and lightweight group chat hosting.
Cipher is actively under development. Below is a summary of what is currently implemented and stable:
- User Authentication: Session-based login system with whitelist-style signup approval.
- Persistent Storage: User data and friends list stored in SQLite.
- WebSocket Communication: Real-time messaging support with session authentication.
- Rooms & Members API: Endpoints for managing chat rooms and member lists.
- Rate Limiting & Security: Basic protections against abuse (login/signup throttling).
- Modular UI: React-style inspired, currently vanilla HTML/CSS/JS with plans for React port.
- Chat Interface: Glassmorphism UI with frosted glass effects, dark themes, and accent colors.
- Friend & Room Lists: Sidebar displays for members and rooms (default rooms created automatically).
- Direct Messaging: P2P-enabled DMs with fallback mechanisms.
- User Profiles: Local profile storage, customizable nicknames, and avatars (Names only at the moment).
- Public-facing pages for login and server settings with a cozy, informal design matching the client theme.
Cipher is designed with extensibility and innovation in mind. Planned future work includes:
- Full React Client: Transition the client UI to React for better state management and modularity.
- Public API: Expose a comprehensive API for third-party client and tool development.
- Micro-host P2P Server: Lightweight private group chat hosted by individual users.
- Enhanced Security: Implement OAuth options, 2FA, and robust spam/bot protection.
- Custom Theming & Plugins: User-friendly theme and plugin system for personalized experiences.
- Offline Messaging & Sync: Support for message caching, offline reading, and multi-device sync.
- Mobile Support: Responsive design and dedicated mobile clients.
- Notification System: Desktop and in-browser notifications for mentions, messages, and events.
- Modular, open-source architecture
- Server-hosted chat rooms and private messaging
- Friend requests with manual approval
- Customizable profiles and themes
- Real-time WebSocket chat communication
- Whitelist-based user registration for controlled access
- Lightweight P2P direct messaging
- Glassmorphism UI with modern styling
- Node.js (v16 or later recommended)
- npm or yarn package manager
- Git (optional, for cloning repo)
-
Clone the repository:
git clone https://github.com/yourusername/cipher.git cd cipher/cipher-backend
-
Install dependencies:
npm install
Start the backend server:
node server.js
or
npm start
By default, the server listens on port 8000.
Open your browser and navigate to:
http://<your-ip>:8000/
Replace <your-ip>
with your actual local network IP (e.g., 192.168.1.10). Your friends can access your server from other devices on the same network.
- Update CORS in
server.js
:
app.use(cors({
origin: true,
credentials: true
}));
- Update listener to accept all interfaces:
const HOST = '0.0.0.0';
server.listen(PORT, HOST, () => {
console.log(`\u{1F680} Cipher server running on http://${HOST}:${PORT}`);
});
-
Make sure your firewall allows TCP traffic on port 8000.
-
Access it via LAN IP:
http://192.168.x.x:8000
- Optional: Use a domain with port forwarding and HTTPS for external access.
Currently, user accounts must be manually whitelisted by the server admin. Default chat rooms "Chat" are created automatically. The client UI supports messaging, and room switching.
- User signs up with Username and Password (Password only known to them)
- Admin (default Username: admin password: admin123) approves them into the server, or bans.
- User can now say "HI" to everyone!!!
Default:
Username: admin ; Password: admin123
Change Username and Password:
- Start server
- Login as admin
- Delete admin
- Turn off server
- Edit syncAdminUser.js (cipher-backend/syncAdminUser.js)
- Change username and password (lines 6 & 7)
- Save and run server again
Control:
- Admins can see pending users, un-approve, ban, or delete users.
- Admins can see users, unapprove (manual timeout), ban, or delete users (including other admins).
- Admins can create and delete rooms/channels
Cipher consists of three main components:
- Server: Handles authentication, message routing, session management, and persistent data storage.
- Server Web Page: Public-facing interface for login, server info, and administrative settings.
- Client Web Page: The chat interface loaded by users; handles messaging, friends, and UI interaction.
The system is designed to support multiple client types in the future, including native apps and terminal clients.
Contributions are welcome! To contribute:
- Fork the repository
- Create a feature branch (
git checkout -b feature/my-feature
) - Commit your changes (
git commit -m 'Add some feature'
) - Push to the branch (
git push origin feature/my-feature
) - Open a Pull Request describing your changes
This project is licensed under the MIT License.
Cipher is a community-driven project. If you want to help shape the future of privacy-respecting, user-centric communication platforms, join the conversation or submit your pull requests!