Development environment
To configure the monorepo in a development environment:
Install mkcert
on your machine
and generate local TLS certificates with:
pnpm mkcert
Install dependencies:
pnpm install
Setup environment files:
cp ./packages/server/.env.example ./packages/server/.env
Note: Look into the .env file for instructions on how to change the required secrets (OPAQUE setup, signature key pair, session keys etc).
Start the Docker compose stack:
docker compose up -d
Build the server and its dependencies:
pnpm build:server
Setup the database by applying pending migrations, and optionally seed the database with the usual suspects.
pnpm db migrations apply
pnpm db seed
Start the dev
script:
pnpm dev
The dev
script will:
- Build all packages in watch mode
- Start the server with nodemon, watching its dependencies to allow auto-reloading the server when the sources change. The server is listening on https://localhost:3001
- Start a Vite host SPA for the devtools component, on https://localhost:3000
- Start the Docusaurus documentation server on http://localhost:3004/e2esdk
Port list
3000
Vite SPA to host the devtools3001
Server3002
PostgreSQL database3003
Redis key/value store & cache3004
Docusaurus documentation
Test users
A list of sample identities can be seeded to the development database. The seed provides an identity and a device for each user.
To login as a particular user, you'll have to use their deviceRegistrationURI
to save their credentials to your local development browser.
This can be done with a call to the registerEnrolledDevice
on the e2esdk
client, or via the devtools.