# pythonnortebrasil/pynorte2025-site architecture

> Architecture diagram of the GitHub repository pythonnortebrasil/pynorte2025-site, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pythonnortebrasil/pynorte2025-site
- Repository: https://github.com/pythonnortebrasil/pynorte2025-site

## Overview

##### Project Type and Purpose
- This is a **static/SSR‑driven front‑end site** built with Next.js (App Router), React and TypeScript.
- It serves localized content (en/pt) and static data (JSON) for an event website.

##### File Structure
- **Top level**: configuration files (`next.config.ts`, `tailwind.config.ts`, CI workflows under `.github`, linting/setup under `.husky`), and the `package.json` ecosystem.
- **src/app**: Next.js App Router entrypoints, layouts, pages (including dynamic `[locale]` routes), global CSS, and manifest.
- **src/components**: React UI components (page‐specific and a large `ui` subfolder powered by shadcn‑ui + radix).
- **src/data**: Static JSON files (calendar, faq, sponsors, etc.) used for SSG.
- **src/hooks** & **src/lib**: Client/server hooks and utility functions.
- **public**: Static assets (favicon, robots.txt, sitemap.xml).

##### Extract Additional Insights from README
- Fully front‑end, no dedicated backend service—the Next.js server handles SSG and optional SSR.
- Hosted via CDN (likely Vercel or Netlify), with automated CI/CD from GitHub workflows.

##### Main Components
a. **Developer Workstation & VCS**
- Local IDE → GitHub Repo
b. **CI/CD Pipeline**
- GitHub Actions: Linting & Deploy workflows
- Husky & commitlint for pre‑commit hooks
c. **Build System**
- Node.js + npm → Next.js build (SSG/SSR)
- Tailwind CSS compilation
d. **Hosting & CDN**
- Static assets served from a CDN
- Next.js server (if SSR is used) or purely static hosting
e. **Browser / End‑User**
- Fetches pre‑rendered pages, JSON data, and static assets
f. **Data Sources**
- JSON files in `/src/data` embedded at build time
g. **UI Layer**
- React components (page structure, shared `ui/` library)

##### Relationships & Data Flows
- Code push → GitHub → CI → build → deploy to CDN/hosting.
- Browser requests URL → CDN → Next.js server or edge functions → serves HTML/CSS/JS bundles.
- During build, Next.js reads JSON data files → generates static pages per locale.
- Client React hydrates interactive components (hooks, UI library) in the browser.

