A multi-user single-room real-time web chat application built with aiohttp and asyncio, featuring real-time communication through WebSocket.
- Python 3.11
- Poetry (if running with plain Python)
- Docker and Docker Compose
- Clone repository
git clone https://github.com/seedspirit/lablup-toy-project.git
- Change into project directory
cd lablup-toy-project
- Run docker-compose command
# Run in single thread mode
docker compose up --build
# Run in multi-process mode (set workers according to your CPU cores)
APP_MODE=multi-process APP_WORKERS=4 docker compose up --build
- You can access app in
localhost
or127.0.0.1
(using 80 port)
Note: Since the application uses session id in cookies for user identification, you can test multi-user chat scenarios by opening Chrome's Incognito window for each additional user.
- Clone repository
git clone https://github.com/seedspirit/lablup-toy-project.git
- Change into project server directory
cd lablup-toy-project/backend
- Download dependencies
poetry install
- Run Redis with Docker
docker run -d --name redis -p 6379:6379 redis
- Run application with python3 & poetry
# Run in single thread mode
poetry run python3 main.py
# or
poetry run python3 main.py --mode thread
# Run in multi-process mode (set workers according to your CPU cores)
poetry run python3 main.py -m multi-process -w 4
- You can access app in
localhost
or127.0.0.1
(using 80 port)
Note: Since the application uses session id in cookies for user identification, you can test multi-user chat scenarios by opening Chrome's Incognito window for each additional user.