mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 20:41:09 +02:00
SvelteKit hook + new DB table + founder-gated API + UI section. Ships
the code path for public-site routing on {slug}.mana.how and custom
hostnames. Cloudflare SaaS Hostnames integration is stubbed — see
plan §M6 "Offene Enden".
apps/api/src/modules/website:
- schema.ts: new `customDomains` table. Fields: id, site_id, hostname
(unique), status (pending | verifying | verified | failed),
verification_token, dns_target, verified_at.
- drizzle/website/0002_custom_domains.sql: manual migration with
partial unique index on (hostname) WHERE status='verified'.
- domains.ts (new, authenticated + founder-gated via
`requireTier('founder')`): POST/GET/DELETE /sites/:id/domains,
POST /sites/:id/domains/:domainId/verify. Verify runs CNAME + TXT
checks via node:dns/promises with an apex-domain A-record fallback.
Reserved-hostname list prevents users from binding mana.how subdomains.
- public-routes.ts: new GET /public/resolve-host?host= — unauthenticated
resolver used by hooks.server.ts. Returns { slug, siteId } only for
verified bindings tied to a currently-published site.
apps/mana/apps/web/src/hooks.server.ts:
- After the existing https/app-subdomain guards, a new
`resolveWebsiteRewrite()` step rewrites `event.url.pathname`:
{slug}.mana.how/path → /s/{slug}/path (pure string)
custom-host.com/path → /s/{resolved}/path (API call, 60s LRU)
- Browser URL stays on the custom host — this is a server-side rewrite,
not a 302. APP_SUBDOMAINS + RESERVED_WEBSITE_SUBDOMAINS win over
website routing. Localhost and apex mana.how are skipped.
apps/mana/apps/web/src/lib/modules/website:
- domains.ts (new): typed client for list/add/verify/remove. Handles
200 + expected 400 (verification-failed) separately.
- components/DomainsSection.svelte: add-input, per-domain status pill,
DNS-instructions box (CNAME + TXT with copy-to-clipboard), Verify
button. Mounted inside SiteSettingsDialog as its own section — the
existing theme/footer controls stay put.
docs/plans/website-builder.md:
- M6 checklist updated with what shipped vs. ops-gap (CF SaaS).
- `mana-landing-builder` consolidation: DECIDED to keep parallel. Four
reasons in the plan. Revisit-criterion stated.
- Shipping log table seeded with M1→M6 commits.
Validation:
- pnpm run validate:all: 6/6 gates green
- pnpm run check (web): 0 errors, 0 warnings
- apps/api type-check: green
Apply schema with:
psql "$DATABASE_URL" -f apps/api/drizzle/website/0002_custom_domains.sql
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| architecture | ||
| central-services | ||
| decisions | ||
| future | ||
| modules | ||
| optimizable | ||
| plans | ||
| postmortems | ||
| reports | ||
| test-examples | ||
| ANALYTICS.md | ||
| APP_GAP_ANALYSIS.md | ||
| APP_ONBOARDING.md | ||
| ARCHITECTURE_MIGRATION_REPORT.md | ||
| CAPACITY_PLANNING.md | ||
| CARDS_POSTGRES_MIGRATION.md | ||
| CLOUDFLARE_DOMAINS.md | ||
| CLOUDFLARE_FALLBACK.md | ||
| CLUSTER_HARDWARE_ANALYSE.md | ||
| complexity-hotspots.md | ||
| complexity-map.html | ||
| CONTEXT_INTELLIGENCE_REPORT.md | ||
| DATABASE_MIGRATIONS.md | ||
| DEPLOYMENT.md | ||
| DEVELOPMENT_SCRIPTS.md | ||
| DEVLOG_GUIDELINES.md | ||
| DISCORD_NOTIFICATIONS_SETUP.md | ||
| DOCKER_GUIDE.md | ||
| ENVIRONMENT_VARIABLES.md | ||
| ERROR_TRACKING.md | ||
| EXPO_SDK_UPGRADE.md | ||
| EXTERNAL_SERVICES.md | ||
| EXTERNAL_SSD_OPPORTUNITIES.md | ||
| FIX_COLIMA_MOUNTS.md | ||
| GIT_WORKFLOW.md | ||
| I18N.md | ||
| LOCAL_DEVELOPMENT.md | ||
| LOCAL_LLM_MODELS.md | ||
| LOCAL_STT_MODELS.md | ||
| MAC_MINI_SERVER.md | ||
| MAIL_SERVER.md | ||
| MANA_BOX_HARDWARE.md | ||
| MANA_EARNING_SYSTEM.md | ||
| MANA_VALUES.md | ||
| MICROSERVICES_API_OVERVIEW.md | ||
| MOBILE_DESKTOP_APP_STRATEGY.md | ||
| module-coupling.md | ||
| module-health.md | ||
| MODULE_REGISTRY.md | ||
| MONETIZATION_REPORT.md | ||
| MONITORING.md | ||
| OBSERVABILITY_GAPS.md | ||
| OLLAMA_MODELS.md | ||
| PLAN_TAURI_V2.md | ||
| PORT_SCHEMA.md | ||
| POSTGRES_BACKUP.md | ||
| PRE_LAUNCH_CLEANUP.md | ||
| PROD_READINESS_SCORE.md | ||
| PROJECT_OVERVIEW.md | ||
| PWA_GUIDE.md | ||
| RECOMMENDED_SERVICES.md | ||
| REFACTORING_AUDIT_2026_04.md | ||
| SEPA_ACTIVATION_CHECKLIST.md | ||
| SETUP_TEMPLATES.md | ||
| SHARED_PACKAGES_ROADMAP.md | ||
| SYNC_BILLING_PLAN.md | ||
| TECH_STACK_INDEPENDENCE.md | ||
| TECHNOLOGY_AUDIT_2026_03.md | ||
| TESTING_DEPLOYMENT_CHECKLIST.md | ||
| URL_SCHEMA.md | ||
| USER_SETTINGS.md | ||
| VERSIONING.md | ||
| WHO_MODULE.md | ||
| WINDOWS_GPU_SERVER_SETUP.md | ||