An open API service indexing awesome lists of open source software.

https://github.com/mattmajestic/websockets-fastapi

A minimal example of Websockets using FastAPI & HTML Templates
https://github.com/mattmajestic/websockets-fastapi

fastapi websocket

Last synced: about 1 year ago
JSON representation

A minimal example of Websockets using FastAPI & HTML Templates

Awesome Lists containing this project

README

          

# 📝 FastAPI WebSocket Example

A simple FastAPI application demonstrating WebSocket functionality with a clean and stylish UI using Bulma CSS framework.

## 📄 Description

This project sets up a simple WebSocket server using FastAPI. The client-side interface, styled with Bulma CSS, allows you to connect to the WebSocket server and send messages. Messages sent to the server are echoed back and displayed on the webpage.

## 📂 Files

- **main.py:** FastAPI application setup.
- **requirements.txt:** Python dependencies.
- **docker-compose.yml:** Docker Compose configuration.
- **Dockerfile:** Dockerfile for building the container.
- **templates/index.html:** HTML template for the client interface.
- **static/styles.css:** CSS styles for the client interface.

## 🖥️ Usage

1. **Connect to the WebSocket server:** Click the "Connect" button.
2. **Send a message:** Type a message in the input field and click the "Send Message" button.