A real-time encrypted messaging application with WebSocket support and username-based routing.
- 🔐 End-to-End Encryption: Messages are encrypted using AES-256 encryption
- 🌐 Real-time Messaging: WebSocket-based real-time communication
- 👤 Username Management: Unique usernames with duplicate prevention
- 💾 Local Storage: All chats and messages are stored locally in the browser
- 🎨 Modern UI: Beautiful, responsive interface built with React and Tailwind CSS
- 🔑 Secret Key Management: Each chat has its own encryption key
- 👥 Online Users: See who's currently online and start chats with them
- Frontend: React + TypeScript + Vite + Tailwind CSS
- Backend: FastAPI + WebSockets + Python
- Encryption: AES-256 encryption for message security
- Storage: Browser localStorage for chat persistence
- Node.js (v16 or higher)
- Python (v3.8 or higher)
- npm or yarn
-
Navigate to the server directory:
cd server
-
Install Python dependencies:
pip install -r requirements.txt
-
Start the backend server:
python app.py --debug
The server will start on
http://192.168.12.7:8000
with debug mode enabled.
-
Navigate to the frontend directory:
cd frontend
-
Install dependencies:
npm install
-
Start the development server:
npm run dev
The frontend will start on
http://192.168.12.7:5173
.
- Connect to Server: When you first access the application, you'll be prompted to enter a username
- Username Validation: Usernames must be 3-20 characters and contain only letters, numbers, and underscores
- Start Chatting: Once connected, you can see online users and start new encrypted conversations
- Message Encryption: Each chat uses a unique secret key for encryption
- Real-time Updates: Messages are delivered instantly via WebSocket connections
GET /
- Server statusGET /users
- Get list of online usersPOST /check-username
- Check if username is available
WS /ws/{username}
- WebSocket connection for real-time messaging
- User enters username and connects via WebSocket
- Server validates username uniqueness
- User can see online users and start chats
- Messages are encrypted locally and sent via WebSocket
- Server routes messages to intended recipients
- Recipients decrypt messages using shared secret keys
- Username Uniqueness: No duplicate usernames allowed
- Message Encryption: AES-256 encryption for all messages
- Local Storage: Sensitive data stays in the browser
- Secret Key Management: Each chat has its own encryption key
- Run with debug mode:
python app.py --debug
- Access API docs:
http://192.168.12.7:8000/docs
- WebSocket testing: Use browser dev tools or WebSocket clients
- Hot reload enabled with Vite
- TypeScript for type safety
- Tailwind CSS for styling
- Component-based architecture
WhisperLink/
├── frontend/ # React frontend
│ ├── src/
│ │ ├── components/ # UI components
│ │ ├── hooks/ # Custom React hooks
│ │ ├── types/ # TypeScript type definitions
│ │ └── utils/ # Utility functions
│ └── package.json
├── server/ # FastAPI backend
│ ├── app.py # Main server file
│ └── requirements.txt # Python dependencies
└── README.md
- Username Already Taken: Try a different username
- Connection Lost: Check if the backend server is running
- Messages Not Sending: Verify WebSocket connection status
- Encryption Errors: Ensure both users have the same secret key
Run the backend with debug mode to see detailed logs:
python app.py --debug
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is open source and available under the MIT License.