First run: local data, samples or an authenticated workspace
OpenSight is open-source, QuickSight-compatible BI for dashboards, analysis authoring, data preparation, connectors and embedding. The default local API serves fixtures and a local file workspace; it does not configure authentication or issue sessions.
Run locally
Follow the README's Run it path. Use Node 24+ and npm, free ports 3000 and 5173, and the default local configuration without hosted environment settings. No external database is needed. In terminal 1, from the repository root:
npm ci
npm run build --workspace @opensight/api
npm start --workspace @opensight/api
The build prepares the API and its workspace dependencies; npm start alone
does not build. Wait for OpenSight API listening on http://127.0.0.1:3000.
In terminal 2, also from the repository root:
npm run dev --workspace @opensight/web
Open http://127.0.0.1:5173 and keep both terminals running.
Stop each with Ctrl+C when finished. The Vite proxy forwards browser API requests to port 3000.
The API's logical session route is /api/session; the default web client requests
/api/api/session and the dev proxy strips the first /api prefix.
The default CLI advertises an explicit local-data capability. The web app opens
a Local workspace with empty Home, Author, Analyses and Dashboards pages.
Use Upload or connect data, or explicitly Try sample data to explore the
labeled synthetic sales dataset. Remove sample data restores the empty
Home and unbound Author; saved drafts and uploaded data are retained. The sample
opt-in lasts until this tab reloads. Open Data → Data sources to upload
a CSV, select Prepare this upload, then Save pipeline → Build a chart.
In Author, Add visual, assign fields, and Save draft; reopen through
Analyses → My analyses. Draft definitions stay in this
browser and origin, without uploaded rows, sync or publication. This local path
needs no hosted session. Uploads survive API restarts and expire after 24 hours; see the
local database location. /api/session still
returns 503 SECURITY_NOT_CONFIGURED; local capability discovery is separate.
A library API without either local-data opt-in or authentication instead shows setup instructions and an explicit Explore sample data action. Unreachable APIs, invalid responses and rejected sessions also get recovery guidance. Requests time out after ten seconds; Retry connection, window focus and a thirty-second refresh can recover once the session is available. A valid session opens the existing application with its registered role. No fallback to samples happens automatically.
Local demo and development sign-in
Explore sample data opts this tab into the existing fixture demo. It uses public bundled samples and a demo-only preview persona. It creates no credential, cookie, membership or hosted tenant session. The browser stops session polling and does not give demo components API clients. The API explorer, file uploads, live connector operations and server saves are unavailable in this mode. Local analysis/pipeline drafts can still be saved in browser storage or exported as definitions using the existing demo controls; those actions do not save data to a server.
A persistent Fixture demo · Public samples only · No hosted session banner includes Return to setup. Returning discards the mounted demo view and checks authentication again. Reloading also returns to the normal session check; the choice is not stored in a URL, cookie or local storage. Locally saved drafts remain device-local, in a collection separate from the local API workspace.
There is no development sign-in endpoint or authentication bypass, and no new
dev-sign-in environment variable. Local file access is a separate, explicitly
enabled API mode; sample exploration is also available from the setup screen.
/api/session remains fail-closed, including requests with forged credentials or
demo-related query parameters. The existing
VITE_OPENSIGHT_OFFLINE_DEMO=true build setting selects a fixture-only web build;
it does not configure or weaken API authentication. You can also build the local
single-file demo with npm run build:demo --workspace @opensight/web and open
packages/web/dist/opensight-demo.html. That file is not a deployed server.
Configure real authentication
The hosted architecture distinguishes proposed behavior from shipped features. Follow H2 tenant sessions for the implemented configuration and API request shapes:
- Set
OPENSIGHT_MODE=hostedon the API process. Supplying hosted settings while retaining fixture mode refuses startup. - Set
OPENSIGHT_METADATA_DATABASEto a durable SQLite file, such as.opensight/metadata.sqlite, never:memory:. SetOPENSIGHT_PUBLIC_ORIGINto an exact HTTPS origin with no path/trailing slash. Terminate TLS at a trusted reverse proxy, preserve that Host, and restrict the backend listener. The HTTP Vite development origin is not a hosted-auth origin. - Set
OPENSIGHT_AUTH_ISSUERandOPENSIGHT_AUTH_AUDIENCEto nonempty identifiers without whitespace, andOPENSIGHT_AUTH_KEY_IDto a unique signing-key ID. Supply three distinct, random 32-byte keys in canonical base64 throughOPENSIGHT_AUTH_SIGNING_KEY,OPENSIGHT_AUTH_ENCRYPTION_KEYandOPENSIGHT_OPERATOR_KEY. Use your environment/secret manager, never the repo, browser storage, URLs orVITE_*variables. - Set explicit integer lifetimes:
OPENSIGHT_SESSION_SECONDS(900–36000) andOPENSIGHT_INVITATION_SECONDS(1–604800). Configure invitation SMTP withOPENSIGHT_SMTP_HOSTandOPENSIGHT_SMTP_FROM;OPENSIGHT_SMTP_PORTdefaults to 465 for implicit TLS. If authentication is needed, supply bothOPENSIGHT_SMTP_USERandOPENSIGHT_SMTP_PASSWORD. Restart the API withnpm start --workspace @opensight/api. - Use the operator API to provision a tenant and invite its administrator.
Open the emailed invitation link to set and confirm a password in the browser.
Scan the authenticator QR code or enter the displayed base32 setup key, then
confirm a live six-digit TOTP code. The invitation is bound to the invited
account. H2's
/api/auth/enrolland/api/auth/acceptremain available for operator automation; operator credentials grant no tenant data access. - Successful enrollment clears the invitation link and opens sign-in with the
email and password already entered. Continue to the authenticator step and
wait for a fresh six-digit code: the enrollment code cannot be reused. Later
visits with no valid refresh cookie start with email and password. Both
steps are submitted together to
/api/auth/login;/api/sessionverifies the returned identity before the workspace opens. A single workspace opens directly; choose by name if you belong to several (no workspace ID input). Already-enrolled invitees sign in and accept the invitation with their session. The client sends login without a bearer and accepts a separate HttpOnly refresh cookie. Bearers stay only in memory. Reloads silently exchange the cookie before any access gate, waking an on-demand workspace first. Missing or expired cookies return to the usual Connect/sign-in flow. See session restore. Route the API prefix correctly at the trusted HTTPS proxy. Sign out is in the hosted header. See the sign-in guide for session duration, expiry and error behavior, and browser enrollment for invitation handling.
Library-based self-hosting can instead use
createApiServer({ security: { authenticate, initialState, storePath }, ... }).
The server-owned verifier must resolve a registered principal; the library has
no default credential. See security and namespaces.
No real auth service, SMTP delivery or external connection is needed for the
fixture demo. Setup links in the screen point to repository documentation online;
the same Markdown guides are in the clone's docs/ directory for offline use.