Skip to content

Real-time WebSocket chat server built with Python, asyncio, and JWT authentication. Supports multiple clients, secure token-based access, message broadcasting, and SQLite persistence. New users receive recent chat history on connect. Lightweight, async, and extensible.

Notifications You must be signed in to change notification settings

Simply-Blessing/Broadcast-Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Broadcast server

This project demonstrates a simple broadcast server that will allow clients to connect to it, send messages that will be broadcasted to all connected clients.


Overview

The system consists of two main components:

  • Server (server.py)

    • Manages WebSocket connections
    • Verifies JWT tokens
    • Stores messages in a database
    • Broadcasts messages to all connected clients
  • Client (client.py)

    • Generates a JWT token
    • Connects to the WebSocket server
    • Sends and receives chat messages asynchronously

Features

  • Real-time chat using WebSockets
  • JWT-based user authentication
  • Persistent message storage using SQLite
  • Broadcast messaging to all connected clients
  • Sends the last 10 stored messages to new clients
  • Async and non-blocking architecture
  • Graceful client disconnect handling

Setup

Clone the repository

git clone https://github.com/Simply-Blessing/Broadcast-Server.git
cd Broadcast-Server

Install dependencies

requirements


Running the Server

  • Start the WebSocket server:
python server.py
  • run the client:
python client.py

Learning

  • This project was created to demonstrate:
    • Secure real-time communication using WebSockets
    • JWT-based authentication
    • Async programming with asyncio
    • Chat systems
  • Builds a foundation for:
    • Chat applications
    • Multiplayer services
    • Real-time dashboards
    • Notification systems

Project inspiration

Broadcast Sever

About

Real-time WebSocket chat server built with Python, asyncio, and JWT authentication. Supports multiple clients, secure token-based access, message broadcasting, and SQLite persistence. New users receive recent chat history on connect. Lightweight, async, and extensible.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors