# optimusjr/website architecture

> Architecture diagram of the GitHub repository optimusjr/website, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/optimusjr/website
- Repository: https://github.com/optimusjr/website

## Overview

#### Purpose and runtime
OPTIMUS Jr.’s public marketing website is a Next.js/React application, styled with Tailwind CSS. It serves institutional, service, landing-page, quote, and confirmation content, with static imagery under `public/`. Primary framework entry points are `src/app/layout.tsx` and App Router pages beneath `src/app/(main)/`.

#### Routing and document metadata
The App Router maps folder routes to site pages: home at `src/app/(main)/(index)/page.tsx`, institutional content at `src/app/(main)/about/page.tsx`, quote flow at `src/app/(main)/quote/page.tsx`, and specialized campaign content at `src/app/(main)/lp/lights/page.tsx`. Global web-discovery/PWA endpoints are implemented through `src/app/manifest.ts`, `src/app/robots.ts`, and `src/app/sitemap.ts`; the root fallback is `src/app/not-found.tsx`.

#### Shared site shell
The main route group applies a shared layout in `src/app/(main)/layout.tsx`, composed from reusable navigation, footer, and branding pieces in `src/app/(main)/_components/Layout/index.tsx`, `src/app/(main)/_components/Layout/Header/index.tsx`, and `src/app/(main)/_components/Layout/Footer.tsx`. This is the central boundary between page-specific composition and persistent navigation/chrome, including mobile navigation support.

#### Page composition and content domains
Pages are primarily compositions of route-local presentation sections. The home page organizes startup/hero, services, differentiators, benefits, and contact material in `src/app/(main)/(index)/_components/Start/index.tsx`, `src/app/(main)/(index)/_components/Services/index.tsx`, and `src/app/(main)/(index)/_components/Contact/index.tsx`. The about route has separate introductory, information, and showcase sections under `src/app/(main)/about/_components/`. Landing-page content is isolated under `src/app/(main)/lp/`, avoiding coupling campaign-specific content to the main home route.

#### Quote and form flow
The quote page delegates to `src/app/(main)/quote/_components/Quote.tsx`, backed by the reusable multi-step form system in `src/components/others/MultiPageForm/index.tsx`. Form progression and answers are managed through React context in `src/components/others/MultiPageForm/FormContext/index.tsx`; question rendering is separated into `src/components/others/MultiPageForm/Question/`. Form shape is defined by `src/quoteFormSchema.ts`, and email submission crosses the client/external-service boundary via `src/utils/helpers/sendToEmail.ts`. Completion is represented by the distinct `/thanks` route at `src/app/(main)/thanks/page.tsx`.

#### Shared UI, media, and responsive behavior
Cross-page primitives live in `src/components/ui/` and `src/components/others/`, including buttons, cards, carousel, accordion, CTA, and image/link abstractions. Responsive/client interaction concerns are encapsulated in `src/hooks/useMediaQuery.ts`, `src/hooks/useLocalStorage.ts`, and `src/hooks/useToggle.ts`. Images and brand assets are served locally from `public/images/` and `public/icons/`, with a component-level image wrapper at `src/components/lib/Image.tsx`.

#### Delivery infrastructure
Dependencies are managed with pnpm (`package.json`, `pnpm-lock.yaml`). GitHub Actions lint, TypeScript checks, and deployment are defined in `.github/workflows/lint.yml`, `.github/workflows/tsc.yml`, and `.github/workflows/deploy.yml`; README specifies builds/deployment are triggered from commits merged to `master`. `public/CNAME` indicates custom-domain static hosting/deployment configuration.

