A high-performance, Flask-powered communication platform featuring instant messaging, media sharing, and peer-to-peer (P2P) WebRTC calling.
Designed for speed. Built for connectivity. Ready for the cloud.
| Feature | Description |
|---|---|
| β‘ Real-Time Messaging | Instant delivery with an optimized message queue |
| π₯ WebRTC Calling | Seamless P2P audio and video communication |
| πΈ Media Sharing | Built-in support for image uploads and file storage |
| π₯ Presence Tracking | Real-time monitoring of active users with auto-expiry |
| π§Ή Auto-Cleanup | Automatic message rotation to ensure system performance |
| βοΈ Cloud Ready | Fully Dockerized and optimized for platforms like Railway |
| Layer | Technology |
|---|---|
| Backend | Python 3.11 Β· Flask Β· Gunicorn |
| Frontend | HTML5 Β· CSS3 Β· JavaScript (WebRTC API) |
| Concurrency | Threading (auto-cleanup & background tasks) |
| Deployment | Docker Β· Railway |
AyhanX-Chat/
βββ app.py # Main Flask application logic
βββ Dockerfile # Container configuration
βββ requirements.txt # Python dependencies
βββ Procfile # Deployment instructions for Railway
βββ static/
β βββ uploads/ # User-uploaded media
βββ templates/
βββ index.html # Main chat application UI
- Python 3.11+
- Docker (if deploying via container)
# 1. Clone the repository
git clone https://github.com/AyhanMansur/AyhanX-Chat.git
cd AyhanX-Chat
# 2. Install dependencies
pip install -r requirements.txt
# 3. Run the application
python app.py
# 4. Open in your browser
# https://127.0.0.1:5000
β οΈ Note: You must accept the SSL security warning β the app uses a local self-signed certificate for development.
# Build the image
docker build -t ayhanx-chat .
# Run the container
docker run -p 5000:5000 ayhanx-chat| Setting | Value |
|---|---|
| Port | Hardcoded to 5000 |
| Storage | Uploaded files β static/uploads/ |
| Signaling | In-memory message_queue β offers, answers, and ICE candidates are stored temporarily and cleared upon retrieval for low-latency P2P handshakes |
π Security The app uses
ssl_context='adhoc'for local development. When deploying to production (e.g., Railway), the platform provides valid SSL/HTTPS β mandatory for accessing camera/microphone hardware.
π WebRTC Connectivity If testing across different networks (mobile data vs. Wi-Fi), add STUN servers to your
RTCPeerConnectionconfig:const rtcConfig = { iceServers: [{ urls: 'stun:stun1.l.google.com:19302' }] };
πΎ Data Persistence Messages and users are stored in memory. Server restarts or container redeployments will clear chat history and the online user list.