##### Architectural Patterns & Design Principles
- **App Router (Next.js)** for file‑based routing and dynamic [locale] segments.
- **Static Site Generation (SSG)** for performance and SEO.
- **UI Component Library**: shadcn‑ui + radix for reusable primitives.
- **GitOps / CI‑driven Deployments** via GitHub Actions.
- **Tailwind CSS** utility‑first styling at build time.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Developer Workflow & VCS
    subgraph "Developer Workflow & VCS"
        IDE[/"Developer IDE"/]:::dev
        GitHub(("GitHub Repo")):::dev
        Husky((".husky/commit-msg")):::dev
        Commitlint((".commitlintrc.json")):::dev
        CI(("GitHub Actions")):::dev
    end

    %% Build & Deploy
    subgraph "Build & Deploy"
        Node(("Node.js & npm")):::dev
        NextConfig(("next.config.ts")):::dev
        TailwindConfig(("tailwind.config.ts")):::dev
        PostCSS(("postcss.config.mjs")):::dev
        Package(("package.json / package-lock.json")):::dev
        TSConfig(("tsconfig.json")):::dev
        NVM((".nvmrc")):::dev
    end

    %% Data Layer
    subgraph "Data Layer" 
        Calendar(("calendar.json")):::data
        FAQEN(("faq.en.json")):::data
        FAQPT(("faq.pt.json")):::data
        Sponsors(("sponsors.json")):::data
        Keynotes(("keynotes.json")):::data
    end

    %% Next.js App Router
    subgraph "Next.js App Router"
        Layout(("src/app/layout.tsx")):::dev
        Globals(("src/app/globals.css")):::dev
        PageLocale(("src/app/[locale]/page.tsx")):::dev
        LayoutLocale(("src/app/[locale]/layout.tsx")):::dev
        PageHome(("src/app/page.tsx")):::dev
        NotFound(("src/app/404.tsx")):::dev
    end

    %% UI Layer
    subgraph "UI Layer"
        Hero(("src/components/Hero.tsx")):::ui
        FAQComp(("src/components/FAQ.tsx")):::ui
        Schedule(("src/components/Schedule.tsx")):::ui
        Footer(("src/components/Footer.tsx")):::ui
        UIlib(("src/components/ui/*")):::ui
    end

    %% Client/Server Utilities
    subgraph "Client/Server Utilities"
        Hooks(("src/hooks/*")):::ui
        Utils(("src/lib/utils.ts")):::ui
    end

    %% Localization
    subgraph "Localization"
        EN(("src/locales/en.ts")):::ui
        PT(("src/locales/pt.ts")):::ui
        ClientLoc(("src/locales/client.ts")):::ui
        ServerLoc(("src/locales/server.ts")):::ui
    end

    %% Runtime & Hosting
    subgraph "Runtime & Hosting"
        CDN(("CDN / Static Hosting")):::run
        NextServer(("Next.js Server / Edge")):::run
        Browser(("Browser / End-User")):::run
        Manifest(("src/app/manifest.json")):::run
        Robots(("public/robots.txt / next-sitemap.config.cjs")):::run
    end

    %% Flows
    IDE -->|push code| GitHub
    GitHub -->|triggers| CI
    CI -->|runs build & lint| Node
    Node -->|reads config| NextConfig
    Node -->|reads config| TailwindConfig
    Node -->|reads config| PostCSS
    Node -->|reads| Package
    Node -->|reads| TSConfig
    Node -->|reads| NVM
    Node -->|"SSG build reads"| Calendar
    Node -->|"SSG build reads"| FAQEN
    Node -->|"SSG build reads"| FAQPT
    Node -->|"SSG build reads"| Sponsors
    Node -->|"SSG build reads"| Keynotes

    Node -->|generates pages via| Layout
    Node -->|applies styles from| Globals
    Layout -->|renders| PageHome
    Layout -->|renders| PageLocale
    PageLocale -->|renders| LayoutLocale
    PageHome -->|includes| Hero
    PageHome -->|includes| FAQComp
    PageHome -->|includes| Schedule
    PageHome -->|includes| Footer
    Hero -->|uses| UIlib
    FAQComp -->|uses| UIlib
    Schedule -->|uses| UIlib
    Hooks -->|hydrate| Browser
    Utils -->|utility| Browser
    EN -->|provides| LayoutLocale
    PT -->|provides| LayoutLocale
    ClientLoc -->|provides| Browser
    ServerLoc -->|provides| Node

    Browser -->|requests asset| CDN
    CDN -->|serves| Browser
    CDN -->|routes| NextServer
    NextServer -->|serves SSR| Browser

    %% Click Events
    click Husky "https://github.com/pythonnortebrasil/pynorte2025-site/tree/main/.husky/commit-msg"
    click Commitlint "https://github.com/pythonnortebrasil/pynorte2025-site/blob/main/.commitlintrc.json"
    click CI "https://github.com/pythonnortebrasil/pynorte2025-site/blob/main/.github/workflows/ci-linting.yml"
    click CI "https://github.com/pythonnortebrasil/pynorte2025-site/blob/main/.github/workflows/deploy.yml"
    click NextConfig "https://github.com/pythonnortebrasil/pynorte2025-site/blob/main/next.config.ts"
    click TailwindConfig "https://github.com/pythonnortebrasil/pynorte2025-site/blob/main/tailwind.config.ts"
    click PostCSS "https://github.com/pythonnortebrasil/pynorte2025-site/blob/main/postcss.config.mjs"
    click Package "https://github.com/pythonnortebrasil/pynorte2025-site/blob/main/package.json"
    click TSConfig "https://github.com/pythonnortebrasil/pynorte2025-site/blob/main/tsconfig.json"
    click NVM "https://github.com/pythonnortebrasil/pynorte2025-site/blob/main/.nvmrc"
    click Layout "https://github.com/pythonnortebrasil/pynorte2025-site/blob/main/src/app/layout.tsx"
    click Globals "https://github.com/pythonnortebrasil/pynorte2025-site/blob/main/src/app/globals.css"
    click PageLocale "https://github.com/pythonnortebrasil/pynorte2025-site/blob/main/src/app/[locale]/page.tsx"
    click LayoutLocale "https://github.com/pythonnortebrasil/pynorte2025-site/blob/main/src/app/[locale]/layout.tsx"
    click PageHome "https://github.com/pythonnortebrasil/pynorte2025-site/blob/main/src/app/page.tsx"
    click NotFound "https://github.com/pythonnortebrasil/pynorte2025-site/blob/main/src/app/404.tsx"
    click Calendar "https://github.com/pythonnortebrasil/pynorte2025-site/blob/main/src/data/calendar.json"
    click FAQEN "https://github.com/pythonnortebrasil/pynorte2025-site/blob/main/src/data/faq.en.json"
    click FAQPT "https://github.com/pythonnortebrasil/pynorte2025-site/blob/main/src/data/faq.pt.json"
    click Sponsors "https://github.com/pythonnortebrasil/pynorte2025-site/blob/main/src/data/sponsors.json"
    click Keynotes "https://github.com/pythonnortebrasil/pynorte2025-site/blob/main/src/data/keynotes.json"
    click Hero "https://github.com/pythonnortebrasil/pynorte2025-site/blob/main/src/components/Hero.tsx"
    click FAQComp "https://github.com/pythonnortebrasil/pynorte2025-site/blob/main/src/components/FAQ.tsx"
    click Schedule "https://github.com/pythonnortebrasil/pynorte2025-site/blob/main/src/components/Schedule.tsx"
    click Footer "https://github.com/pythonnortebrasil/pynorte2025-site/blob/main/src/components/Footer.tsx"
    click UIlib "https://github.com/pythonnortebrasil/pynorte2025-site/tree/main/src/components/ui"
    click Hooks "https://github.com/pythonnortebrasil/pynorte2025-site/tree/main/src/hooks"
    click Utils "https://github.com/pythonnortebrasil/pynorte2025-site/blob/main/src/lib/utils.ts"
    click EN "https://github.com/pythonnortebrasil/pynorte2025-site/blob/main/src/locales/en.ts"
    click PT "https://github.com/pythonnortebrasil/pynorte2025-site/blob/main/src/locales/pt.ts"
    click ClientLoc "https://github.com/pythonnortebrasil/pynorte2025-site/blob/main/src/locales/client.ts"
    click ServerLoc "https://github.com/pythonnortebrasil/pynorte2025-site/blob/main/src/locales/server.ts"
    click Manifest "https://github.com/pythonnortebrasil/pynorte2025-site/blob/main/src/app/manifest.json"
    click Robots "https://github.com/pythonnortebrasil/pynorte2025-site/blob/main/public/robots.txt"

    %% Styles
    classDef dev fill:#e0f7e9,stroke:#2e7d32,stroke-width:1px,color:#2e7d32;
    classDef data fill:#fff3e0,stroke:#ef6c00,stroke-width:1px,color:#ef6c00;
    classDef ui fill:#f3e5f5,stroke:#6a1b9a,stroke-width:1px,color:#6a1b9a;
    classDef run fill:#e3f2fd,stroke:#1565c0,stroke-width:1px,color:#1565c0;
```
