diff --git a/docs/admin/demo-operations.md b/docs/admin/demo-operations.md new file mode 100644 index 0000000..0117256 --- /dev/null +++ b/docs/admin/demo-operations.md @@ -0,0 +1,55 @@ +# Demo Operations + +This document describes how to operate the public demo deployment. + +## What the demo is for + +The demo is intended for public browsing and for guided exploration of a pre-seeded instance. + +- The default landing page is informational. +- The demo includes seeded communities, proposals, delegations, and moderation history. +- Administrative setup is not part of the public demo experience. + +## Services and ports + +- Frontend: `http://:4322` +- Backend API: `http://:3001` +- Database: not exposed publicly (bound to localhost in VPS deployments) + +## Deploy/update (VPS) + +From the VPS, in the repo folder: + +- Bring up (or update) the demo: + + - `podman compose --env-file compose/.env.demo -f compose/demo.yml -f compose/demo.vps.override.yml up -d --build` + +- Pull latest code before rebuilding: + + - `git pull --ff-only` + +## Check health + +- Backend health endpoint: + - `GET /health` + +- Check containers: + - `podman ps` + +- Check logs: + - `podman logs likwid-demo-backend` + - `podman logs likwid-demo-frontend` + - `podman logs likwid-demo-db` + +## Reset the demo + +Resetting is destructive and recreates the demo database. + +- `podman compose --env-file compose/.env.demo -f compose/demo.yml -f compose/demo.vps.override.yml down -v` +- `podman compose --env-file compose/.env.demo -f compose/demo.yml -f compose/demo.vps.override.yml up -d --build` + +## Security notes + +- Keep the database port closed to the public internet. +- Prefer TLS and a reverse proxy once a domain is available. +- Treat demo credentials as public; the demo is not a private environment. diff --git a/frontend/src/pages/index.astro b/frontend/src/pages/index.astro index 8ca539d..12d3005 100644 --- a/frontend/src/pages/index.astro +++ b/frontend/src/pages/index.astro @@ -1,39 +1,6 @@ --- export const prerender = false; import PublicLayout from '../layouts/PublicLayout.astro'; -import { SERVER_API_BASE as serverApiBase } from '../lib/api'; - -let setupCompleted = false; -let platformMode: string | null = null; -let singleCommunitySlug: string | null = null; -let backendReachable = false; - -const resolvedServerApiBase = serverApiBase || Astro.url.origin; - -try { - const res = await fetch(`${resolvedServerApiBase}/api/settings/public`); - if (res.ok) { - const data = await res.json(); - backendReachable = true; - setupCompleted = !!data.setup_completed; - platformMode = data.platform_mode || null; - singleCommunitySlug = data.single_community_slug || null; - } -} catch (e) { - // Backend not available -} - -if (backendReachable) { - if (!setupCompleted) { - return Astro.redirect('/setup'); - } - - if (platformMode === 'single_community' && singleCommunitySlug) { - return Astro.redirect(`/communities/${singleCommunitySlug}`); - } - - return Astro.redirect('/communities'); -} ---