If you are running NixOS, make sure flakes are enabled.
On other operating systems/distributions, install Nix using the Determinate Systems Nix installer:
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
Consider installing direnv to automatically install the project's nix shell when you cd
into the folder. If you have direnv installed, simply run direnv allow
and follow the instructions below.
If you don't use direnv, activate the nix shell using nix shell --impure
.
To start lanparty-seating:
devenv up
mix deps.get
mix ecto.create && mix ecto.migrate
mix ecto.reset
cd assets && yarn install --dev && cd ..
mix phx.server
Now you can visit localhost:4000
from your browser.
You can configure the app to automatically upload its grafana dashboards to grafana and annotate its lifecycle events in grafana by setting the following environment variables:
GRAFANA_ENABLE: Any value such as 1
enables grafana support
GRAFANA_HOST: URL to the grafana instance
GRAFANA_AUTH_TOKEN: Grafana auth token
GRAFANA_DATASOURCE_ID: Grafana datasource id for the prometheus instance that is scraping this application
You can configure OpenTelemetry to send trace to honeycomb.io by setting the following environment variable:
OTEL_EXPORTER_OTLP_TRACES_HEADERS: The value x-honeycomb-team=<HONEYCOMB API TOKEN>
There are mutiple ways to debug elixir code as show in the Debugging section of the elixir manual.
In general, you can use the VSCode editor with the recommended extensions for the project to debug in the editor using ElixirLS.
You can also launch the program with the elixir repl using iex -S mix phx.server
and insert "breakpoints" into the code using IEx.Pry()
in order to make the app break into the repl at that point, allowing you to introspect its state.
pkill -9 postgres