# rt-codes/rt-productions architecture

> Architecture diagram of the GitHub repository rt-codes/rt-productions, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rt-codes/rt-productions
- Repository: https://github.com/rt-codes/rt-productions

## Overview

##### Project type and purpose
- This is a React-based static personal homepage built with Next.js (using the app router), styled with Tailwind CSS, and hosted on Vercel.
- Purpose: render several self-contained sections (intro, about, experience, projects, skills, footer) with client-side interactivity (via React context) and serve static assets (PDFs, images, CSS).

##### File structure
- app/
- layout.tsx – top-level wrapper (common header, footer, <html>/<body>)
- page.tsx – root page that assembles sections
- globals.css – global styles imported into layout
- components/ – small, reusable UI components for each section
- context/active-section-context.tsx – React Context to track which section is in view
- lib/ – helper code (data.ts supplies content, hooks.ts for custom hooks, types.ts for TS interfaces)
- public/ – static assets (PDFs, images) served from the CDN
- config files (next.config.js, tailwind.config.ts, tsconfig.json, postcss.config.js) for build and styling
- package.json & package-lock.json – dependencies (next, react, tailwindcss)

##### README for additional insights
- Confirms it’s a simple Next.js site, focuses on displaying personal information, no backend or database.
- Hosted by Vercel, so deployment pipeline is “push to Git → Vercel builds & deploys → global CDN”.

##### Main components and their interactions
a. Developer/local environment
- Source code (app/, components/, lib/, context/)
- Build tools (Next.js compiler, PostCSS/Tailwind)
b. Vercel build system
- Pulls from Git, runs npm build, produces static HTML/CSS/JS
c. CDN & edge network
- Hosts static pages and assets under global edge nodes
d. Browser (end user)
- Requests page → served pre-rendered HTML + CSS + JS bundle
- JS bundle hydrates React, context logic activates interactive menu/section highlighting
e. External services
- None beyond Vercel & public CDNs; PDFs and static files under public/

##### Architectural patterns & design principles
- Component-based UI: each UI “section” lives in its own component file under components/.
- App router / file-based routing: Next.js uses app/page.tsx and nested layouts if needed.
- Static Site Generation (SSG): pages are built at deploy time, minimal runtime overhead.
- Separation of concerns:
- lib/ supplies typed data and hooks
- context/ isolates shared state (active section)
- components/ handle purely presentation

