Backend for github.com/alphahorizonio/consumat.io.
🚧 This project is a work-in-progress! More instructions will be added as soon as it is usable. 🚧
You can get the Docker container like so:
$ docker pull alphahorizonio/consumatio-backend
If you prefer a native installation, static binaries are also available on GitHub releases.
You can install them like so:
$ curl -L -o /tmp/consumatio-backend https://github.com/alphahorizonio/consumat.io-backend/releases/latest/download/consumatio-backend.linux-$(uname -m)
$ sudo install /tmp/consumatio-backend /usr/local/bin
The frontend is also available on alphahorizonio/consumat.io-frontend if you prefer to self-host. For most users, this shouldn't be necessary though; consumat.io is a progressive web app. By simply visiting the public deployment once, it will be available for offline use whenever you need it:
🚧 This project is a work-in-progress! More instructions will be added as soon as it is usable. 🚧
To contribute, please use the GitHub flow and follow our Code of Conduct.
To build and start a development version of the consumat.io backend locally, run the following:
# Clone the repo
$ git clone https://github.com/alphahorizonio/consumat.io-backend.git
$ cd consumat.io-backend
# Start the database
$ docker volume create consumatio-postgres
$ docker run --name consumatio-postgres -d -e POSTGRES_USER=consumatio-postgres -e POSTGRES_PASSWORD=consumatio-postgres -e POSTGRES_DB=consumatio-postgres -p 5432:5432 -v consumatio-postgres:/var/lib/postgresql/data postgres postgres -N 512
# Install dependencies
$ make depend
# Run tests
$ TMDB_KEY="mytmdbkey" BACKEND_SECRET="mysecret" make test
# Start the backend
$ TMDB_KEY="mytmdbkey" BACKEND_SECRET="mysecret" make dev
The backend should now be started and the GraphQL playground should be available on http://localhost:5000/. Whenever you change a source file, the backend will automatically be re-compiled and restarted.
To authorize in the playground, set the following HTTP headers:
{
"X-Consumatio-Namespace": "[email protected]",
"X-Consumatio-Secret": "mysecret"
}
If you want to create and apply a migration, run the following; migrations are also applied ("upgraded") automatically on startup:
$ MSG="mymigrationdescription" make migrations
You can also connect using psql
:
$ PGPASSWORD=consumatio-postgres psql -h localhost -p 5432 -d consumatio-postgres -U consumatio-postgres
To reset the database, run:
$ docker rm -f consumatio-postgres
$ docker volume rm consumatio-postgres
Have any questions or need help? Chat with us on Matrix!
consumat.io Backend (c) 2021 Jakob Waibel and contributors
SPDX-License-Identifier: AGPL-3.0