# moajmalp/g7-website architecture

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

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

## Overview

##### Project type & purpose (from file tree + README)
This is a **Next.js (App Router) web application** bootstrapped with `create-next-app`. The structure indicates a **content-driven site** with:
- A **blog** section: `app/blog/page.tsx` and dynamic route `app/blog/[slug]/page.tsx`
- A **static legal/info page**: `app/risk-disclosure/page.tsx`
- Shared layout and UI components: `components/layout/*`, `components/ui/*`
- Local “data access” helpers: `lib/blog-data.ts` (likely reads posts from `public/blog/*`)
- Styling and motion: **Tailwind CSS** (`tailwind.config.ts`, `postcss.config.mjs`, `app/globals.css`) and likely **Framer Motion** (`components/providers/framer-provider.tsx`, `lib/motion.ts`)

So the architecture is primarily **single deployable Next.js app** (no separate backend service visible), with **filesystem-backed content** (blog assets under `public/blog`).

##### Routing / Pages (App Router)
- `app/layout.tsx` (global layout shell)
- `app/page.tsx` (home)
- `app/blog/page.tsx` (blog index)
- `app/blog/[slug]/page.tsx` (blog detail; slug-based)
- `app/risk-disclosure/page.tsx`

##### Shared UI
- Layout components: `components/layout/Navbar.tsx`, `components/layout/Footer.tsx`
- UI components: `components/ui/custom-dropdown.tsx`, `components/ui/fade-in.tsx`

##### Providers / Cross-cutting
- `components/providers/framer-provider.tsx` (global animation/motion context)

##### Domain / Data access
- `lib/blog-data.ts` (blog post discovery + parsing; likely reads from filesystem under `public/blog`)
- `lib/motion.ts` (motion configuration / variants)

##### Deployment/Runtime (C4 Level 2-ish)
- Browser ↔ CDN/static ↔ Next.js runtime (Vercel)
- Build pipeline optionally (Git → Vercel Build → Deploy)

- `app/*` routes → `components/*` + `lib/*` + `public/*`
- `layout.tsx` composing Navbar/Footer and provider

- Browser → Next.js route → blog-data → public/blog → render → response

These three together will be the most accurate representation of *this* repo’s actual architecture.

## Diagram (Mermaid)

