# ericorrdev/spatial-automata-website architecture

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

- Interactive diagram: https://gitdiagram.com/ericorrdev/spatial-automata-website
- Repository: https://github.com/ericorrdev/spatial-automata-website

## Overview

##### Project Type and Purpose
- This is a Next.js–based, React-powered front-end web application.
- It renders a marketing/site portal: home page, about, contact, and a catalog of product pages.
- It’s deployed (by default) on Vercel, using file-based routing, SSR/SSG, and static assets delivery.

##### File Structure
Top-level:
- next.config.ts, tsconfig.json – Next.js & TS config
- tailwind.config.js, postcss.config.js – CSS & PostCSS tooling
- package.json – dependencies (next, react, tailwindcss, etc.)
- public/ – static assets (images, fonts, favicons) served at root
src/app/ – Next.js “app router” directory
- layout.tsx – global layout (header, footer, providers)
- globals.css, tailwind.css – global styles
- page.tsx – root/home page
- about/, contact/, products/ – folder per route, each with page.tsx
- fonts/ – font files imported via next/font
- types/ – custom type definitions
src/components/ – reusable React UI components
- theme-provider.tsx – context/provider for theming
- ui/ – atomic UI components (Button, Card, Input, Label, etc.)
- shared bits: Navbar, Footer, Hero, EmailSignup, ProductOffers, AbstractBackground
src/lib/ – utility functions (utils.ts)

##### Extract Insights from README
- “Bootstrapped with create-next-app” implies standard Next.js architecture.
- Emphasizes next/font for font optimization.
- No backend API or database is described – this is a static/SSR front-end site.

##### Main Components & Their Relationships
a. Components:
- Browser / Client (visitor’s browser)
- Next.js Server / Edge Functions (handles SSR/SSG & routing)
- React Components (pages + shared UI library)
- Global CSS / TailwindCSS processor
- Public Assets CDN (images, fonts, favicons)
- Deployment Platform (Vercel)
b. Interactions:
1. Client requests URL (e.g., /products/redline-relay)
2. Vercel CDN serves pre-rendered HTML or invokes Next.js SSR/Edge function
3. Next.js uses file-based routing (src/app/products/redline-relay/page.tsx)
4. Layout.tsx wraps page in shared UI (Navbar, Footer, ThemeProvider)
5. React hydrates on client, fetches any client-side data or interactions (none in this simple site)
6. Client loads CSS from Tailwind, fonts via next/font, and static images from /public
c. Architectural Patterns & Principles:
- File-based routing (Next.js app router)
- Component-based design (atomic UI in src/components/ui)
- CSS-in-JS + utility-first CSS (Tailwind)
- Separation of concerns: pages vs. layout vs. shared components vs. assets
- SSG/SSR hybrid: static export for known routes, SSR for dynamic/preview content if needed
d. Key Technologies:
- Next.js (app router, React, SSR/SSG, edge functions)
- React + TypeScript
- TailwindCSS + PostCSS
- next/font for font optimization
- Vercel for deployment & CDN

