Amir’s new project: free websites for you or your AI agent, in 30 seconds.free websites · Try it

Backend · 2026 · Open source

Real-Time Chat Application

Rooms, presence, and moderation over WebSockets

A production-minded web chat built with FastAPI and SQLite (WAL): real-time messaging over WebSockets, presence, multi-device sessions, file sharing, and moderation, packaged with Docker and end-to-end tests.

  • WebSockets
  • Multi-device sessions
  • pytest + Playwright
Real-Time Chat Application: Rooms, presence, and moderation over WebSockets

Architecture

Key features

Real-time messaging

WebSocket updates for rooms and private messages.

Presence

Multi-device sessions, multi-tab presence, AFK detection, and unread indicators.

Moderation

Roles, bans, and room administration.

Secure sessions

JWT-based authentication and session management.

File sharing

File and image uploads with access-control rules.

Tested

pytest and Playwright end-to-end tests, Docker-ready.

The problem

Teams need a small, reliable chat service with secure sessions and moderation that is easy to deploy and test.

What I built

  • A FastAPI server with async endpoints and WebSockets for real-time updates.
  • Authentication, multi-room chat, private messaging, and session management.
  • Moderation with bans, roles, and room administration.
  • AFK detection, multi-tab presence logic, unread indicators, and persistent chat history.
  • A Docker Compose setup for a reproducible local environment.

Results

  • A small, deployable chat service for demos, internal tooling, or as a base for production features.
  • Container-ready and able to scale behind a WebSocket-aware proxy.

Tech stack

  • Python
  • FastAPI
  • WebSockets
  • SQLite (WAL)
  • aiosqlite
  • JWT
  • JavaScript
  • Docker
  • pytest
  • Playwright

Screens

Run it locally

  1. 1

    Clone the repository

    git clone https://github.com/mrprogrammingx/classic-web-based-online-chat-application.git
  2. 2

    Install the dependencies and set the environment variables

  3. 3

    Start the server with uvicorn and open the app in a browser

More projects

All projects →