import { useState } from "react"; import { Link } from "wouter"; import Container from "@mui/material/Container"; import Paper from "@mui/material/Paper"; import TextField from "@mui/material/TextField"; import Button from "@mui/material/Button"; import Alert from "@mui/material/Alert"; import { healthCheck, organizationSchema } from "@/lib/api"; import { usePlatform } from "@/lib/platform"; import { ApiNotice } from "@/components/ApiNotice"; import "./workspace.css"; export default function ConnectionPage() { const { organization, setOrganization, principal, signOut } = usePlatform(); const [draft, setDraft] = useState(organization); const [error, setError] = useState(null); const [saved, setSaved] = useState(false); const [busy, setBusy] = useState(false); const [checks, setChecks] = useState[] | null>( null, ); const [checking, setChecking] = useState(false); async function check() { setChecking(true); setChecks(null); setChecks( await Promise.allSettled([healthCheck("live"), healthCheck("ready")]), ); setChecking(false); } return (

Platform Connection

Connect to your organization on the deployed Mani Candles backend.

Organization

Use the organization UUID returned by the backend owner bootstrap. Public account registration is not available.

{ event.preventDefault(); setSaved(false); setError(null); const result = organizationSchema.safeParse(draft.trim()); if (!result.success) { setError(new Error("Enter a valid organization UUID.")); return; } setBusy(true); try { if (principal && result.data !== organization) await signOut(); setOrganization(result.data); setSaved(true); } catch (error) { setError(error); } finally { setBusy(false); } }} > { setDraft(event.target.value); setSaved(false); }} helperText="Only the organization ID is saved locally; credentials are not." /> {saved && ( Connection saved.{" "} Browse candles {" "} or{" "} sign in . )}

Service checks

{checks?.map((result, index) => (
{index ? "Database readiness" : "Service liveness"}:{" "} {result.status === "fulfilled" ? "Passed" : "Failed"} {result.status === "rejected" && ( )}
))}

Open API documentation ↗

); }