A scalable, full-stack live chatting application built with FastAPI, WebSockets, and MongoDB. The platform features real-time messaging, user authentication, typing indicators, and online user status tracking.
- ⚡ Real-Time Messaging: Instant bidirectional communication powered by WebSockets (
websocket.py). - 🔐 Authentication System: Secure user registration and login workflows (
auth.py). - 🟢 Online User Tracking: Live updates showing active/online users in real time.
- ✍️ Typing Indicators: Dynamic feedback when another user is actively typing.
- 🗄️ Persistent Storage: Message history and user profiles stored reliably in MongoDB (
database.py,models.py).
- Backend: Python, FastAPI, WebSockets
- Database: MongoDB
- Frontend: HTML5, JavaScript (ES6+ WebSockets API), CSS
- Data Validation & ORM: Pydantic
Chat-System/
├── __init__.py # Package initialization
├── auth.py # Authentication endpoints & password hashing
├── database.py # MongoDB connection setup
├── index.html # Frontend chat interface layout
├── main.py # FastAPI application entry point
├── models.py # Pydantic data schemas and database models
├── routes.py # API route definitions
├── script.js # Client-side WebSocket connection & UI handlers
└── websocket.py # WebSocket connection manager & messaging logic