Main entry points: [`src/app/(main)/layout.tsx`](https://github.com/optimusjr/website/blob/master/src/app/(main)/layout.tsx) (Main site layout), [`src/app/(main)/_components/Layout/index.tsx`](https://github.com/optimusjr/website/blob/master/src/app/(main)/_components/Layout/index.tsx) (Site shell), [`src/components/others/MultiPageForm/index.tsx`](https://github.com/optimusjr/website/blob/master/src/components/others/MultiPageForm/index.tsx) (Multi-step form), [`src/app/(main)/(index)/page.tsx`](https://github.com/optimusjr/website/blob/master/src/app/(main)/(index)/page.tsx) (Home route)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Next.js App Router"]
  node_root_layout["Root layout<br/>Next.js layout<br/>[layout.tsx]"]
  node_main_layout["Main site layout<br/>route-group layout<br/>[layout.tsx]"]
  node_site_shell["Site shell<br/>layout composition<br/>[index.tsx]"]
  node_header["Header navigation<br/>navigation component<br/>[index.tsx]"]
  node_footer["Footer<br/>[Footer.tsx]"]
  node_home["Home route<br/>page route<br/>[page.tsx]"]
  node_home_sections["Home sections<br/>route-local sections<br/>[index.tsx]"]
  node_about["About route<br/>page route<br/>[page.tsx]"]
  node_campaign["Lights campaign<br/>landing page route<br/>[page.tsx]"]
  node_not_found["Not-found fallback<br/>fallback route<br/>[not-found.tsx]"]
  node_discovery["Discovery endpoints<br/>metadata routes<br/>[manifest.ts]"]
end

subgraph group_forms["Quote Flow"]
  node_quote_page["Quote route<br/>page route<br/>[page.tsx]"]
  node_quote_component["Quote composition<br/>quote component<br/>[Quote.tsx]"]
  node_multi_step_form["Multi-step form<br/>reusable form system<br/>[index.tsx]"]
  node_form_context["Form context<br/>React context<br/>[index.tsx]"]
  node_form_schema["Quote schema<br/>form definition<br/>[quoteFormSchema.ts]"]
  node_email_submission{{"Email submission<br/>external service bridge<br/>[sendToEmail.ts]"}}
  node_thanks["Thanks route<br/>confirmation page<br/>[page.tsx]"]
end

subgraph group_shared["Shared UI &amp; Media"]
  node_shared_ui["Shared UI primitives<br/>component library"]
  node_image_wrapper["Image wrapper<br/>media component<br/>[Image.tsx]"]
  node_assets[("Brand assets<br/>static assets")]
end

subgraph group_delivery["Delivery"]
  node_ci{{"CI and deployment<br/>GitHub Actions<br/>[deploy.yml]"}}
  node_hosting["Custom-domain hosting<br/>deployment configuration"]
end

node_root_layout -->|"wraps routes"| node_main_layout
node_main_layout -->|"uses"| node_site_shell
node_site_shell -->|"composes"| node_header
node_site_shell -->|"composes"| node_footer
node_main_layout -->|"renders"| node_home
node_main_layout -->|"renders"| node_about
node_main_layout -->|"renders"| node_campaign
node_main_layout -->|"renders"| node_quote_page
node_main_layout -->|"renders"| node_thanks
node_home -->|"composes"| node_home_sections
node_quote_page -->|"delegates to"| node_quote_component
node_quote_component -->|"uses"| node_multi_step_form
node_multi_step_form -->|"manages state with"| node_form_context
node_multi_step_form -->|"uses"| node_form_schema
node_multi_step_form -->|"submits"| node_email_submission
node_email_submission -.->|"completion"| node_thanks
node_home_sections -.->|"uses"| node_shared_ui
node_site_shell -.->|"uses"| node_shared_ui
node_shared_ui -.->|"uses media"| node_image_wrapper
node_image_wrapper -->|"serves"| node_assets
node_ci -->|"deploys to"| node_hosting

click node_root_layout "https://github.com/optimusjr/website/blob/master/src/app/layout.tsx"
click node_main_layout "https://github.com/optimusjr/website/blob/master/src/app/(main)/layout.tsx"
click node_site_shell "https://github.com/optimusjr/website/blob/master/src/app/(main)/_components/Layout/index.tsx"
click node_header "https://github.com/optimusjr/website/blob/master/src/app/(main)/_components/Layout/Header/index.tsx"
click node_footer "https://github.com/optimusjr/website/blob/master/src/app/(main)/_components/Layout/Footer.tsx"
click node_home "https://github.com/optimusjr/website/blob/master/src/app/(main)/(index)/page.tsx"
click node_home_sections "https://github.com/optimusjr/website/blob/master/src/app/(main)/(index)/_components/Start/index.tsx"
click node_about "https://github.com/optimusjr/website/blob/master/src/app/(main)/about/page.tsx"
click node_campaign "https://github.com/optimusjr/website/blob/master/src/app/(main)/lp/lights/page.tsx"
click node_not_found "https://github.com/optimusjr/website/blob/master/src/app/not-found.tsx"
click node_discovery "https://github.com/optimusjr/website/blob/master/src/app/manifest.ts"
click node_quote_page "https://github.com/optimusjr/website/blob/master/src/app/(main)/quote/page.tsx"
click node_quote_component "https://github.com/optimusjr/website/blob/master/src/app/(main)/quote/_components/Quote.tsx"
click node_multi_step_form "https://github.com/optimusjr/website/blob/master/src/components/others/MultiPageForm/index.tsx"
click node_form_context "https://github.com/optimusjr/website/blob/master/src/components/others/MultiPageForm/FormContext/index.tsx"
click node_form_schema "https://github.com/optimusjr/website/blob/master/src/quoteFormSchema.ts"
click node_email_submission "https://github.com/optimusjr/website/blob/master/src/utils/helpers/sendToEmail.ts"
click node_thanks "https://github.com/optimusjr/website/blob/master/src/app/(main)/thanks/page.tsx"
click node_image_wrapper "https://github.com/optimusjr/website/blob/master/src/components/lib/Image.tsx"
click node_ci "https://github.com/optimusjr/website/blob/master/.github/workflows/deploy.yml"
click node_hosting "https://github.com/optimusjr/website/blob/master/public/CNAME"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_root_layout,node_main_layout,node_site_shell,node_header,node_footer,node_home,node_home_sections,node_about,node_campaign,node_not_found,node_discovery toneBlue
class node_quote_page,node_quote_component,node_multi_step_form,node_form_context,node_form_schema,node_email_submission,node_thanks toneAmber
class node_shared_ui,node_image_wrapper,node_assets toneMint
class node_ci,node_hosting toneRose
```

## Components

### Next.js App Router

- [Root layout](https://github.com/optimusjr/website/blob/master/src/app/layout.tsx): Next.js layout · Top-level document shell. · `src/app/layout.tsx`
- [Main site layout](https://github.com/optimusjr/website/blob/master/src/app/(main)/layout.tsx): route-group layout · Persistent site chrome boundary. · `src/app/(main)/layout.tsx`
- [Site shell](https://github.com/optimusjr/website/blob/master/src/app/(main)/_components/Layout/index.tsx): layout composition · Composes branding, navigation, and footer. · `src/app/(main)/_components/Layout/index.tsx`
- [Header navigation](https://github.com/optimusjr/website/blob/master/src/app/(main)/_components/Layout/Header/index.tsx): navigation component · Includes mobile navigation support. · `src/app/(main)/_components/Layout/Header/index.tsx`
- [Footer](https://github.com/optimusjr/website/blob/master/src/app/(main)/_components/Layout/Footer.tsx): footer component · `src/app/(main)/_components/Layout/Footer.tsx`
- [Home route](https://github.com/optimusjr/website/blob/master/src/app/(main)/(index)/page.tsx): page route · `src/app/(main)/(index)/page.tsx`
- [Home sections](https://github.com/optimusjr/website/blob/master/src/app/(main)/(index)/_components/Start/index.tsx): route-local sections · Hero, services, and contact content. · `src/app/(main)/(index)/_components/Start/index.tsx`
- [About route](https://github.com/optimusjr/website/blob/master/src/app/(main)/about/page.tsx): page route · Composes isolated introductory, information, and showcase sections. · `src/app/(main)/about/page.tsx`
- [Lights campaign](https://github.com/optimusjr/website/blob/master/src/app/(main)/lp/lights/page.tsx): landing page route · Campaign content isolated from the home route. · `src/app/(main)/lp/lights/page.tsx`
- [Not-found fallback](https://github.com/optimusjr/website/blob/master/src/app/not-found.tsx): fallback route · `src/app/not-found.tsx`
- [Discovery endpoints](https://github.com/optimusjr/website/blob/master/src/app/manifest.ts): metadata routes · Manifest, robots, and sitemap endpoints. · `src/app/manifest.ts`

### Quote Flow

- [Quote route](https://github.com/optimusjr/website/blob/master/src/app/(main)/quote/page.tsx): page route · `src/app/(main)/quote/page.tsx`
- [Quote composition](https://github.com/optimusjr/website/blob/master/src/app/(main)/quote/_components/Quote.tsx): quote component · `src/app/(main)/quote/_components/Quote.tsx`
- [Multi-step form](https://github.com/optimusjr/website/blob/master/src/components/others/MultiPageForm/index.tsx): reusable form system · Renders questions and coordinates form progression. · `src/components/others/MultiPageForm/index.tsx`
- [Form context](https://github.com/optimusjr/website/blob/master/src/components/others/MultiPageForm/FormContext/index.tsx): React context · Stores answers and progression state. · `src/components/others/MultiPageForm/FormContext/index.tsx`
- [Quote schema](https://github.com/optimusjr/website/blob/master/src/quoteFormSchema.ts): form definition · `src/quoteFormSchema.ts`
- [Email submission](https://github.com/optimusjr/website/blob/master/src/utils/helpers/sendToEmail.ts): external service bridge · Sends completed quote data by email. · `src/utils/helpers/sendToEmail.ts`
- [Thanks route](https://github.com/optimusjr/website/blob/master/src/app/(main)/thanks/page.tsx): confirmation page · `src/app/(main)/thanks/page.tsx`

### Shared UI & Media

- **Shared UI primitives**: component library · Cross-page buttons, cards, carousel, CTA, and link primitives.
- [Image wrapper](https://github.com/optimusjr/website/blob/master/src/components/lib/Image.tsx): media component · `src/components/lib/Image.tsx`
- **Brand assets**: static assets · Local images and icons served by Next.js.

### Delivery

- [CI and deployment](https://github.com/optimusjr/website/blob/master/.github/workflows/deploy.yml): GitHub Actions · Lint, type-check, and deployment workflows. · `.github/workflows/deploy.yml`
- [Custom-domain hosting](https://github.com/optimusjr/website/blob/master/public/CNAME): deployment configuration · `public/CNAME`

## Connections

- Root layout → Main site layout: wraps routes
- Main site layout → Site shell: uses
- Site shell → Header navigation: composes
- Site shell → Footer: composes
- Main site layout → Home route: renders
- Main site layout → About route: renders
- Main site layout → Lights campaign: renders
- Main site layout → Quote route: renders
- Main site layout → Thanks route: renders
- Home route → Home sections: composes
- Quote route → Quote composition: delegates to
- Quote composition → Multi-step form: uses
- Multi-step form → Form context: manages state with
- Multi-step form → Quote schema: uses
- Multi-step form → Email submission: submits
- Email submission → Thanks route: completion
- Home sections → Shared UI primitives: uses
- Site shell → Shared UI primitives: uses
- Shared UI primitives → Image wrapper: uses media
- Image wrapper → Brand assets: serves
- CI and deployment → Custom-domain hosting: deploys to