##### Detail
- How “theme-provider.tsx” wraps the React tree.
- Call out “ui/*” as atomic components.
- Route tree: /, /about, /contact, /products/[slug].

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Layer
    subgraph "Client Layer"
        Browser["Visitor Browser"]:::runtime
    end

    %% CDN / Edge Layer
    subgraph "CDN / Edge Layer"
        VercelCDN["Vercel CDN (Edge Cache)"]:::runtime
    end

    %% Next.js Server / Edge Functions
    subgraph "Next.js Server / Edge Functions"
        NextServer["Next.js SSR/SSG"]:::runtime
    end

    %% Build Tools Layer
    subgraph "Build Tools & Config"
        NXConfig["next.config.ts"]:::build
        TSConfig["tsconfig.json"]:::build
        TWConfig["tailwind.config.js"]:::build
        PCConfig["postcss.config.js"]:::build
    end

    %% Static Assets Store
    subgraph "Static Assets Store"
        PublicAssets["/public (images, fonts, favicons)"]:::static
    end

    %% File System Layer
    subgraph "File System"
        subgraph "src/app/"
            Layout["layout.tsx\n(global layout)"]:::runtime
            GlobalsCSS["globals.css"]:::static
            TailwindCSS["tailwind.css"]:::static
            HomePage["page.tsx\n(/)"]:::runtime

            subgraph "about/"
                AboutPage["page.tsx\n(/about)"]:::runtime
            end
            subgraph "contact/"
                ContactPage["page.tsx\n(/contact)"]:::runtime
            end
            subgraph "products/"
                ProductsIndex["page.tsx\n(/products)"]:::runtime
                CHASM["CHASM.NET/page.tsx"]:::runtime
                BlockCaptain["block-captain/page.tsx"]:::runtime
                CodeCheck["codecheck/page.tsx"]:::runtime
                ExcellentDB["excellentdb/page.tsx"]:::runtime
                MTextPlus["mtextplusplus/page.tsx"]:::runtime
                RedlineRelay["redline-relay/page.tsx"]:::runtime
                SpeedyLUTs["speedy-luts/page.tsx"]:::runtime
            end
            Fonts["fonts/\n(AMERICAN-GROTESK-BOLD.OTF)"]:::static
            Types["types/\n(react-p5.d.ts)"]:::build
        end

        subgraph "src/components/"
            ThemeProvider["theme-provider.tsx"]:::runtime
            subgraph "ui/"
                UI_Button["button.tsx"]:::runtime
                UI_Card["card.tsx"]:::runtime
                UI_Form["form.tsx"]:::runtime
                UI_Input["input.tsx"]:::runtime
                UI_Label["label.tsx"]:::runtime
                UI_NavMenu["navigation-menu.tsx"]:::runtime
                UI_Textarea["textarea.tsx"]:::runtime
            end
            Navbar["navbar.tsx"]:::runtime
            Footer["footer.tsx"]:::runtime
            Hero["hero.tsx"]:::runtime
            EmailSignup["EmailSignup.tsx"]:::runtime
            ProductOffers["productOffers.tsx"]:::runtime
            AbstractBG["abstract-background.tsx"]:::runtime
        end

        Utils["utils.ts"]:::runtime
    end

    %% Connections
    Browser -->|"requests URL"| VercelCDN
    VercelCDN -->|"serves static or invokes"| NextServer
    NextServer -->|"routes via file-based router"| HomePage
    NextServer --> AboutPage
    NextServer --> ContactPage
    NextServer --> ProductsIndex
    HomePage --> Layout
    AboutPage --> Layout
    ContactPage --> Layout
    ProductsIndex --> Layout
    Layout --> ThemeProvider
    Layout --> Navbar
    Layout --> Footer
    ThemeProvider --> UI_Button
    ThemeProvider --> UI_Card
    Layout --> Hero
    Layout --> EmailSignup
    Layout --> ProductOffers
    Layout --> AbstractBG
    NextServer --> PublicAssets
    NextServer --> Fonts

    %% Build tools integration
    NXConfig --> NextServer
    TSConfig --> NextServer
    TWConfig --> GlobalsCSS
    TWConfig --> TailwindCSS
    PCConfig --> GlobalsCSS
    PCConfig --> TailwindCSS

    %% Asset flows
    PublicAssets --> Browser
    Fonts --> Browser
    GlobalsCSS --> Browser
    TailwindCSS --> Browser

    %% Click Events
    click NXConfig "https://github.com/ericorrdev/spatial-automata-website/blob/master/next.config.ts"
    click TSConfig "https://github.com/ericorrdev/spatial-automata-website/blob/master/tsconfig.json"
    click TWConfig "https://github.com/ericorrdev/spatial-automata-website/blob/master/tailwind.config.js"
    click PCConfig "https://github.com/ericorrdev/spatial-automata-website/blob/master/postcss.config.js"
    click PublicAssets "https://github.com/ericorrdev/spatial-automata-website/tree/master/public/"
    click Layout "https://github.com/ericorrdev/spatial-automata-website/blob/master/src/app/layout.tsx"
    click GlobalsCSS "https://github.com/ericorrdev/spatial-automata-website/blob/master/src/app/globals.css"
    click TailwindCSS "https://github.com/ericorrdev/spatial-automata-website/blob/master/src/app/tailwind.css"
    click HomePage "https://github.com/ericorrdev/spatial-automata-website/blob/master/src/app/page.tsx"
    click AboutPage "https://github.com/ericorrdev/spatial-automata-website/blob/master/src/app/about/page.tsx"
    click ContactPage "https://github.com/ericorrdev/spatial-automata-website/blob/master/src/app/contact/page.tsx"
    click ProductsIndex "https://github.com/ericorrdev/spatial-automata-website/blob/master/src/app/products/page.tsx"
    click CHASM "https://github.com/ericorrdev/spatial-automata-website/blob/master/src/app/products/CHASM.NET/page.tsx"
    click BlockCaptain "https://github.com/ericorrdev/spatial-automata-website/blob/master/src/app/products/block-captain/page.tsx"
    click CodeCheck "https://github.com/ericorrdev/spatial-automata-website/blob/master/src/app/products/codecheck/page.tsx"
    click ExcellentDB "https://github.com/ericorrdev/spatial-automata-website/blob/master/src/app/products/excellentdb/page.tsx"
    click MTextPlus "https://github.com/ericorrdev/spatial-automata-website/blob/master/src/app/products/mtextplusplus/page.tsx"
    click RedlineRelay "https://github.com/ericorrdev/spatial-automata-website/blob/master/src/app/products/redline-relay/page.tsx"
    click SpeedyLUTs "https://github.com/ericorrdev/spatial-automata-website/blob/master/src/app/products/speedy-luts/page.tsx"
    click Fonts "https://github.com/ericorrdev/spatial-automata-website/blob/master/src/app/fonts/AMERICAN-GROTESK-BOLD.OTF"
    click Types "https://github.com/ericorrdev/spatial-automata-website/blob/master/src/app/types/react-p5.d.ts"
    click ThemeProvider "https://github.com/ericorrdev/spatial-automata-website/blob/master/src/components/theme-provider.tsx"
    click UI_Button "https://github.com/ericorrdev/spatial-automata-website/blob/master/src/components/ui/button.tsx"
    click UI_Card "https://github.com/ericorrdev/spatial-automata-website/blob/master/src/components/ui/card.tsx"
    click UI_Form "https://github.com/ericorrdev/spatial-automata-website/blob/master/src/components/ui/form.tsx"
    click UI_Input "https://github.com/ericorrdev/spatial-automata-website/blob/master/src/components/ui/input.tsx"
    click UI_Label "https://github.com/ericorrdev/spatial-automata-website/blob/master/src/components/ui/label.tsx"
    click UI_NavMenu "https://github.com/ericorrdev/spatial-automata-website/blob/master/src/components/ui/navigation-menu.tsx"
    click UI_Textarea "https://github.com/ericorrdev/spatial-automata-website/blob/master/src/components/ui/textarea.tsx"
    click Navbar "https://github.com/ericorrdev/spatial-automata-website/blob/master/src/components/navbar.tsx"
    click Footer "https://github.com/ericorrdev/spatial-automata-website/blob/master/src/components/footer.tsx"
    click Hero "https://github.com/ericorrdev/spatial-automata-website/blob/master/src/components/hero.tsx"
    click EmailSignup "https://github.com/ericorrdev/spatial-automata-website/blob/master/src/components/EmailSignup.tsx"
    click ProductOffers "https://github.com/ericorrdev/spatial-automata-website/blob/master/src/components/productOffers.tsx"
    click AbstractBG "https://github.com/ericorrdev/spatial-automata-website/blob/master/src/components/abstract-background.tsx"
    click Utils "https://github.com/ericorrdev/spatial-automata-website/blob/master/src/lib/utils.ts"

    %% Styles
    classDef runtime fill:#cce5ff,stroke:#004085,color:#004085
    classDef static fill:#d4edda,stroke:#155724,color:#155724
    classDef build fill:#ffeeba,stroke:#856404,color:#856404
```
