To compile and run do the following
git clone git@github.com:brharrelldev/BlockListAPI.git
Then build
make build-all
The build-all target will both regnerate a schema, and compile the go code
To run the cli type:
bin/blocklist-cli <flags>
There are 5 flags, to make it easier you can export them app as environment variables and run the root command with no args:
bin/blocklist-cli
The 5 environment variables you can export are:
export BLOCKLIST_USER=<blocklist_user>
export BLOCKLIST_PASS=<bloocklist_pass>
export DB_CACHE=<badger db cache for token storage>
export DB_PATH=<path to backend database>
export PORT=<port service runs on>
Docker images can be build via the following command:
make docker-build-and-publish
This will build and push docker image to your desired repo
Below is a list of depdencies
Dependencies | Reason for usage |
---|---|
badger | kv store used to store token |
gqlgen | used to build graphql server in Go |
mux | for routing and auth middleware |
mattn | used as driver for sqlite3 db |
urfavcli | cli library, convienient for passing env variables to program |