- NodeJS and npm
- Rust (current stable or nightly)
- PostgreSQL
- Docker
- On MacOS, ensure your docker VM has sufficient resources, at least 2vCPUs and 8GB of RAM.
- docker-compose >=v2.27.0
- On MacOS, install this through
brew
. Notice this calls for extra modifications to~/.docker/config.json
. - On Linux, install
docker-compose-plugin
from thedocker-ce
repository. See the OS-specific instructions here. - Alternatively, for both platforms, you can install the binary plugin.
- On MacOS, install this through
Some Rust dependencies require additional system dependencies. These can be installed with your usual package manager:
- C compiler (GCC or Clang)
- CMake
This will get you up and running quickly for development purposes.
- Clone the repository and navigate to its root.
- Execute
echo "http://localhost:8080" >app/public/api_url
- Execute
docker compose watch
. - Navigate in your browser to
http://localhost:8081/
.
docker compose
will automatically reload containers when you make changes. Data is persisted
until you docker compose rm --volumes
.
Two Janus aggregators will be created for you, but are not automatically paired to divviup-api. Their information is:
- Address:
http://janus_1_aggregator:8080/aggregator-api
, Token:0000
- Address:
http://janus_2_aggregator:8080/aggregator-api
, Token:0000
If you need to talk to these aggregators from outside compose's network namespace, e.g. with a
testing client, they are mapped to localhost:9001
and localhost:9002
, respectively.
If using the divviup CLI, consider compiling with the --features admin
option. Also, set these
environment variables.
# This token is intentionally blank, but you'll still need to set the variable.
export DIVVIUP_TOKEN=
export DIVVIUP_API_URL=http://localhost:8080
# Set this for any account-specific commands. Since divviup-api in dev mode will automatically
# authenticate you as an admin, it won't know which account to target.
export DIVVIUP_ACCOUNT_ID={account uuid}
PostgreSQL is exposed on port 5432 with username and password postgres
.
If you need to iterate on database migrations, you may wish to disable the divviup_api_migrate
service by commenting it out in compose.yaml
.
- We do not have CSRF protections because we only accept a custom content type for non-idempotent request methods such as POST, and have constrained CORS rules.