Setup Krenalis for development

View as Markdown

1. Install React and other dependencies

cd admin
npm ci

2. Configure

Set environment variables necessary to run Krenalis (you can add a configuration file .env (see .env.example) in the same directory of the krenalis executable).

3. Compile the server command in dev mode

Within the root of this repository execute:

go build -tags dev,osusergo,netgo -trimpath ./cmd/krenalis

(please note the dev flag, which is specific to Krenalis)

4. Run and open the browser

Launch the server command executing ./krenalis (or ./krenalis.exe on Windows) and visit http://127.0.0.1:2022/admin/.

Note that if it's the first time you are running Krenalis and the configured PostgreSQL database is empty, you need to start Krenalis by specifying the -init-db-if-empty option to initialize the database.

Expose on the Internet (optional)

These steps document how to expose a locally running Krenalis instance to the internet.

  1. Install cloudflared
  2. Check that it is installed correctly: cloudflared --version
  3. Run cloudflared: cloudflared tunnel --url http://localhost:2022
  4. Make a note of the URL listed in the standard output (example: https://xxxxxxx.trycloudflare.com)
  5. Open the URL in a browser