- Clear labels on all components (e.g., “app/layout.tsx” vs “components/intro.tsx”)
- Source code vs build process vs runtime/CDN vs client browser
- Static assets vs generated pages vs hydrated React app

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Developer Environment
    subgraph "Developer Environment"
        direction TB
        Layout["app/layout.tsx"]:::code
        RootPage["app/page.tsx"]:::code
        GlobalsCSS["app/globals.css"]:::code
        Intro["components/intro.tsx"]:::code
        About["components/about.tsx"]:::code
        Experience["components/experience.tsx"]:::code
        Projects["components/projects.tsx"]:::code
        ProjectItem["components/project.tsx"]:::code
        Skills["components/skills.tsx"]:::code
        Header["components/header.tsx"]:::code
        Footer["components/footer.tsx"]:::code
        SectionDivider["components/section-divider.tsx"]:::code
        SectionHeading["components/section-heading.tsx"]:::code
        ActiveContext["context/active-section-context.tsx"]:::code
        DataLib["lib/data.ts"]:::code
        HooksLib["lib/hooks.ts"]:::code
        TypesLib["lib/types.ts"]:::code
        TailwindConfig["tailwind.config.ts"]:::config
        PostCSSConfig["postcss.config.js"]:::config
        NextConfig["next.config.js"]:::config
        TSConfig["tsconfig.json"]:::config
        PackageJSON["package.json"]:::config
        PackageLock["package-lock.json"]:::config
    end

    %% CI/CD & Hosting
    subgraph "CI/CD & Hosting"
        direction TB
        Vercel[(Vercel Cloud)]:::external
        Build["npm run build"]:::process
        NextCompiler["Next.js Compiler"]:::process
        TailwindProc["Tailwind Processor"]:::process
    end

    %% CDN & Edge Network
    subgraph "CDN & Edge Network"
        direction TB
        CDNStorage[(CDN Storage - HTML/CSS/JS)]:::storage
        PublicAssets[(Public Assets)]:::storage
        CV1["public/CV.pdf"]:::storage
        CV2["public/CV-rowan.pdf"]:::storage
    end

    %% Client Browser
    subgraph "Client Browser"
        direction TB
        HTTPReq["HTTP GET Request"]:::runtime
        HTMLResp["Serve HTML/CSS/JS"]:::runtime
        Hydration["React Hydration"]:::process
        ContextProv["Context Provider"]:::runtime
        Highlight["Section Highlight Logic"]:::runtime
    end

    %% Connections
    Layout -->|imports| GlobalsCSS
    Layout -->|wraps| Header
    Layout -->|wraps| Footer
    RootPage -->|assembles| Intro
    RootPage -->|assembles| About
    RootPage -->|assembles| Experience
    RootPage -->|assembles| Projects
    Projects -->|uses| ProjectItem
    RootPage -->|assembles| Skills
    RootPage -->|uses| SectionDivider
    RootPage -->|uses| SectionHeading
    RootPage -->|wraps| ActiveContext
    ActiveContext -->|provides| ContextProv
    DataLib -->|supplies content| Intro
    DataLib -->|supplies content| About
    DataLib -->|supplies content| Experience
    DataLib -->|supplies content| Projects
    DataLib -->|supplies content| Skills
    HooksLib -->|custom hooks| Intro
    HooksLib -->|custom hooks| Highlight
    TypesLib -->|type interfaces| components/flow
    PackageJSON -->|defines deps| NextCompiler
    TailwindConfig -->|configures| TailwindProc
    PostCSSConfig -->|configures| TailwindProc
    NextConfig -->|configures| NextCompiler

    Layout -->|git push| Vercel
    RootPage -->|git push| Vercel
    Vercel -->|runs| Build
    Build -->|invokes| NextCompiler
    Build -->|invokes| TailwindProc
    NextCompiler -->|outputs| CDNStorage
    TailwindProc -->|outputs| CDNStorage

    CV1 --> PublicAssets
    CV2 --> PublicAssets
    PublicAssets --> CDNStorage

    HTTPReq -->|requests asset| CDNStorage
    HTTPReq -->|requests page| CDNStorage
    CDNStorage -->|serves| HTMLResp
    HTMLResp -->|to browser| Hydration
    Hydration -->|mounts| ContextProv
    ContextProv -->|manages| Highlight

    %% Click Events
    click Layout "https://github.com/rt-codes/rt-productions/blob/main/app/layout.tsx"
    click RootPage "https://github.com/rt-codes/rt-productions/blob/main/app/page.tsx"
    click GlobalsCSS "https://github.com/rt-codes/rt-productions/blob/main/app/globals.css"
    click Intro "https://github.com/rt-codes/rt-productions/blob/main/components/intro.tsx"
    click About "https://github.com/rt-codes/rt-productions/blob/main/components/about.tsx"
    click Experience "https://github.com/rt-codes/rt-productions/blob/main/components/experience.tsx"
    click Projects "https://github.com/rt-codes/rt-productions/blob/main/components/projects.tsx"
    click ProjectItem "https://github.com/rt-codes/rt-productions/blob/main/components/project.tsx"
    click Skills "https://github.com/rt-codes/rt-productions/blob/main/components/skills.tsx"
    click Header "https://github.com/rt-codes/rt-productions/blob/main/components/header.tsx"
    click Footer "https://github.com/rt-codes/rt-productions/blob/main/components/footer.tsx"
    click SectionDivider "https://github.com/rt-codes/rt-productions/blob/main/components/section-divider.tsx"
    click SectionHeading "https://github.com/rt-codes/rt-productions/blob/main/components/section-heading.tsx"
    click ActiveContext "https://github.com/rt-codes/rt-productions/blob/main/context/active-section-context.tsx"
    click DataLib "https://github.com/rt-codes/rt-productions/blob/main/lib/data.ts"
    click HooksLib "https://github.com/rt-codes/rt-productions/blob/main/lib/hooks.ts"
    click TypesLib "https://github.com/rt-codes/rt-productions/blob/main/lib/types.ts"
    click TailwindConfig "https://github.com/rt-codes/rt-productions/blob/main/tailwind.config.ts"
    click PostCSSConfig "https://github.com/rt-codes/rt-productions/blob/main/postcss.config.js"
    click NextConfig "https://github.com/rt-codes/rt-productions/blob/main/next.config.js"
    click TSConfig "https://github.com/rt-codes/rt-productions/blob/main/tsconfig.json"
    click PackageJSON "https://github.com/rt-codes/rt-productions/blob/main/package.json"
    click PackageLock "https://github.com/rt-codes/rt-productions/blob/main/package-lock.json"
    click CV1 "https://github.com/rt-codes/rt-productions/blob/main/public/CV.pdf"
    click CV2 "https://github.com/rt-codes/rt-productions/blob/main/public/CV-rowan.pdf"

    %% Styles
    classDef code fill:#e3f2fd,stroke:#0288d1,color:#0d47a1
    classDef config fill:#f3e5f5,stroke:#6a1b9a,color:#4a148c
    classDef process fill:#fff3e0,stroke:#ef6c00,color:#e65100
    classDef storage fill:#e8f5e9,stroke:#2e7d32,color:#1b5e20
    classDef external fill:#eceff1,stroke:#546e7a,color:#263238
    classDef runtime fill:#fce4ec,stroke:#d81b60,color:#880e4f
```
