Webrizendocs
Getting started

Quickstart

Run Webrizen SSO and the demo Restaurant app locally, then sign in to the demo with your Webrizen account. You need Node.js 20+ and pnpm. Docker isn't required.

Install dependencies

pnpm install

Start the local database

A real PostgreSQL server runs from npm, with data kept in apps/accounts/.data. Leave this terminal open.

pnpm --filter @webrizen/accounts db:local

Create the tables

pnpm db:migrate

Start the SSO server

pnpm dev

Open http://localhost:3000 and create an account. Until you configure SMTP, verification codes are printed in this terminal instead of emailed.

Make yourself a platform admin

Platform admins can register apps and manage all users.

pnpm --filter @webrizen/accounts make-admin you@company.com

Alternatively, put your email in PLATFORM_ADMIN_EMAILS before you sign up.

Register the demo app

Go to Platform → Applications → Register application and use:

FieldValue
Application typeWeb app (server)
Redirect URIhttp://127.0.0.1:4000/api/auth/webrizen/callback
Sign-out redirect URIhttp://127.0.0.1:4000
First-party✓

Copy the credentials shown after registering. The secret is only shown once.

Run the demo

apps/demo/.env.local
APP_URL=http://127.0.0.1:4000
WEBRIZEN_SSO_ISSUER=http://localhost:3000/api/auth
WEBRIZEN_SSO_CLIENT_ID=paste-client-id
WEBRIZEN_SSO_CLIENT_SECRET=paste-client-secret
WEBRIZEN_SSO_SESSION_SECRET=any-random-string-of-32-plus-characters
pnpm dev:demo

Open http://127.0.0.1:4000 and click Sign in with Webrizen. Because you're already signed in to Webrizen, you'll land back in the demo without typing anything.

Use 127.0.0.1 for the demo

Browsers share cookies between ports on the same host. Serving the demo from 127.0.0.1 and the SSO server from localhost keeps their sessions separate, just like different domains in production.

Try the permissions

  1. In Roles & permissions, pick the cashier template and create it.
  2. Invite a second email address as cashier. The invitation link appears in the terminal.
  3. Sign up as that person, accept the invite, then sign in to the demo.

The demo unlocks Take order and locks everything else. That's the role you just built, travelling inside the token.