Skip to content

Develop the frontends

The development loop for IDEN's two browser apps. You run the provider and both frontends from your checkout, with only the stores in Docker, so edits show up right away. To deploy them, see Install IDEN.

Budget about ten minutes.

You need

  • Python 3.14+ and uv, for the provider
  • Node.js 22 and pnpm, for the frontends
  • Docker, for PostgreSQL, Redis and SeaweedFS
  • Ports 8000, 4000 and 5173 free

The two apps

They are what turns the API into something a person can use. Both are ordinary OIDC clients of the provider, with no privileged path of their own.

App Dev port Container port Path What it does
auth-ui 4000 4000 /auth/ The hosted sign-in page. /oauth2/authorize redirects here for the password step, TOTP and consent. The only place a password is typed.
dashboard 5173 3000 /console/ Administration and self-service in one app. What you see is decided by the scopes in your token.

Both are served from a sub-path, in development as well as in a container, because in a real deployment all three applications share one origin. The dashboard cannot sit at the root there: the provider's API owns /admin/* and the dashboard's own admin screens have the same names.

The path is Vite's base in each app's vite.config.ts, and everything else follows from it — the built asset URLs, React Router's basename, the OIDC redirect URI. Change it in one place and rebuild; change it anywhere else and the two disagree.

Both are React on Vite in the web/ pnpm workspace, sharing an @iden/shared package: the design tokens, the generated API types, one axios client, and the components that render identity data. web/README.md has the layout.

The dev ports differ from the container ports for the dashboard, and both are already accounted for: 5173 and 3000 are in the CORS allowlist and in the seeded dashboard client's redirect URIs, so either works without configuration.

1. Start the provider

The frontends have nothing to show without it. Start the stores, from the repository root:

docker compose -f deploy/docker-compose.yml up -d postgres redis seaweedfs

Name the three services. Running up -d without them also starts the containerized provider and frontends, which take the ports you're about to use. Leave seaweedfs out if you're not working on profile photos. Those endpoints then answer 503, and nothing else changes.

Then the provider, from provider/:

cd provider

uv sync                              # install dependencies
cp .env.example .env                 # the defaults match the containers above

uv run python -m scripts.gen_keys    # once: signing key, totp.key, engine.token
uv run alembic upgrade head          # create the schema
uv run python -m scripts.seed        # prints the bootstrap password, once

uv run provider                      # http://localhost:8000

Copy the administrator's email and password from the seed's output. Both are hashed before they're stored and are only printed this once. If you lose the password, set a new one with EMAIL=admin@localhost PASSWORD='…' uv run python -m scripts.change_pass, or start over with uv run python -m scripts.reset, which drops everything and seeds again.

provider/.env already allows the dashboard's dev origin (http://localhost:5173) in IDEN_ALLOWED_ADMIN_ORIGINS. The seeded dashboard client already accepts http://localhost:5173/console/callback. Neither needs changing.

Leave the provider running and open a second terminal.

2. Start the frontends

From web/:

pnpm install
pnpm dev

pnpm dev runs both apps in parallel. auth-ui serves on 4000 and the dashboard on 5173, both with strictPort — if a port is taken, Vite fails rather than quietly moving, because a moved port breaks the redirect URI.

Open http://localhost:5173/console/ and you are sent through a real sign-in: the dashboard redirects to /oauth2/authorize, the provider redirects to auth-ui at http://localhost:4000/auth/login, and you come back to /console/callback with a code. Sign in with the bootstrap administrator from step 1. After installing has a walkthrough that exercises every screen.

You don't have to type the paths. Vite's dev server, each app's own container and the production proxy all redirect the root to the app's path, so http://localhost:5173 and http://localhost:3000 both land on /console/. The dev loop and the deployment agree about where things live.

Pointing them somewhere else

Both read their configuration at runtime, not at build time, so one image serves any deployment. In pnpm dev that comes from Vite env vars; in a container it comes from /config.js, written by the entrypoint.

Variable Effect
VITE_IDEN_ISSUER The provider's origin — what these apps call. In pnpm dev it is a different origin from the app itself, so the app's own origin (5173 or 4000) must be in IDEN_ALLOWED_ADMIN_ORIGINS: CORS permits the caller, not the callee. Behind one origin in production, nothing needs listing.
VITE_IDEN_ORG_NAME Your organization's name, shown as the main heading of the sign-in page, with "IDEN" as a small caption beneath it.
VITE_IDEN_ORG_LOGO Optional. Your logo, shown beside the name.
VITE_IDEN_MAIL_DOMAIN Dashboard only. Shown beside the email field when adding a user; match the provider's IDEN_MAIL_DOMAIN.

Each app has an .env.example next to its package.json — copy it to .env and edit. The container equivalents drop the VITE_ prefix: IDEN_ISSUER, IDEN_ORG_NAME, IDEN_MAIL_DOMAIN. The logo is the exception: VITE_IDEN_ORG_LOGO becomes IDEN_ORG_LOGO_URL, the name the provider's settings use.

Types come from the server

Request and response types are generated from the provider's own OpenAPI document, never written by hand:

pnpm gen:api

It reads the schema out of the FastAPI application directly rather than over HTTP, so it works with no server, database, or Redis running. Re-run it after changing any provider schema, and commit the result — web/shared/api/schema.d.ts is checked in.

If a type is wrong, the fix is in provider/. Editing the generated file is undone by the next person who runs the generator.

Before you commit

pnpm lint
pnpm typecheck
pnpm build

The same three run in CI (.github/workflows/web.yml). Conventions are in GUIDELINES.md — Frontend Code; the visual system is DESIGN.md, transcribed once into web/shared/tokens/theme.css — every colour and size resolves there rather than being written inline.

When something is wrong

The dashboard redirects forever and never signs in

The issuer, the CORS allowlist, and the registered redirect URI do not all name the same origin. All three are compared exactly, and the browser console says which one — a CORS refusal points at IDEN_ALLOWED_ADMIN_ORIGINS, an invalid_request on the redirect points at the client.

The settings, and how to change them, are in Configuration.

Vite refuses to start: port is already in use

strictPort is deliberate. Something else holds 4000 or 5173 — usually the containerized frontends from an earlier docker compose up -d. Stop them with docker compose -f ../deploy/docker-compose.yml stop auth-ui dashboard.

Every API call fails with a CORS error

The origin you are serving from is not in IDEN_ALLOWED_ADMIN_ORIGINS. Credentialed requests forbid a wildcard, so it has to be named, and the provider has to be restarted after a change.

Sign-in works but the dashboard shows no Administration section

That is the permission system working. The sidebar is built from the scopes in your token — sign in as someone holding the administrator role.