settings container is empty or missing. Setup mode is detected automatically — no special flag is needed.
Prerequisites
The only environment-level configuration Findable needs is a connection to Azure Cosmos DB. Set these variables in your.env file (local dev) or as Azure App Service Application Settings (production). Everything else — Azure AD, Graph API, admin groups, AI endpoints, features — is configured through the wizard and stored in Cosmos DB.
Note: The Cosmos DB database must be created manually before running the wizard. If the database is missing, the client shows an error screen instead of the wizard.
How Setup Mode Is Detected
Server-Side Detection
On startup, the server checks two conditions:- Does the Cosmos DB database exist? (
doesDatabaseExist()) - Is the settings container ready? (
isSettingsReady()— container exists and has at least one document)
- Only
/server/setup/*endpoints and a dynamic/server/bootstrapendpoint are mounted - Authentication middleware is not loaded (setup must work before Azure AD is configured)
- A setup monitor polls every 5 seconds for setup completion
Client-Side Detection
The client callsGET /server/bootstrap on load and reacts based on the response:
When the client renders the setup wizard, it bypasses MSAL authentication entirely — the wizard operates without Azure AD since those credentials haven’t been configured yet.
Setup Modes
The setup entry point (#/start) offers two modes via a toggle:
Wizard Steps
Step details:
- Step 1 (Prerequisites) creates the required Cosmos DB containers. Most use
/idas the partition key (settings,chat,prompts,flows,pages,aitoolproviders,mcpservers,modelendpoints,vectorstores); user-scoped containers (chatlog,feedback,usersettings,userfavorites,usernotifications,usernotificationpreferences) use/email; andhumaninputuses/executionId. - Step 4 (Admin Groups) wraps the group selector in a temporary
SetupMSALWrapperthat creates a minimal MSALPublicClientApplicationusing theclientIdandtenantIdentered in Step 2. This enables Azure AD group search via popup login before the main app’s MSAL instance exists. - Step 5 (Review & Complete) validates and sanitizes the settings payload (requires
tenantIdandclientId, validatesgraphAuthType, and only allows known fields) before upserting to Cosmos DB.
Auto-Transition After Setup
After the wizard completes:- The client calls
POST /server/setup/complete - The server’s setup monitor (polling every 5s) detects that
isSettingsReady()now returnstrue - The server calls
initializeApp()which:- Initializes the
SettingsService(loads settings from Cosmos DB, creates default endpoints) - Starts the settings auto-refresh timer (every 5 minutes)
- Mounts authentication middleware and all application routes
- Starts background schedulers (purge, memory cleanup, ephemeral cleanup, etc.)
- Initializes notification providers (Teams, Slack, email)
- Initializes the
- The client’s review step shows a countdown, then redirects to the main app at
/
Wizard State Persistence
The wizard persists its state tolocalStorage (key: findable-setup-wizard-state) so progress survives page refreshes. Secrets (graphClientSecret) are excluded from persistence. Saved state older than 24 hours is automatically discarded to prevent stale data from abandoned setup attempts.
Setup API Endpoints
All setup endpoints are unauthenticated (mounted before auth middleware) and only available when the app is not fully initialized.Post-Setup: Bootstrap Assets
After initial setup, an administrator should seed the application with default content:- Navigate to Admin → Bootstrap Assets ([
#/admin/bootstrap]) - Click Bootstrap All to create:
- Tool providers — Built-in tools (Internal Cosmos DB Query, etc.)
- MCP servers — Default MCP server configurations
- Model endpoints — Templates for major LLM providers (Azure OpenAI, OpenAI, Anthropic, Gemini, etc.)
- Organizational prompts — Starter prompt templates
- Organizational flows — Built-in flows (Chat with My Data, Chat with My History)
- Pages & chats — Default navigation structure with sample chats
- Essential chats — Standalone chats for smaller deployments
Bootstrap operations are idempotent — running them again will skip existing resources and only create missing ones. Use the forceUpdate option to update existing items while preserving keys and enabled states.