```mermaid
flowchart TD
  %% =========================================================
  %% Diagram 1: Deployment / Runtime (C4-ish)
  %% =========================================================
  subgraph D1["Diagram 1 — Deployment / Runtime"]
    direction TB

    User["Browser (Client)"]:::external

    subgraph Host["Hosting Platform (e.g., Vercel)"]
      direction TB
      CDN["Edge CDN / Static Cache"]:::external
      NextRuntime["Next.js Runtime (Node.js / Serverless)"]:::platform

      subgraph NextApp["Next.js App (single deployable unit)"]
        direction TB
        Router["App Router (file-based routing)"]:::platform
        RoutesEntry["Route Handlers (app/**/page.tsx)"]:::routes
      end
    end

    RepoFS["Repo Filesystem (build artifact)"]:::external
    StaticRoot["Static Assets Root (public/)"]:::asset
    StaticBlog["Static Blog Content (public/blog/*)"]:::asset
    NextStatic["_next/static (JS/CSS bundles)"]:::asset

    User -->|"HTTP GET /, /blog, /blog/[slug], /risk-disclosure"| NextRuntime
    NextRuntime -->|"dispatches route"| Router
    Router -->|"renders"| RoutesEntry
    NextRuntime -->|"serves HTML"| User

    User -->|"GET static assets"| CDN
    CDN -->|"cache hit/miss"| NextRuntime
    NextRuntime -->|"serves /_next/static/*"| NextStatic
    NextRuntime -->|"serves /public/*"| StaticRoot
    StaticRoot -->|"contains"| StaticBlog
    NextRuntime -->|"build/deploy input"| RepoFS
  end

  %% =========================================================
  %% Diagram 2: Internal Modules (App Router + Components + Lib)
  %% =========================================================
  subgraph D2["Diagram 2 — Internal Module Architecture"]
    direction TB

    subgraph App["app/ (Routes + Layout)"]
      direction TB
      Layout["Global Layout Shell (app/layout.tsx)"]:::routes
      Globals["Global Styles (app/globals.css)"]:::styling

      Home["Home Route / (app/page.tsx)"]:::routes
      BlogIndex["Blog Index Route /blog (app/blog/page.tsx)"]:::routes
      BlogDetail["Blog Detail Route /blog/[slug] (app/blog/[slug]/page.tsx)"]:::routes
      Risk["Risk Disclosure Route /risk-disclosure (app/risk-disclosure/page.tsx)"]:::routes
    end

    subgraph Components["components/ (Reusable UI)"]
      direction TB

      subgraph LayoutComps["components/layout/"]
        direction TB
        Navbar["Navbar (components/layout/Navbar.tsx)"]:::component
        Footer["Footer (components/layout/Footer.tsx)"]:::component
      end

      subgraph UIComps["components/ui/"]
        direction TB
        Dropdown["Custom Dropdown (components/ui/custom-dropdown.tsx)"]:::component
        FadeIn["Fade-in (components/ui/fade-in.tsx)"]:::component
      end

      subgraph Providers["components/providers/"]
        direction TB
        FramerProvider["Framer Provider (components/providers/framer-provider.tsx)"]:::provider
      end
    end

    subgraph Lib["lib/ (Domain + Utilities)"]
      direction TB
      BlogData["Blog Data Access (lib/blog-data.ts)"]:::lib
      Motion["Motion Config / Variants (lib/motion.ts)"]:::lib
    end

    subgraph Public["public/ (Static Assets)"]
      direction TB
      PublicRoot["public/"]:::asset
      PublicBlog["public/blog/"]:::asset
      PublicRoot -->|"contains"| PublicBlog
    end

    subgraph BuildStyling["Build + Styling Pipeline"]
      direction TB
      Tailwind["Tailwind Config (tailwind.config.ts)"]:::config
      PostCSS["PostCSS Config (postcss.config.mjs)"]:::config
      NextConfig["Next.js Config (next.config.ts)"]:::config
    end

    %% Composition + dependencies
    Layout -->|"composes"| Navbar
    Layout -->|"composes"| Footer
    Layout -->|"wraps with provider"| FramerProvider
    Layout -->|"loads"| Globals

    Home -->|"rendered within"| Layout
    BlogIndex -->|"rendered within"| Layout
    BlogDetail -->|"rendered within"| Layout
    Risk -->|"rendered within"| Layout

    BlogIndex -->|"imports/depends-on"| BlogData
    BlogDetail -->|"imports/depends-on (slug->content)"| BlogData
    BlogData -->|"reads from filesystem (build-time or runtime)"| PublicBlog

    FadeIn -->|"imports/depends-on"| Motion
    FramerProvider -->|"uses"| Motion
    BlogIndex -->|"renders/uses"| Dropdown
    BlogIndex -->|"renders/uses"| FadeIn
    BlogDetail -->|"renders/uses"| FadeIn

    Tailwind -->|"drives utility classes"| Globals
    PostCSS -->|"processes"| Globals
    NextConfig -->|"configures build/runtime"| App
  end

  %% =========================================================
  %% Diagram 3: Sequence — Request Flow for /blog/[slug]
  %% =========================================================
  subgraph D3["Diagram 3 — Sequence: GET /blog/[slug]"]
    direction TB

    subgraph Seq["Request/Render Flow"]
      direction TB
      S1["1) Browser requests /blog/[slug]"]:::external
      S2["2) Next.js App Router matches route"]:::platform
      S3["3) Blog Detail Page executes (app/blog/[slug]/page.tsx)"]:::routes
      S4["4) Load content via Blog Data (lib/blog-data.ts)"]:::lib
      S5["5) Read post assets/content (public/blog/*)"]:::asset
      S6["6) Render with Layout + Components (Navbar/Footer, motion)"]:::component
      S7["7) Response: HTML + JS/CSS bundles"]:::platform
      S8["8) Browser fetches static assets: /_next/static/* and /blog/*"]:::external
      S9["9) CDN serves cached static assets (if applicable)"]:::external

      S1 -->|"HTTP GET"| S2
      S2 -->|"invokes"| S3
      S3 -->|"calls"| S4
      S4 -->|"filesystem read"| S5
      S3 -->|"composed within"| S6
      S6 -->|"produces"| S7
      S7 -->|"HTTP 200"| S1
      S1 -->|"GET static assets"| S8
      S8 -->|"via CDN"| S9
    end
  end

  %% =========================================================
  %% Click events (from component_mapping)
  %% =========================================================
  click Layout "https://github.com/moajmalp/g7-website/blob/main/app/layout.tsx"
  click Home "https://github.com/moajmalp/g7-website/blob/main/app/page.tsx"
  click BlogIndex "https://github.com/moajmalp/g7-website/blob/main/app/blog/page.tsx"
  click BlogDetail "https://github.com/moajmalp/g7-website/blob/main/app/blog/[slug]/page.tsx"
  click Risk "https://github.com/moajmalp/g7-website/blob/main/app/risk-disclosure/page.tsx"

  click Navbar "https://github.com/moajmalp/g7-website/blob/main/components/layout/Navbar.tsx"
  click Footer "https://github.com/moajmalp/g7-website/blob/main/components/layout/Footer.tsx"
  click LayoutComps "https://github.com/moajmalp/g7-website/tree/main/components/layout/"

  click Dropdown "https://github.com/moajmalp/g7-website/blob/main/components/ui/custom-dropdown.tsx"
  click FadeIn "https://github.com/moajmalp/g7-website/blob/main/components/ui/fade-in.tsx"
  click UIComps "https://github.com/moajmalp/g7-website/tree/main/components/ui/"

  click FramerProvider "https://github.com/moajmalp/g7-website/blob/main/components/providers/framer-provider.tsx"
  click Providers "https://github.com/moajmalp/g7-website/tree/main/components/providers/"

  click BlogData "https://github.com/moajmalp/g7-website/blob/main/lib/blog-data.ts"
  click Motion "https://github.com/moajmalp/g7-website/blob/main/lib/motion.ts"
  click Lib "https://github.com/moajmalp/g7-website/tree/main/lib/"

  click Globals "https://github.com/moajmalp/g7-website/blob/main/app/globals.css"
  click Tailwind "https://github.com/moajmalp/g7-website/blob/main/tailwind.config.ts"
  click PostCSS "https://github.com/moajmalp/g7-website/blob/main/postcss.config.mjs"

  click PublicBlog "https://github.com/moajmalp/g7-website/tree/main/public/blog/"
  click PublicRoot "https://github.com/moajmalp/g7-website/tree/main/public/"

  click NextConfig "https://github.com/moajmalp/g7-website/blob/main/next.config.ts"

  %% =========================================================
  %% Styles
  %% =========================================================
  classDef external fill:#0b1220,stroke:#60a5fa,stroke-width:2px,color:#e5e7eb
  classDef platform fill:#1e3a8a,stroke:#93c5fd,stroke-width:2px,color:#ffffff
  classDef routes fill:#1d4ed8,stroke:#bfdbfe,stroke-width:2px,color:#ffffff
  classDef component fill:#065f46,stroke:#6ee7b7,stroke-width:2px,color:#ecfdf5
  classDef provider fill:#6d28d9,stroke:#ddd6fe,stroke-width:2px,color:#ffffff
  classDef lib fill:#c2410c,stroke:#fed7aa,stroke-width:2px,color:#fff7ed
  classDef asset fill:#374151,stroke:#d1d5db,stroke-width:2px,color:#f9fafb
  classDef styling fill:#064e3b,stroke:#a7f3d0,stroke-width:2px,color:#ecfdf5
  classDef config fill:#7c2d12,stroke:#fdba74,stroke-width:2px,color:#fff7ed
```
