Skip to content

Backend example setup

Run the real authentication and task API included in both the dashboard and starter.

Interactive demo and real server

The interactive demo uses disposable sample data on static hosting. Edits stay in the current page; reload, leave, or reset to start again. Demo account switching simulates permissions and separate workspaces. It provides no authentication or server persistence.

When the included server is running, the same page shows its real sign-in flow. HttpOnly cookie sessions, CSRF protection, role checks, and tenant isolation are enforced by that server on every API request. Task records persist in SQLite across restarts.

1. Install and build

Use Node 24 LTS. Run these commands in the dashboard root or independently inside seed/.

npm ci --strict-peer-deps
npm run build

2. Configure your private password

Create .env.auth in the selected app root and replace the placeholder with your own long password. Keep this file private; it is ignored by Git and excluded from release ZIPs.

APEX_EXAMPLE_PASSWORD=replace-with-your-own-long-private-password

3. Start the example server

npm run example:auth

Open http://localhost:3740/backend-example. Sign in as [email protected], [email protected], or [email protected] with your configured password. Administrators can write tasks; viewers can only read. Each workspace starts with seven tasks.

The database lives in .local/auth-example.sqlite outside the public export. Existing users retain their passwords when the environment value changes. To reset this disposable local example, stop the server and remove its .local/ directory.

Verification and deployment

npm run verify
npx playwright install chromium firefox webkit
npm run test:e2e:auth

Run verification separately in both apps. Read docs/authenticated-backend.md in the download for API details, HTTPS/proxy configuration, session handling, and deployment limitations. Configure real credentials, recovery, backups, and monitoring before adapting the server for customer accounts.