Skip to content

Running The UI

Run the UI from the monorepo root:

Terminal window
pnpm dev:ui

Build it for production:

Terminal window
pnpm build:ui

Preview the production build:

Terminal window
pnpm preview:ui
VariableDefaultPurpose
VITE_API_URLhttp://localhost:3000Base URL for the API app
VITE_DEFAULT_API_URLPreferred default API URL when multiple URLs are configured
VITE_API_URLSJSON map of named API URLs
VITE_SHOW_INSTANCE_SELECTORdev modeForces API instance selector behavior
VITE_NETWORK_IDfirst returned networkComma-separated allowlist of network ids to expose in the UI
VITE_MAP_PROVIDERleafletActive registered map provider
VITE_GEOCODING_API_URLapi.postalpincode.inPincode geocoding endpoint
VITE_VC_WALLET_URLBase URL for the wallet credential service used by the Dhiway Wallet provider
VITE_VC_WALLET_API_KEYAPI key sent to the wallet credential service when fetching verified credentials
VITE_AGENT_URLBase URL for the DigiLocker agent service
VITE_AGENT_TOKENBearer token used for DigiLocker agent requests
CapabilityEndpoint
Network config discoveryGET /api/v1/network/schemas
Network-wide item browsingGET /api/v1/network/item/fetch
User-owned item discoveryGET /api/v1/item/fetch
Item creationPOST /api/v1/item/create
Item updatePATCH /api/v1/item/:itemId
Action submissionPOST /api/v1/action/perform
Action inbox/outboxGET /api/v1/action/fetch
Action event historyGET /api/v1/action/fetch-events
Action status updatesPOST /api/v1/action/update-status
OTP check/request/verify/api/auth/unified-otp/*
Session lookupGET /api/auth/get-session
Sign outPOST /api/auth/sign-out
Wallet code requestPOST <VITE_VC_WALLET_URL>/api/v1/auth/request-code
Wallet code verificationPOST <VITE_VC_WALLET_URL>/api/v1/auth/verify-code
Wallet credential fetchGET <VITE_VC_WALLET_URL>/api/v1/verified-credentials
DigiLocker authorization launchGET <VITE_AGENT_URL>/api/v1/discover/digilocker-request
DigiLocker credential pullPOST <VITE_AGENT_URL>/api/v1/discover/digilocker-auth

The UI expects /api/v1/network/schemas to include entries with kind === 'network_config'.

  1. HomePage fetches network configs from the API.
  2. ?network=<name> selects a configured network when present; otherwise the first configured or returned network is used.
  3. The selected config is resolved with resolveNetworkRefs().
  4. User-owned local items are fetched from local item APIs.
  5. Target domain items are fetched through network item APIs.
  6. Cards, forms, actions, maps, and action-management screens render from the loaded schemas and action APIs.
  • LoginPage supports both phone and email identifiers.
  • OTP verification stores the returned bearer token and hydrates the session in AuthProvider.
  • RequireAuth redirects protected routes to /auth/login?redirect=... and returns users to the original path after login.
  • The Import Credentials button appears on the profile form only when a schema is active and at least one wallet provider is configured.
  • Dhiway Wallet uses the signed-in user’s email or phone number as the identifier for code verification and credential retrieval.
  • DigiLocker opens an external popup flow and can finish either through a redirect bridge page or by manually pasting the returned code or redirect URL.
  • Imported values are merged into the active schema through alias-aware field matching instead of provider-specific per-form code.