Getting Started

  1. Install the prerequisites below.
  2. Clone the repository.
  3. Optionally set up a VM or Docker.
  4. Install KAFE using Docker compose or run it locally through pnpm or dotnet CLI.

# Prerequisites

Back end (API)

Front end (Web)

# Configuration

Back end (API)

The API is configured using the Api/appsettings.local.json. By default:

Front end (Web)

The front end is configured with Web/.env and Web/src/api/API.ts. By default:

# Running locally

You can run KAFE locally either directly on your machine or through Docker. If you run into issues, check the instructions below and Troubleshooting.

# Without Docker

These instructions explain, how to run KAFE on your local machine, not in a Docker container. This has the advantage of being easier to debug. However, it takes longer to set up and may conflict with your local configs if you have other projects using .NET, Node.js, or Postgres.

Back end (API)

  1. Make sure Postgres is running on port 5432. If it's running on a different port, update connection strings in Api/appsettings.local.json.
  2. Restore NuGet packages: dotnet restore
  3. If you haven't already, create a self-signed dev certificate: dotnet dev-certs https --trust
  4. While in the Api/ dir, to run the API: dotnet run
  5. Run the front end or use Postman.

Front end (Web)

  1. Go to the Web directory.
  2. Ensure pnpm is installed: corepack enable pnpm@latest
  3. Install npm packages: pnpm install
  4. To run the front end locally: pnpm run start

# In Docker

  1. Make sure Docker is installed and running.
  2. While in the root of the KAFE repo, run:
    docker compose -f ./docker-compose.base.yml -f ./docker-compose.local.yml up
    
  3. If you made changes to Marten projections, you may want to rebuild all of them. On Linux, run:
    REBUILD_PROJECTIONS=true docker compose -f ./docker-compose.base.yml -f ./docker-compose.local.yml up
    
    On Windows (in PowerShell), run:
    $env:REBUILD_PROJECTIONS=$true
    docker compose -f ./docker-compose.base.yml -f ./docker-compose.local.yml up
    
  4. Web is now running at http://localhost:3000 and the API at https://localhost:44369.
  5. To stop the containers, run:
    docker compose -f ./docker-compose.base.yml -f ./docker-compose.local.yml down
    

# Logging in

To log in:

  1. Use the kafe@example.com email address in the front-end's UI or in a call to TemporaryAccountCreationEndpoint (POST to /api/v1/tmp-account). This is the default admin account.

  2. Look into back end's console output and look for the confirmation email.

  3. Use the confirmation token from the confirmation email.

    • If you want to log in using the front end, just copy paste the link into the browser.
    • If you're using the API (e.g., through Postman), change the URL to match the TemporaryAccountConfirmationEndpoint. That is, change it:
    ORIGINAL:
    https://<your KAFE instance>/account/token/:token
    NEW:
    https://<your KAFE instance>/api/v1/tmp-account/:token
    

    where :token is the confirmation token.

  4. Now, your user agent of choice should have a valid session cookie.