You need Python 3.10+ and PostgreSQL 12+ to run this project.
-
Start by installing the dependencies:
poetry install
-
Next you need to set some environment variables, for this I recommend
direnv
:# Auto-activate venv load_prefix <path to project>/.venv export VIRTUAL_ENV=<path to project>/.venv # Set up aqara integration export AQARA_APP_ID=... export AQARA_APP_KEY=... export AQARA_KEY_ID=... export AQARA_DOMAIN=open-ger.aqara.com # Specify which database to use export PGDATABASE=heim
-
Create the database:
createdb heim
-
Apply migrations:
./bin/migrate
-
That should be if, you're now good to go.
To run the server use any ASGI server. uvicorn
is installed as part of the project dependencies. It supports reloading as well:
uvicorn heim.server:app --reload
In addition to the HTTP component, heim also has a background task runner that has to be run as a separate process:
./bin/run-tasks