An 100% asynchronous Fast API service for signups and Telegram integration.
As of now, this project is mainly an architecture design experimental ground with an abstract end goal in mind, rather than an actual functioning app and therefore would be most useful if used as a starting template example. The project uses FastAPI as a base framework with the following stack:
- Integration with SQLAlchemy's new ORM statement paradigm to be implemented in v2.0;
- Asynchronous PostgreSQL databse via asyncpg, one of the fastest and high performant Database Client Libraries for python/asyncio;
- Integration with Telegram library aiogram using its upcoming v3.0 version with webhooks as an integration method with FastAPI;
- A token authorization system using the argon2 password hashing algorithm, the password-hashing function that won the Password Hashing Competition (PHC);
- Asynchronous task scheduling using apscheduler;
- Designed to run efficently as possbile on a device such as the Raspberry Pi;
- Asynchronous pytests using pytest-asyncio and httpx libraries instead of the synchronous requests library;
- Vue.js 3.2 basic frontend with potential future experimentation with vite and vuetify framework.
With docker-compose installed, do:
docker-compose upGo to 0.0.0.0:8000/docs for SwaggerUI
$ git clone https://github.com/mbrav/signup_api.git
$ cd signup_apiSetup a local python environment:
$ python3 -m venv venv
$ source venv/bin/activateInstall dependencies with poetry:
$ cd app
$ poetry installCopy .env file:
$ cp .env.example .envRun server:
$ python main.pyRun server with uvicorn:
$ python -m uvicorn main:app --host 0.0.0.0 --port 8000 --workers 1 --reloadAdvanced config:
$ python -m uvicorn main:app --host 0.0.0.0 --port 8000 --workers 2 --ssl-keyfile ~/ssl/keys/server.key --ssl-certfile ~/ssl/certs/server.crtGo to 0.0.0.0:8000/docs for SwaggerUI
$ python -m pytest