# lukman10a/markazulbayaan architecture

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

- Interactive diagram: https://gitdiagram.com/lukman10a/markazulbayaan
- Repository: https://github.com/lukman10a/markazulbayaan

## Overview

##### Main Components

A. Frontend Layer:
- Client-Side Components (src/components/)
- Navigation System (src/components/navBar/)
- Home Page Components (src/components/home/)
- UI Components (src/components/ui/)
- Blog Components (src/components/BlogLayout.tsx)
- Course Components (src/components/CourseDetails.tsx, Coursehero.tsx)

B. Backend Layer:
- API Routes (src/pages/api/)
- CMS Integration (src/cms/)
- Data Fetching Layer (src/lib/getMarkdownData.ts)

C. Content Management:
- NetlifyCMS Integration (public/admin/)
- Markdown Content Storage (public/_posts/, public/_featured/)

**┌─────────────────────────────────────────────────────────┐**
- Client Browser                         │
- ┘
- ↕
**┌─────────────────────────────────────────────────────────┐**
- Next.js Application                    │
- ┬─────────────────┬───────────────────┤
- Pages Layer   │  Components     │    CMS Layer      │
- (src/pages)   │  (src/components│    (src/cms)      │
- ┬────────┴────────┬────────┴────────┬──────────┘
- ↓                 ↓                 ↓
**┌────────────────┐ ┌─────────────┐ ┌─────────────────────┐**
- API Routes    │ │  Static     │ │    NetlifyCMS       │
- (/api)       │ │  Content    │ │    Integration      │
- ┘ └─────────────┘ └─────────────────────┘

##### Key Relationships to Highlight

a. Client-Side Flow:
- Next.js Pages → Components
- Components → UI Library
- Pages → API Routes

b. Content Management Flow:
- CMS → Markdown Files
- Markdown Files → Page Generation
- API Routes → External Services

##### Important Architectural Patterns

- Page-based Routing (Next.js pages directory)
- Component Composition (UI components hierarchy)
- API Routes for Backend Functions
- Static Content Generation (Markdown files)
- CMS Integration Pattern

##### Technical Stack Elements

- Next.js Framework
- React Components
- NetlifyCMS
- Markdown Processing
- Tailwind CSS (based on configuration files)
- TypeScript Support

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Client["Client Browser"]
        UI[User Interface]
    end

    subgraph NextApp["Next.js Application"]
        subgraph Pages["Pages Layer"]
            PR["Page Routing"]:::pages
            BC["Blog Content"]
            CC["Course Content"]
        end

        subgraph Components["Components Layer"]
            NAV["Navigation System"]:::nav
            HOME["Home Components"]:::home
            UILib["UI Component Library"]:::ui
            BLOG["Blog Components"]:::blog
            COURSE["Course Components"]:::course
            ANIM["UI Animations"]:::anim
            SHARED["Shared Components"]:::shared
            HOOKS["Application Hooks"]:::hooks
            STYLES["Global Styles"]:::styles
        end

        subgraph Backend["Backend Layer"]
            API["API Routes"]:::api
            DATA["Data Fetching Layer"]:::data
        end

        subgraph CMS["CMS Layer"]
            CMSINT["CMS Integration"]:::cms
            ADMIN["NetlifyCMS Admin"]:::admin
        end

        subgraph Content["Content Storage"]
            POSTS["Blog Posts"]:::posts
            FEATURED["Featured Content"]:::featured
        end
    end

    UI --> PR
    PR --> |Routes to| BC
    PR --> |Routes to| CC
    BC --> BLOG
    CC --> COURSE
    
    NAV --> UILib
    HOME --> UILib
    BLOG --> UILib
    COURSE --> UILib
    UILib --> ANIM
    UILib --> SHARED
    
    BLOG --> DATA
    COURSE --> DATA
    DATA --> POSTS
    DATA --> FEATURED
    
    CMSINT --> ADMIN
    ADMIN --> POSTS
    ADMIN --> FEATURED

    %% Click events for component mapping
    click PR "https://github.com/Lukman10a/markazulbayaan/tree/main/src/pages/"
    click NAV "https://github.com/Lukman10a/markazulbayaan/tree/main/src/components/navBar/"
    click HOME "https://github.com/Lukman10a/markazulbayaan/tree/main/src/components/home/"
    click UILib "https://github.com/Lukman10a/markazulbayaan/tree/main/src/components/ui/"
    click BLOG "https://github.com/Lukman10a/markazulbayaan/blob/main/src/components/BlogLayout.tsx"
    click COURSE "https://github.com/Lukman10a/markazulbayaan/blob/main/src/components/CourseDetails.tsx"
    click API "https://github.com/Lukman10a/markazulbayaan/tree/main/src/pages/api/"
    click CMSINT "https://github.com/Lukman10a/markazulbayaan/tree/main/src/cms/"
    click DATA "https://github.com/Lukman10a/markazulbayaan/blob/main/src/lib/getMarkdownData.ts"
    click ADMIN "https://github.com/Lukman10a/markazulbayaan/tree/main/public/admin/"
    click POSTS "https://github.com/Lukman10a/markazulbayaan/tree/main/public/_posts/"
    click FEATURED "https://github.com/Lukman10a/markazulbayaan/tree/main/public/_featured/"
    click ANIM "https://github.com/Lukman10a/markazulbayaan/tree/main/src/components/ui/animated/"
    click SHARED "https://github.com/Lukman10a/markazulbayaan/tree/main/src/components/shared/"
    click HOOKS "https://github.com/Lukman10a/markazulbayaan/tree/main/src/hooks/"
    click STYLES "https://github.com/Lukman10a/markazulbayaan/blob/main/src/styles/globals.css"

    %% Styling
    classDef pages fill:#f9f,stroke:#333
    classDef nav fill:#aaf,stroke:#333
    classDef home fill:#aaf,stroke:#333
    classDef ui fill:#aaf,stroke:#333
    classDef blog fill:#aaf,stroke:#333
    classDef course fill:#aaf,stroke:#333
    classDef api fill:#faf,stroke:#333
    classDef cms fill:#ffa,stroke:#333
    classDef data fill:#afa,stroke:#333
    classDef admin fill:#ffa,stroke:#333
    classDef posts fill:#ffa,stroke:#333
    classDef featured fill:#ffa,stroke:#333
    classDef anim fill:#aaf,stroke:#333
    classDef shared fill:#aaf,stroke:#333
    classDef hooks fill:#afa,stroke:#333
    classDef styles fill:#faf,stroke:#333
```
