Files
c0py/apps/web/src/app/page.tsx
T
Claude CodeandClaude Opus 5 a1b3fef1ac
CI (SIAX Cloud) / sonar (push) Skipped
CI (SIAX Cloud) / security (push) Successful in 16s
CI (SIAX Cloud) / contracts (push) Successful in 31s
Component conformance / Component conformance (blocking) (push) Failing after 45s
CI (SIAX Cloud) / quality (push) Successful in 1m53s
CI (SIAX Cloud) / sonar (pull_request) Skipped
CI (SIAX Cloud) / security (pull_request) Successful in 35s
security / scan (pull_request) Failing after 26s
Component conformance / Component conformance (blocking) (pull_request) Failing after 46s
CI (SIAX Cloud) / contracts (pull_request) Successful in 50s
CI (SIAX Cloud) / quality (pull_request) Successful in 2m15s
fix(web): byt ut platshallarsidan mot en riktig C0PY-konsol
c0py.siax.io och c0py-web.siax.io renderade bokstavligen <div>c0py</div>
(4 tecken synlig text) - rotsidan var en platshallare i repot, inte ett
driftfel. Headless-matning 2026-11-11 fran server11: HTTP 200, tom title,
textLen=4, 0 lankar, 0 knappar.

Rotsidan renderar nu riktigt innehall grundat i repots egna fakta:

* produktidentitet och syfte ur README.md,
* LIVE API-status last server-side ur API:ets egen publika /health
  (status, CL0UD-bindning, API-tid, lastid) - och en uttrycklig
  "kunde inte lasas"-text nar API:et inte svarar, aldrig en pahittad status,
* den faktiska API-ytan (/health publik, /v1/c0py/registries|scans bearer)
  enligt apps/api/src,
* den kanoniska pipelinen ur README/MASTERPLAN.

Dessutom:
* /api/health for c0py-web (status, commit, apiBaseUrl) - samma monster som
  ovriga SIAX-produkter; Dockerfile.web skriver commit till /app/.c0py-commit
  och HEALTHCHECK pekar nu pa /api/health i stallet for /,
* app/icon.svg - c0py-surfacen gav 404 pa /favicon.ico vid varje sidladdning,
* 7 enhetstester for statuslasningen (inkl. att fel och timeout INTE
  rapporteras som ok) ersatter noop-testet.

SIAX-design: Inter, blacksvart rubrik #15151B, violett sidkant #5326CC,
morkt identitetsfalt. Inga nya beroenden (lockfilen oforandrad), inga lokala
DES1GN-primitivnamn exporteras.

Verifierat lokalt: validate:architecture OK, typecheck OK, 7/7 webbtester,
next build OK, next start ger 1475 tecken synlig text och /api/health 200
med live API-status (HTTP 200, status ok, cl0ud disabled).

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-11-11 01:10:48 +01:00

135 lines
5.1 KiB
TypeScript

