This is a simple example of a multi-user single-room real-time web chat application built with aiohttp and asyncio. It allows multiple users to join a chat room and exchange messages in real-time.
- Real-time communication using WebSocket
- Single chat room for all users
- Python 3.7 or higher
- aiohttp
- asyncio
- redis-py
- docker
- Clone the repository:
git clone https://github.com/kimjinmyeong/webchat-app.git
- Change into the project directory:
cd webchat-app
- Build the Docker image:
docker compose build
- Run the application using Docker Compose:
docker compose up
-
Open your web browser and visit
http://localhost:8080
to access the chat application. -
Enter your username and start chatting!
The project consists of the following files:
server.py
: The main server file that handles HTTP requests, WebSocket connections, and message broadcasting.templates/index.html
: The HTML template for the home page.templates/error.html
: The HTML template for the error page.templates/chat.html
: The HTML template for the chat room.