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
- Host: GitHub
- URL: https://github.com/mattmajestic/websockets-fastapi
- Owner: mattmajestic
- Created: 2024-08-02T12:44:44.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-02T12:55:36.000Z (almost 2 years ago)
- Last Synced: 2025-03-28T13:02:21.057Z (about 1 year ago)
- Topics: fastapi, websocket
- Language: HTML
- Homepage: https://mattmajestic.github.io/websockets-fastapi/
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
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.