Skip to content
/ WebServiceTemplate Public template

Simple webservice based on aiohttp server and client

License

Notifications You must be signed in to change notification settings

Olegt0rr/WebServiceTemplate

Repository files navigation

Web Service Template

Python Code style: black Code linter: ruff Checked with mypy

Simple aiohttp-based webservice template. Extendable. Scalable.


Consists of

1. CORE

Webserver and client are based on aiohttp.

2. REDIS

Service for cache and states based on redis.asyncio

3. TELEGRAM

Telegram API client based on aiogram v3

  • ready for polling/webhook update listening mode

4. OTHER SERVICES

You easily can add any other service :)

Utils

  • pydantic settings – ready to read .env / docker secrets
  • uvloop – speed up asyncio event loop
  • msgspec – speed up json (de)serialization
  • backoff – retry on network and other failures

How to launch

1. CREATE / COPY CONFING

Example of .env config located in /examples folder.
Copy it to the root of the project or copy into your app manager (e.g. portainer)
Don't forget to edit it :)

2. LAUNCH THE APP WITH:

Pure python

python -m app

Docker / Docker-compose

docker-compose up -d