Getting Started
- Install the prerequisites below.
- Clone the repository.
- Optionally set up a VM or Docker.
- Install KAFE using Docker compose or run it locally through
pnpm
ordotnet
CLI.
# Prerequisites
Back end (API)
Front end (Web)
# Configuration
Back end (API)
The API is configured using the Api/appsettings.local.json
.
By default:
- The API runs at
https://localhost:44369
. - It saves artifacts to
C:/dev/fi/kafe-archive
. - It generates lower-resolution videos in
C:/dev/fi/kafe-generated
. - It doesn't send emails, it just logs them into the terminal.
- It creates an admin account with email
kafe@example.com
. - It expects an OpenIdConnect server at
https://localhost:44370
.
Front end (Web)
The front end is configured with Web/.env
and Web/src/api/API.ts
.
By default:
- It expects the api to run locally at
https://localhost:44369
.
# 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)
- Make sure Postgres is running on port 5432.
If it's running on a different port, update connection strings in
Api/appsettings.local.json
. - Restore NuGet packages:
dotnet restore
- If you haven't already, create a self-signed dev certificate:
dotnet dev-certs https --trust
- While in the
Api/
dir, to run the API:dotnet run
- Run the front end or use Postman.
Front end (Web)
- Go to the
Web
directory. - Ensure
pnpm
is installed:corepack enable pnpm@latest
- Install
npm
packages:pnpm install
- To run the front end locally:
pnpm run start
# In Docker
- Make sure Docker is installed and running.
- While in the root of the KAFE repo, run:
docker compose -f ./docker-compose.base.yml -f ./docker-compose.local.yml up
- If you made changes to Marten projections, you may want to rebuild all of them.
On Linux, run:
On Windows (in PowerShell), run:REBUILD_PROJECTIONS=true docker compose -f ./docker-compose.base.yml -f ./docker-compose.local.yml up
$env:REBUILD_PROJECTIONS=$true docker compose -f ./docker-compose.base.yml -f ./docker-compose.local.yml up
- Web is now running at
http://localhost:3000
and the API athttps://localhost:44369
. - To stop the containers, run:
docker compose -f ./docker-compose.base.yml -f ./docker-compose.local.yml down
# Logging in
To log in:
-
Use the
kafe@example.com
email address in the front-end's UI or in a call toTemporaryAccountCreationEndpoint
(POST to/api/v1/tmp-account
). This is the default admin account. -
Look into back end's console output and look for the confirmation email.
-
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. -
Now, your user agent of choice should have a valid session cookie.