docs: tighten README quick start and stale comments
ci / check (push) Successful in 1m20s
ci / check (pull_request) Successful in 51s

- Lead with purpose and exact local/CI commands.
- Remove local absolute paths, stale auth notes and unverified claims.
- Keep comments to the reason or invariant they protect.
This commit is contained in:
Noel Sabia committed 2026-11-14 09:16:19 +01:00
1 parent dbb7a009a7
commit 66b80a62fb
14 files changed
+82 -84

No files matched your search

+5 -10
View File
@@ -1,6 +1,5 @@
// Server-side Go API client. Every Nitro route uses this module so the browser
// only ever talks to the Nuxt origin: the Go base URL and the control
// credentials stay in the Node process.
// Server-side Go API client. Nitro routes use it so the browser only talks to
// this origin and control credentials stay in the Node process.
interface ApiErrorEnvelope {
error?: { code?: string; message?: string }
@@ -39,7 +38,7 @@ export function apiBaseUrl(): string {
).replace(/\/+$/, '')
}
/** True only when NUXT_USE_MOCK=1 / NUXT_PUBLIC_USE_MOCK=1 is set. */
/** Mock mode is opt-in via NUXT_USE_MOCK or NUXT_PUBLIC_USE_MOCK (1/true). */
export function isMockMode(): boolean {
const config = useRuntimeConfig()
const raw =
@@ -54,8 +53,7 @@ function controlAuthorization(): string | undefined {
if (user && pass) return `Basic ${Buffer.from(`${user}:${pass}`).toString('base64')}`
const token = envValue('CONTROL_TOKEN', 'NUXT_CONTROL_TOKEN') || String(config.controlToken ?? '')
// Go currently validates Basic auth; Bearer is accepted here for the future
// token-based control surface without exposing the token to the browser.
// Go requires Basic today; Bearer is a fallback for a future token-based API.
if (token) return `Bearer ${token}`
return undefined
}
@@ -121,10 +119,7 @@ export async function apiRequest<T>(path: string, options: ApiRequestOptions = {
return response._data as T
}
/**
* Forward a request body (training upload) and preserve Go's status code and
* JSON body, including 202/400/409/502 responses that are part of the flow.
*/
/** Forward a training upload and keep Go's status code for 202/4xx/5xx. */
export async function apiForward<T>(
event: import('h3').H3Event,
path: string,
+2 -3
View File
@@ -1,6 +1,5 @@
// Server-side mock dataset. Shapes follow /home/noel/Documents/Hackathon_2026/CONTRACT.md.
// The files are imported (not read from disk at runtime) so the Nitro build bundles them
// into the SSR output and the app renders before the Go API exists.
// Server-side mock dataset. Shapes follow the Go API contract; files are imported
// so Nitro bundles them and mock mode renders without the Go API.
import context from '../../mock/context.json'
import demo from '../../mock/demo.json'
import meta from '../../mock/meta.json'
+1 -2
View File
@@ -18,8 +18,7 @@ export function createMockTrainJob(model: 'small' | 'forecast', filename: string
const now = new Date().toISOString()
const job: MockTrainJob = {
job_id: `mock-${Date.now().toString(36)}`,
// The mock completes immediately. Replace this with polling of GET /api/train/{job_id}
// once the Go/FastAPI service exists.
// The mock completes immediately; the real path polls GET /api/train/{job_id}.
status: 'succeeded',
model,
started_at: now,