demo: keep public landing page as root

This commit is contained in:
Marco Allegretti 2026-01-29 10:56:34 +01:00
parent 0db4cf7a94
commit 593e53a846
2 changed files with 55 additions and 33 deletions

View file

@ -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://<host>:4322`
- Backend API: `http://<host>: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.

View file

@ -1,39 +1,6 @@
--- ---
export const prerender = false; export const prerender = false;
import PublicLayout from '../layouts/PublicLayout.astro'; 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');
}
--- ---
<PublicLayout title="Modular Governance Engine"> <PublicLayout title="Modular Governance Engine">