(first of all install)
- docker / docker compose
- postgres
- redis
- pgadmin
- poetry
note: there is no need to install postgres and redis in your local system
create .env file in root project and fill up like .env.example and copy that .env file in ./app
note: to create secret key use this command:
openssl rand -base64 64
you must be login:
docker login [url]
in our project there is the docker-compose.dev.yml use this file to up postgres and redis
docker compose -f docker-compose.dev.yml up -d
if you do not have poetry package manager install that
in our root project directory go to app folder
for create virtual env and go to that and after that install dependency use below commands
poetry shell
poetry install
maybe you get some error for some library so you need in virtual env install them individualy
pip install [name_of_library]==[version]
after install dependency so next and last step is run the
uvicorn --reload --host 0.0.0.0 --port 8000 --log-level info "app.main:app"
create migration file with:
alembic revision --autogenerate
apply migration with:
alembic upgrade head
to enable multiple authentication add ALLOWED_AUTH_METHODS to environment variables:
ALLOWED_AUTH_METHODS=basic,jwt
in order to test websocket paste this line in api test-websocket
ws://ip:port/api/v1/utils/echo-client/
and paste response in html file and open it