Current URL: https://nutra.tk/api/
See database: https://github.com/nutratech/db
See cli: https://github.com/nutratech/cli
You will need to install the following, or newer.
- Python 3.8 (with
venv
support) - PostgreSQL 12 (with
dev
library, seedb
for details)
You can install PostgreSQL, register it as a startup service, and populate data.
You can also set the PSQL_*
vars in .env
and point to a
remote database instance.
See db/README.rst
.
Initialize with this.
It will require python-venv
and (optionally) direnv
.
make init make deps
make run
NOTE: You can also debug from VSCode
, or PyCharm
.
The code is formatted with black
, autopep8
, and isort
.
The code is also linted with a variety of tools, see the Makefile
The code is tested with pytest
and coverage
.
The unit tests require a Postgres connection.
They use the recommended practices for testing a Sanic
app.
NOTE: It's recommended to run this before committing changes.
make format lint test
The server runs with default configuration locally.
Check the .env.local
file for specifics on deployed environments.
These can be supplied as environment variables to the systemctl
service.
See ntserv.service
for an example.