# sourceguidehq/main architecture

> Architecture diagram of the GitHub repository sourceguidehq/main, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sourceguidehq/main
- Repository: https://github.com/sourceguidehq/main

## Overview

##### Main Components

A. Frontend Layer
- Next.js Application Structure
- Pages (app directory structure)
- Components (UI and Custom)
- Client-Side Features
- Static Assets
- Styling (Tailwind CSS)

B. Data Layer
- Static JSON Files
- organizations.json
- programs.json

C. Integration Layer
- Analytics Integration (Google Analytics)
- External Links (Discord, GitHub)

**┌─────────────────────────────────────┐**
- Client Layer             │
- ┘
- ↕
**┌─────────────────────────────────────┐**
- Application Layer           │
- ┘
- ↕
**┌─────────────────────────────────────┐**
- Data Layer               │
- ┘

##### Detailed Component Breakdown

A. Client Layer (Top)
- Navigation Menu
- Pages (Home, About, Issues, Programs, etc.)
- UI Components (Cards, Buttons, Dialogs)
- Pages (rectangles)
- Components (rounded rectangles)

B. Application Layer (Middle)
- Next.js Router
- Page Components
- Utility Functions (lib/utils.ts)
- Component Library

C. Data Layer (Bottom)
- JSON Data Store
- External Integrations

##### Important Elements to Highlight

A. Routing Structure
- Dynamic routes ([org])
- Static routes (about, programs, etc.)

B. Component Organization
- UI components (/components/ui)
- Custom components (/comps)

C. Data Flow
- How data flows from JSON files to components
- Integration points with external services

##### Technical Stack Indicators

Technology badges or labels for:
- Next.js
- TypeScript
- Tailwind CSS
- React
- Google Analytics

Remember to indicate the app's primary features:
- Issue discovery
- Program browsing
- User engagement points
- Static content delivery

This will create a comprehensive yet clear visualization of SourceGuide's architecture that effectively communicates the system's design to other engineers and stakeholders.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        User(("User"))
        Browser["Web Browser"]
    end

    subgraph "Frontend Layer"
        Layout["App Layout"]:::frontend
        Pages["Pages"]:::frontend
        UIComps["UI Components"]:::frontend
        CustomComps["Custom Components"]:::frontend
        Styles["Styling"]:::frontend

        subgraph "Page Components"
            Home["Home Page"]:::frontend
            Issues["Issues Page"]:::frontend
            Programs["Programs Page"]:::frontend
            OrgRoutes["Organization Routes"]:::frontend
        end

        subgraph "UI Library"
            NavMenu["Navigation Menu"]:::frontend
            Cards["Card Components"]:::frontend
            Dialogs["Dialog Components"]:::frontend
            Buttons["Button Components"]:::frontend
        end

        subgraph "Custom Components"
            NavBar["Navigation Bar"]:::frontend
            Hero["Hero Section"]:::frontend
            ProgramsDisplay["Programs Display"]:::frontend
            FooterComp["Footer"]:::frontend
            FAQ["FAQ Section"]:::frontend
        end
    end

    subgraph "Integration Layer"
        GA["Google Analytics"]:::integration
        Discord["Discord"]:::external
        GitHub["GitHub"]:::external
    end

    subgraph "Data Layer"
        OrgData["Organizations Data"]:::data
        ProgData["Programs Data"]:::data
    end

    subgraph "Utility Layer"
        Utils["Utility Functions"]:::util
    end

    User --> Browser
    Browser --> Layout
    Layout --> Pages
    Pages --> |Renders| UIComps
    Pages --> |Renders| CustomComps
    CustomComps --> GA
    CustomComps --> |External Link| Discord
    CustomComps --> |External Link| GitHub
    Pages --> |Uses| Utils
    Pages --> |Reads| OrgData
    Pages --> |Reads| ProgData
    Styles --> Layout

    %% Click Events
    click Layout "https://github.com/sourceguidehq/main/blob/main/app/layout.tsx"
    click Home "https://github.com/sourceguidehq/main/blob/main/app/page.tsx"
    click Issues "https://github.com/sourceguidehq/main/blob/main/app/issues/page.tsx"
    click Programs "https://github.com/sourceguidehq/main/blob/main/app/programs/page.tsx"
    click OrgRoutes "https://github.com/sourceguidehq/main/blob/main/app/issues/[org]/page.tsx"
    click NavMenu "https://github.com/sourceguidehq/main/blob/main/components/ui/navigation-menu.tsx"
    click Cards "https://github.com/sourceguidehq/main/blob/main/components/ui/card.tsx"
    click Dialogs "https://github.com/sourceguidehq/main/blob/main/components/ui/dialog.tsx"
    click Buttons "https://github.com/sourceguidehq/main/blob/main/components/ui/button.tsx"
    click UIComps "https://github.com/sourceguidehq/main/tree/main/components/ui"
    click NavBar "https://github.com/sourceguidehq/main/blob/main/comps/navbar.tsx"
    click Hero "https://github.com/sourceguidehq/main/blob/main/comps/Hero.tsx"
    click ProgramsDisplay "https://github.com/sourceguidehq/main/blob/main/comps/Programs.tsx"
    click FooterComp "https://github.com/sourceguidehq/main/blob/main/comps/Footer.tsx"
    click FAQ "https://github.com/sourceguidehq/main/blob/main/comps/Faq.tsx"
    click OrgData "https://github.com/sourceguidehq/main/blob/main/public/organizations.json"
    click ProgData "https://github.com/sourceguidehq/main/blob/main/public/programs.json"
    click GA "https://github.com/sourceguidehq/main/blob/main/comps/GoogleAnalytics.tsx"
    click Utils "https://github.com/sourceguidehq/main/blob/main/lib/utils.ts"
    click Styles "https://github.com/sourceguidehq/main/blob/main/app/globals.css"

    %% Styling Classes
    classDef frontend fill:#3b82f6,color:white
    classDef data fill:#22c55e,color:white
    classDef integration fill:#f97316,color:white
    classDef external fill:#a855f7,color:white
    classDef util fill:#6b7280,color:white

    %% Legend
    subgraph Legend
        Frontend["Frontend Component"]:::frontend
        Data["Data Store"]:::data
        Integration["Integration"]:::integration
        External["External Service"]:::external
        Utility["Utility"]:::util
    end
```
