Bläddra i källkod

docs: pin landing sample values, cache headers, Vite entry

AI-Co-Authored-By: Grok
chendeben 1 månad sedan
förälder
incheckning
c9d032a4c3
1 ändrade filer med 17 tillägg och 5 borttagningar
  1. 17 5
      docs/superpowers/specs/2026-07-09-mailhub-landing-page-design.md

+ 17 - 5
docs/superpowers/specs/2026-07-09-mailhub-landing-page-design.md

@@ -45,7 +45,8 @@ Replace the current “anonymous root URL → login/admin app” experience with
    - Else → `landing.html`.
 3. Do **not** redirect anonymous `/` to `/login`.
 4. Keep `/api/*` auth unchanged.
-5. Optional: `GET /app` → admin when authed, else `/login` (deep link from landing CTAs if desired). Landing primary CTAs may simply use `/register` and `/login`.
+5. **Caching:** Root HTML responses that depend on session (`GET /` landing vs admin) MUST be non-cacheable: e.g. `Cache-Control: private, no-store` (and prefer the same for `landing.html` / `index.html` HTML documents) so proxies/browsers do not stick a visitor on the wrong shell after login.
+6. **`/app` alias:** out of MVP; primary CTAs use `/register` and `/login` only.
 
 ## Information Architecture (single page)
 
@@ -101,6 +102,16 @@ Replace the current “anonymous root URL → login/admin app” experience with
 - Product name, Log in, Register, optional GitHub link  
 - Copyright line  
 
+## Static sample content policy
+
+Landing is **fully static** (no authenticated API on first paint).
+
+- Use **placeholders** for host/base URL: `https://mail.example.com`, host `mail.example.com` (or “your MailHub host” in prose).
+- Document **default public SMTP ports** from product defaults: `25` (smtp), `587` (smtp/STARTTLS), `465` (smtps), `2525` (smtp). Do not hardcode a specific production hostname from env.
+- **Forbidden in MVP:** unauthenticated config API for landing; build-time injection of production `.env` into landing assets.
+- API sample fields match product helpers: `from`, `to`, `subject`, `text`; header `Authorization: Bearer <USER_API_TOKEN>`.
+- Webhook samples: events `sent` | `bounced` | `failed`; payload `type` `email.sent` / `email.bounced` / `email.failed`; header `X-MailHub-Signature: t=…,v1=…`.
+
 ## Visual Design
 
 - CSS variables aligned with admin redesign:
@@ -120,14 +131,15 @@ Replace the current “anonymous root URL → login/admin app” experience with
 
 ## Engineering
 
-### Build
+### Build (committed path)
 
-Add Vite multi-page entry alongside existing `index` and `login`:
+**Vite multi-page entry only** (same pipeline as `index` / `login`):
 
-- Source: `landing.html` at repo root (or under a dedicated path) + `src/frontend/landing/main.ts` + `landing.css`
+- Source: repo-root `landing.html` + `src/frontend/landing/main.ts` + `landing.css` + i18n dictionary
+- `vite.config.ts` input key: `landing`
 - Output: `public/landing.html` + hashed assets under `public/assets/`
 
-Alternatively pure static files under `public/` without TS if simpler—prefer Vite entry for consistency with login/admin pipeline.
+Do not maintain a parallel hand-written-only `public/landing.html` source of truth outside the Vite build.
 
 ### Client behavior