How to try it:
- Create python environment
- Configure venv with python 3.9+ and activate it
- Install python-poetry if you don't have it
- Run
poetry install
to install dependencies
- Prepare database
- Create postgres database
- Write your db connection string to
DATABASE_URL
variable insrc/db_schema.py
- Write the same string to
sqlalchemy.url
variable inalembic.ini
- Run
alembic upgrade head
to create sql tables
- Run the server with
python src/main.py
- Explore the API at http://127.0.0.1:8000/docs#/
- Some endpoints require authentication. To use them, first create your user with POST
/api/users/
, filling inusername
andpassword
json parameters. Then click "Authorize" button, fill yourusername
andpassword
in the form and proceed. If you are successfully authorized, you'll be able to use all the endpoints.
- Some endpoints require authentication. To use them, first create your user with POST
- Run the bot
- You can set bot configuration parameters in
bot_config.json
file - Run the bot with
python src/bot.py
- What the bot does:
- Create
number_of_users
users - Authenticate these users (get tokens)
- Create a random number of posts (up to
max_posts_per_user
) for each created user - Like a random number of posts (up to
max_likes_per_user
) for each created user
- Create
- Notes:
- Random word generation is quite slow, so it takes a few seconds to initialize the bot
- You can set bot configuration parameters in