The API can be started by simply calling the following commands with Python 3.10 as your python or python3 command and poetry installed.
make init
make up
make init
only needs to be called the first time the application is launched. Each subsequent time, make up
starts the application.
Navigate to http://localhost:8001/ to view the documentation for the endpoints
The requirements for developing this project locally are Poetry and Docker.
Initialize the project using the following commands:
git clone [email protected]:DARPA-ASKEM/data-service.git
cd data-service
make init
To start the server in a docker container, run:
make up
which will also start a development instance of Postgres.
To access Postgres directly run:
docker compose exec -u postgres rdb psql -h localhost -U dev askem
There are three types of tests:
tests/service.py
: Tests REST and GraphQL representation of TERArium object. Affects MAJOR and MINOR SemVer.tests/search.py
: Uses sample queries to check multi-object search. Affects MAJOR and MINOR SemVer.tests/unittest.py
: Tests under-the-hood functionality at the discrection of the developer. Affects PATCH SemVer.
To populate demo data you will need to set the SEED_DATA
to true
in the api.env
file. With that set you can
run a general build or up command and the DBs will be seeded with the data from migrate/seeds
.
In order to regenerate these files, run the following commands:
make down
make db-clean
make up
ERD was created using DBML and rendered and edited using dbdiagram