import { API_SURFACE, PIPELINE, apiBaseUrl, fetchApiStatus } from "../lib/api-status";
export const dynamic = "force-dynamic";
const band: React.CSSProperties = {
background: "var(--c0py-band)",
color: "#f6f6fa",
padding: "1.1rem 1.5rem",
display: "flex",
gap: "0.9rem",
alignItems: "baseline",
flexWrap: "wrap",
};
const shell: React.CSSProperties = {
maxWidth: 1020,
margin: "0 auto",
padding: "2rem 1.5rem 3.5rem",
borderLeft: "4px solid var(--c0py-accent)",
};
const panel: React.CSSProperties = {
border: "1px solid var(--c0py-line)",
borderRadius: 10,
padding: "1.1rem 1.25rem",
marginTop: "1.25rem",
};
const th: React.CSSProperties = {
textAlign: "left",
borderBottom: "1px solid var(--c0py-line)",
padding: "0.45rem 0.6rem",
fontSize: "0.78rem",
textTransform: "uppercase",
letterSpacing: "0.06em",
color: "var(--c0py-muted)",
};
const td: React.CSSProperties = {
borderBottom: "1px solid var(--c0py-line)",
padding: "0.45rem 0.6rem",
verticalAlign: "top",
};
export default async function Home() {
const base = apiBaseUrl();
const api = await fetchApiStatus(base);
return (
<>
<div style={band}>
<strong style={{ fontSize: "1.15rem", letterSpacing: "0.04em" }}>C0PY</strong>
<span style={{ color: "#b9b4d8", fontSize: "0.9rem" }}>
SIAX · evidence-driven capture, digital-twin specification and verification
</span>
</div>
<main style={shell}>
<h1 style={{ fontSize: "1.9rem", marginBottom: "0.6rem" }}>Capture console</h1>
<p style={{ color: "var(--c0py-muted)", maxWidth: 760, marginTop: 0 }}>
C0PY consumes an authorized web target and produces a versioned Evidence Graph / Canonical IR
covering routes, DOM and runtime state, styles, assets, responsive behaviour, interactions,
workflows, network contracts, motion, accessibility and product topology. Reconstruction
builders consume frozen C0PY specs; they never become the source of truth.
</p>
<section style={panel} aria-labelledby="api-status-heading">
<h2 id="api-status-heading" style={{ fontSize: "1.05rem" }}>API status</h2>
{api.reachable ? (
<p style={{ margin: "0.5rem 0 0" }}>
<span style={{ color: "var(--c0py-ok)", fontWeight: 600 }}>
{base} answered HTTP {api.httpStatus}: status {api.status}
</span>
<br />
<span className="mono" style={{ color: "var(--c0py-muted)" }}>
CL0UD binding: {api.cl0ud ?? "not reported"} · API time: {api.timestamp ?? "not reported"} · read at{" "}
{api.checkedAt}
</span>
</p>
) : (
<p style={{ margin: "0.5rem 0 0" }}>
<span style={{ color: "var(--c0py-warn)", fontWeight: 600 }}>
{base} could not be read ({api.reason}
{api.httpStatus ? `, HTTP ${api.httpStatus}` : ""}).
</span>
<br />
<span className="mono" style={{ color: "var(--c0py-muted)" }}>
This console reports what it measured at {api.checkedAt}; it does not invent a status.
</span>
</p>
)}
</section>
<section style={panel} aria-labelledby="surface-heading">
<h2 id="surface-heading" style={{ fontSize: "1.05rem" }}>API surface</h2>
<p style={{ color: "var(--c0py-muted)", marginTop: "0.4rem" }}>
The routes the C0PY API serves today. Everything except <code>/health</code> requires a bearer
token; this console never asks for one and never stores one.
</p>
<table style={{ borderCollapse: "collapse", width: "100%" }}>
<thead>
<tr>
<th style={th}>Method</th>
<th style={th}>Path</th>
<th style={th}>Access</th>
<th style={th}>Purpose</th>
</tr>
</thead>
<tbody>
{API_SURFACE.map((route) => (
<tr key={`${route.method} ${route.path}`}>
<td style={td} className="mono">{route.method}</td>
<td style={td} className="mono">{route.path}</td>
<td style={td}>{route.auth}</td>
<td style={td}>{route.purpose}</td>
</tr>
))}
</tbody>
</table>
</section>
<section style={panel} aria-labelledby="pipeline-heading">
<h2 id="pipeline-heading" style={{ fontSize: "1.05rem" }}>Canonical pipeline</h2>
<ol style={{ margin: "0.6rem 0 0", paddingLeft: "1.3rem", color: "var(--c0py-ink)" }}>
{PIPELINE.map((step) => (
<li key={step} style={{ marginBottom: "0.2rem" }}>{step}</li>
))}
</ol>
</section>
<p style={{ marginTop: "1.6rem", color: "var(--c0py-muted)", fontSize: "0.85rem" }}>
C0PY web · own liveness at <a href="/api/health">/api/health</a> · API liveness at{" "}
<a href={`${base}/health`}>{base}/health</a>
</p>
</main>
</>
);
}