|
| 1 | +# Site Architecture — The Salesforce CTA Exam Guide |
| 2 | + |
| 3 | +How the Docusaurus rebuild ("Schematic on the Pad" design) fits together: what lives where, |
| 4 | +how a page gets built and deployed, and the invariants that keep the custom parts working. |
| 5 | + |
| 6 | +Last updated: 2026-08-19 (initial Docusaurus rebuild). |
| 7 | + |
| 8 | +--- |
| 9 | + |
| 10 | +## 1. The big picture |
| 11 | + |
| 12 | +```mermaid |
| 13 | +flowchart LR |
| 14 | + subgraph repo["Repository (main branch)"] |
| 15 | + content["website/docs/*.md<br/>38 study guides"] |
| 16 | + config["website/docusaurus.config.ts<br/>website/sidebars.ts"] |
| 17 | + theme["website/src/<br/>homepage + theme + CSS"] |
| 18 | + assets["website/static/img/<br/>diagrams & ERDs (~13 MB)"] |
| 19 | + legacy["docs/ + mkdocs.yml<br/>(legacy mkdocs — retired,<br/>safe to delete)"] |
| 20 | + end |
| 21 | +
|
| 22 | + subgraph ci["GitHub Actions (.github/workflows/deploy-docs.yml)"] |
| 23 | + install["npm ci"] --> build["npm run build<br/>(docusaurus build, strict links)"] |
| 24 | + build --> artifact["upload-pages-artifact<br/>website/build/"] |
| 25 | + end |
| 26 | +
|
| 27 | + subgraph hosting["GitHub Pages"] |
| 28 | + deploy["deploy-pages (OIDC)"] |
| 29 | + domain["the-salesforce-cta-exam-guide.com<br/>(custom domain set in repo Pages settings)"] |
| 30 | + end |
| 31 | +
|
| 32 | + repo -- "push to main" --> ci |
| 33 | + artifact --> deploy --> domain |
| 34 | +``` |
| 35 | + |
| 36 | +- **Everything the live site needs is under [`website/`](.).** The old mkdocs files at the repo |
| 37 | + root (`docs/`, `mkdocs.yml`, `setup_docs.py`) are no longer used by the build and can be |
| 38 | + deleted once the new site is confirmed live. |
| 39 | +- The workflow builds with **strict link checking** (`onBrokenLinks: 'throw'`) — a broken |
| 40 | + internal link fails CI instead of shipping a 404. |
| 41 | +- The custom domain is configured in **GitHub repo Settings → Pages**, not in the repo. |
| 42 | + `url` in `docusaurus.config.ts` must stay `https://the-salesforce-cta-exam-guide.com` |
| 43 | + (it drives canonicals and the sitemap). |
| 44 | + |
| 45 | +## 2. Source layout — what each piece does |
| 46 | + |
| 47 | +```mermaid |
| 48 | +flowchart TB |
| 49 | + subgraph website["website/"] |
| 50 | + pkg["package.json<br/>Docusaurus 3 + theme-mermaid<br/>+ easyops local search"] |
| 51 | + cfg["docusaurus.config.ts<br/>site meta · navbar dropdowns ·<br/>footer · color modes · fonts"] |
| 52 | + side["sidebars.ts<br/>explicit sidebar: Start Here +<br/>8 categories (LDV appears twice via type: ref)"] |
| 53 | +
|
| 54 | + subgraph src["src/"] |
| 55 | + css["css/custom.css<br/>THE design system:<br/>pad light + Night Bench dark tokens,<br/>navbar/footer/doc-page styling,<br/>breakpoint media queries"] |
| 56 | + page["pages/index.tsx (+ .module.css)<br/>homepage: hero, FIG 1, section index,<br/>worked example, coaching"] |
| 57 | + comp["components/SchematicDiagram.tsx<br/>(+ .module.css)<br/>clickable SVG: §00 overview +<br/>§01–§07 domains wired to the board"] |
| 58 | + swz["theme/Navbar/MobileSidebar/index.tsx<br/>SWIZZLE: hamburger below 1500px<br/>instead of Docusaurus's 996px"] |
| 59 | + end |
| 60 | +
|
| 61 | + subgraph docsdir["docs/ (content — edit HERE, not root docs/)"] |
| 62 | + sh["start-here.md"] |
| 63 | + cats["exam-overview/ · system-architecture/ ·<br/>security/ · data/ · solution-architecture/ ·<br/>integration/ · development-lifecycle/ ·<br/>communication/"] |
| 64 | + end |
| 65 | +
|
| 66 | + static["static/img/<br/>CTA_Diagrams · CTA_OOTB_Object_ERDs ·<br/>CTA_Repo_Images · logo.svg · favicon.svg"] |
| 67 | + end |
| 68 | +
|
| 69 | + cfg --> side |
| 70 | + page --> comp |
| 71 | + cfg -. "customCss" .-> css |
| 72 | + cats -. "referenced as /img/... " .-> static |
| 73 | +``` |
| 74 | + |
| 75 | +Key relationships: |
| 76 | + |
| 77 | +| Piece | Role | Notes | |
| 78 | +|---|---|---| |
| 79 | +| `docusaurus.config.ts` | Single source of site-wide config | Navbar's 8 category dropdowns are defined here and must mirror `sidebars.ts` when pages are added | |
| 80 | +| `sidebars.ts` | Doc sidebar structure | Adding a new guide = add the `.md` file **and** register it here (and in the navbar dropdown if desired) | |
| 81 | +| `src/css/custom.css` | The whole visual theme | All colors come from `--pad-*` / `--schematic-*` CSS variables; dark mode redefines the same variables under `[data-theme='dark']` | |
| 82 | +| `src/pages/index.tsx` | Homepage | Holds the `DOMAINS` array (numbers, blurbs, guide counts, links) — update counts here when guides are added | |
| 83 | +| `SchematicDiagram.tsx` | FIG 1 | Click a node → `onSelectDomain` → homepage scrolls to and pulse-highlights the matching card (`domain-<key>` ids); selection state flows back down to highlight the SVG node | |
| 84 | +| `theme/Navbar/MobileSidebar/` | Breakpoint override | See invariant #1 below | |
| 85 | + |
| 86 | +## 3. Navigation at each screen width |
| 87 | + |
| 88 | +```mermaid |
| 89 | +flowchart LR |
| 90 | + w1["≥ 1500px"] --> full["Full navbar:<br/>Start Here + 8 category dropdowns<br/>+ GitHub/YouTube icons.<br/>Navbar is static & wrap-safe."] |
| 91 | + w2["997–1499px"] --> ham1["Hamburger menu (top)<br/>+ regular doc sidebar (left)<br/>on doc pages"] |
| 92 | + w3["≤ 996px"] --> ham2["Docusaurus native mobile:<br/>hamburger opens the docs sidebar,<br/>'Back to main menu' → categories"] |
| 93 | +``` |
| 94 | + |
| 95 | +The search box (offline local search — no Algolia account) and the light/dark toggle are |
| 96 | +present at every width. |
| 97 | + |
| 98 | +## 4. Invariants — read before touching the navbar or theme |
| 99 | + |
| 100 | +1. **The 1500px hamburger breakpoint lives in TWO places** and they must match: |
| 101 | + `HAMBURGER_BELOW_PX` in `src/theme/Navbar/MobileSidebar/index.tsx` and the |
| 102 | + `1499px`/`1500px` media queries in `src/css/custom.css`. Docusaurus hard-codes its own |
| 103 | + switch at 996px; the swizzle exists solely to let the slide-out menu render above that. |
| 104 | +2. **Never put `filter`/`backdrop-filter` on `.navbar`.** The mobile slide-out menu is a |
| 105 | + `position: fixed` child of the navbar; a filter makes the navbar its containing block and |
| 106 | + clips the menu to the navbar's box. |
| 107 | +3. **Never set `overflow` on `.navbar-sidebar__items`.** Docusaurus slides that wrapper |
| 108 | + horizontally to switch main ↔ docs menu; a scroll container there blanks the menu on |
| 109 | + doc pages. Each panel inside it scrolls on its own. |
| 110 | +4. **At ≥1500px, `--ifm-navbar-height` is intentionally `0`** because the navbar is static |
| 111 | + (scrolls away) and allowed to wrap to two rows; the sticky doc sidebar/TOC offsets derive |
| 112 | + from that variable. Don't "fix" it back to 4rem without also making the navbar |
| 113 | + fixed-height again. |
| 114 | +5. **Markdown is CommonMark, not MDX** (`markdown.format: 'detect'` + `.md` extensions). |
| 115 | + That's what lets the migrated content keep raw HTML `<img>` tags and literal `{`/`<` |
| 116 | + characters. Don't rename content files to `.mdx` casually. |
| 117 | +6. **Mermaid code fences work in any guide** (```mermaid) via `@docusaurus/theme-mermaid` — |
| 118 | + three exist today in `integration/oauth-flows-iam.md`. |
| 119 | + |
| 120 | +## 5. Common tasks |
| 121 | + |
| 122 | +| Task | Where | |
| 123 | +|---|---| |
| 124 | +| Add/edit a study guide | `website/docs/<category>/<slug>.md` + `sidebars.ts` (+ navbar dropdown in `docusaurus.config.ts`) | |
| 125 | +| Add an image | Drop under `website/static/img/…`, reference as `/img/…` | |
| 126 | +| Change colors/fonts | `src/css/custom.css` variables (light in `:root`, dark under `[data-theme='dark']`) | |
| 127 | +| Change homepage copy/counts | `src/pages/index.tsx` (`DOMAINS`, hero, stats) | |
| 128 | +| Change the FIG 1 diagram | `src/components/SchematicDiagram.tsx` (geometry mirrors `design-mockups/21-merge-schematic-on-pad-home.html`) | |
| 129 | +| Preview locally | `cd website && npm start` (dev) or `npm run build && npm run serve` (prod build) | |
| 130 | +| Deploy | Commit + push to `main` — CI does the rest | |
| 131 | + |
| 132 | +## 6. SEO layer |
| 133 | + |
| 134 | +- **Old-URL redirects** — [`redirects.ts`](redirects.ts) maps every old mkdocs URL (e.g. |
| 135 | + `/06)-OAuth-Flows-&-Identity-and-Access-Management/`) to its new route via |
| 136 | + `@docusaurus/plugin-client-redirects`, preserving indexed rankings, backlinks, and |
| 137 | + bookmarks. **If a doc's route ever changes, add its old route here.** |
| 138 | +- **`trailingSlash: true`** — directory-style URLs so GitHub Pages serves pages without a |
| 139 | + 301 hop, matching the old mkdocs URL style the redirects catch. Don't change it. |
| 140 | +- **Social card** — `static/img/social-card.png` (1200×630, pad-style), wired via |
| 141 | + `themeConfig.image`; used as `og:image`/`twitter:image` on every page. Source SVG design |
| 142 | + mirrors the site theme; regenerate with any SVG→PNG rasterizer if it needs edits. |
| 143 | +- **`static/robots.txt`** — allows all crawlers and points at `/sitemap.xml` (generated |
| 144 | + automatically by the classic preset on every build). |
| 145 | +- **Images** — everything in `static/img/` is compressed (lossless-ish palette PNG / |
| 146 | + mozjpeg, ~12MB → ~4MB). Compress new images before committing; the pristine originals |
| 147 | + still exist under the legacy root `docs/assets/images/`. |
| 148 | +- **Manual/ongoing** (not in code): verify the domain in Google Search Console and submit |
| 149 | + the sitemap; add `description` front matter to docs; flesh out stub pages (Mulesoft, |
| 150 | + Service Cloud, Board Presentation Tips, Lucidchart Tips); keep external profiles |
| 151 | + (GitHub repo website field, YouTube) linking the custom domain. |
| 152 | + |
| 153 | +## 7. Design lineage |
| 154 | + |
| 155 | +The visual direction is **"Schematic on the Pad"** — mockup 21 in |
| 156 | +[`design-mockups/`](../design-mockups/index.html) (a merge of mockup 13 *Engineer's Pad* and |
| 157 | +mockup 20 *Schematic*). Dark mode is mockup 23 *Night Bench*. The mockup hub at |
| 158 | +`design-mockups/index.html` documents all 23 explored directions. |
0 commit comments