Facezhuk - is a social network that allows users to interact with each other.
The infrastructure of WebsiteBuilder consists of the following services:
- Facezhuk application
- PostgreSQL database
- MongoDB database
- Redis in-memory database
- Email Provider for sending messages
- Celery background processor
API documentation can be found following these links
# Swagger documentation
<api_url>/docs
# Swagger redoc documentation
<api_url>/redoc
Development highly bound to docker, so there is docker-compose-dev.yml
for development and
run python main.py
and celery ...
by your PyCharm IDE.
NOTE you need to pass environment variable in your PyCharm Run configuration.
We use Pipenv for this project.
To install packages simply run pipenv install
right after you configured your environment.
- All external dependencies must be mocked in tests.
- Use
coverage run -m pytest
to measure test coverage. This can be integrated with your PyCharm IDE - Use
coverage report
to get coverage results. - Use
flake8
to check following PEP8 rules
Run uvicorn dev server
python main.py
Run all tests
pytest
Run locust tests
locust -f ./tests/locustfiles/chats.py
Run create migrations command
alembic revision --autogenerate
Run apply migration command
alembic upgrade head
Run downgrade migration command
alembic downgrade <migration name>
Run migration history
alembic history
Run celery
celery -A chat.tasks worker -l INFO
Run celery beat
celery -A chat.tasks beat -l INFO