Readme на русском доступно здесь.
- Project is completely asynchronous thanks to aiogram, asyncpg and redis asyncio.
- It's easy to test and debug because 2 levels of logging are provided.
- The yookassa test API is integrated.
-
Telegram:
-
Create yookassa test shop.
-
Create .env file with following structure (dotenv guide):
# Telegram
TOKEN='token from BotFather'
BUGS_GROUP_ID='group id' # starts with "-"
IDEAS_GROUP_ID='group id' # starts with "-"
RETURN_URL='link to your bot' # needed for yookassa
# Postgres
POSTGRES_USER='postgres'
POSTGRES_PASSWORD='postgres'
POSTGRES_DB='AnonChat'
POSTGRES_HOST='localhost' # change it to container name if you use docker
POSTGRES_PORT='5432'
# Redis
REDIS_DB='1'
REDIS_HOST='localhost' # change it to container name if you use docker
REDIS_PORT='6379'
# Yookassa
YOOKASSA_ACCOUNT_ID='yookassa shop id' # note that this value should be int
YOOKASSA_SECRET_KEY='yookassa api token'
The easiest way is to run project via docker.
-
Make sure you have installed docker.
-
Build the project (it may take some time):
docker compose build
- Run the project:
docker compose up
That's all! Docker compose file will install and configure everything.
Alternatively you can run it manually:
- Create venv:
python -m venv venv
- Activate venv:
- On Windows:
venv\Scripts\activate
- On Linux and macOS:
source venv/bin/activate
- Install dependencies:
pip install -r requirements.txt
-
Install Redis.
-
Install Postgres (if you changed user or password during installation make sure to also change it in .env file).
-
Run the project:
python main.py
Feel free to ask questions and share your ideas.
Plans on the project are here.