Public Sites Refactor Notes
This pass refactored the static/browser-facing apps around clearer entrypoints and feature ownership without changing the generated site behavior:
Public Sites Refactor Notes
Scope
This pass refactored the static/browser-facing apps around clearer entrypoints and feature ownership without changing the generated site behavior:
apps/cloud-adminapps/docs-siteapps/website
What Moved Where
Cloud Admin
- main.ts - supportConsole.ts - theme.ts - api.ts - dom.ts - state.ts - types.ts - config.ts
- buildSite.ts - renderLayout.ts - renderBody.ts
src/admin-client.tsis now a thin bootstrap.src/admin/owns the browser runtime:src/site/owns the static site builder:src/shared/themeTypography.tsholds shared font metadata.
Docs Site
- buildDocsSite.ts - config.ts - types.ts - utils.ts - metadata.ts - markdown.ts - render.ts
src/site.tsis now a thin bootstrap/export surface.src/site/owns the docs build flow:- Docs now use env-backed public site links instead of workspace-relative cross-app links, which fixes broken localhost navigation between Docs and Website.
Website
- main.ts - pages.ts - api.ts - dom.ts - validation.ts - types.ts - config.ts
- buildSite.ts - layout.ts - marketingPages.ts - accountPages.ts - pages.ts - types.ts - config.ts
src/account-client.tsis now a thin bootstrap.src/account/owns account-portal browser behavior:src/build-site.tsis now a thin bootstrap.src/site/owns the static marketing/account site builder:src/site-client.tsowns lightweight public-page behavior such as the Contact Us form submit flow.- Public docs/install destinations are now externalized through
HARBOR_WEBSITE_DOCS_URLandHARBOR_WEBSITE_INSTALL_URL, and the website no longer generates internal/docs/or/install/marketing pages. - Website marketing now includes first-class
/about/and/contact/pages, and contact submissions are stored in cloud data for admin review.
Shared chrome additions
- Harbor-style sticky top header - a horizontal tab row under the header - a shared two-column sitemap footer
- About - Contact - Gitea Repo - Docs - Website - Hub
- HARBOR_PUBLIC_WEBSITE_URL - HARBOR_PUBLIC_DOCS_URL - HARBOR_PUBLIC_HUB_URL - HARBOR_PUBLIC_REPO_URL - HARBOR_CONTACT_EMAIL - HARBOR_CONTACT_SEND_EMAIL
- Website, Docs, and Cloud Admin now share the same broad shell direction:
- The left sitemap column is app-specific.
- The right sitemap column is shared corporate navigation linking to:
- Shared public link config now comes from env-backed build-time values:
Intentional Deviations
- The website page factory layer is split into
marketingPages.tsandaccountPages.tsinstead of one giantpages.ts. This keeps the account portal and public marketing content easy to navigate without fragmenting the builder into tiny files. - The website account runtime stayed framework-free and DOM-driven to preserve the current implementation style.
Technical Debt Left Behind
apps/cloud-admin/src/admin/supportConsole.tsis still the largest remaining module in this set and could be split by screen/feature later.apps/docs-site/src/site/render.tsstill combines layout styling and doc-page rendering. It is much better than the previous monolith, but it remains the most likely future extraction point.apps/website/src/site/layout.tsstill owns a large inline CSS block. If the public site grows meaningfully, that CSS should move to a dedicated shared asset or typed style helper.
Suggested Next Targets
- Refactor
apps/cloud-apiif the route/controller surface has started accumulating multiple product concerns. - Review
apps/harbor-node-apifor the same kind of domain-controller extraction that worked well in NodeUI. - Decide whether the static-site apps should eventually share a small internal helper package for theme/bootstrap loading and common layout utilities.