How optimusjr/website works
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: layout.tsx Main site layout · Layout/index.tsx Site shell · MultiPageForm/index.tsx Multi-step form · page.tsx Home route
Components 23
Next.js App Router
- Root layout · Top-level document shell.
src/app/layout.tsx - Main site layout · Persistent site chrome boundary.
src/app/(main)/layout.tsx - Site shell · Composes branding, navigation, and footer.
src/app/(main)/_components/Layout/index.tsx - Header navigation · Includes mobile navigation support.
src/app/(main)/_components/Layout/Header/index.tsx - Footer
src/app/(main)/_components/Layout/Footer.tsx - Home route
src/app/(main)/(index)/page.tsx - Home sections · Hero, services, and contact content.
src/app/(main)/(index)/_components/Start/index.tsx - About route · Composes isolated introductory, information, and showcase sections.
src/app/(main)/about/page.tsx - Lights campaign · Campaign content isolated from the home route.
src/app/(main)/lp/lights/page.tsx - Not-found fallback
src/app/not-found.tsx - Discovery endpoints · Manifest, robots, and sitemap endpoints.
src/app/manifest.ts
Quote Flow
- Quote route
src/app/(main)/quote/page.tsx - Quote composition
src/app/(main)/quote/_components/Quote.tsx - Multi-step form · Renders questions and coordinates form progression.
src/components/others/MultiPageForm/index.tsx - Form context · Stores answers and progression state.
src/components/others/MultiPageForm/FormContext/index.tsx - Quote schema
src/quoteFormSchema.ts - Email submission · Sends completed quote data by email.
src/utils/helpers/sendToEmail.ts - Thanks route
src/app/(main)/thanks/page.tsx
Shared UI & Media
- Shared UI primitives · Cross-page buttons, cards, carousel, CTA, and link primitives.
- Image wrapper
src/components/lib/Image.tsx - Brand assets · Local images and icons served by Next.js.
Delivery
- CI and deployment · Lint, type-check, and deployment workflows.
.github/workflows/deploy.yml - Custom-domain hosting
public/CNAME
Connections 21
- 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