# prosamik/prosamik-frontend-app architecture

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

- Interactive diagram: https://gitdiagram.com/prosamik/prosamik-frontend-app
- Repository: https://github.com/prosamik/prosamik-frontend-app

## Overview

##### Main Components Identification

The system should be represented as a modern Next.js application with the following key components:

a) Client-Side Layer:
- Pages (Dynamic and Static)
- Components (Layout, Shared, Article-specific)
- Hooks (Custom functionality)
- Utilities (Content processors)

b) Server-Side Layer:
- API Routes
- Data Fetching
- Static Site Generation capabilities

**┌─ Client Layer ─────────────────────────────┐**
- ┌─ Pages ─────┐ ┌─ Components ──────────┐ │
- Home      │ │ - MainLayout         │ │
- Blogs     │ │ - ContentComponents  │ │
- Projects  │ │ - ArticleComponents  │ │
- ┘ └────────────────────────┘ │
- ┌─ Hooks ─────┐ ┌─ Utils ──────────────┐  │
- Content     │ │ Content Processors   │  │
- Analytics   │ │ Date Utils          │  │
- Repo Data   │ │ Type Guards         │  │
- ┘ └────────────────────────┘ │
- ┘

**┌─ External Services ───────────────────────┐**
- ┌─ GitHub API ─┐ ┌─ Analytics ─────────┐ │
- README Data  │ │ Page Views         │ │
- Repo Info    │ │ User Interactions  │ │
- ┘ └───────────────────────┘│
- ┘

**┌─ Infrastructure ──────────────────────────┐**
- ┌─ Next.js ────┐ ┌─ Static Assets ────┐  │
- SSR/SSG      │ │ Public Directory   │  │
- API Routes   │ │ Images/Sitemaps    │  │
- ┘ └───────────────────────┘ │
- ┘

##### Key Interactions to Highlight

- Data flow from GitHub API to content processors
- Content rendering pipeline
- User interaction flows
- Analytics data collection

##### Technical Stack Indicators

Clearly label technologies:
- Next.js
- TypeScript
- Tailwind CSS
- GitHub API Integration
- Markdown Processing

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Pages["Pages Layer"]
        HomePage["Home Page"]
        BlogPages["Blog Pages"]
        ProjectPages["Project Pages"]
        
        subgraph Components
            Layout["Layout Components"]
            MainLayout["Main Layout"]
            Nav["Navigation"]
            Footer["Footer"]
            
            Content["Content Components"]
            ContentList["Content List"]
            ContentPage["Content Page"]
            PreviewCards["Preview Cards"]
            
            Article["Article Components"]
            ArticleLayout["Article Layout"]
            ArticleHeader["Article Header"]
            CodeBlock["Code Block Renderer"]
            
            Shared["Shared Components"]
            Search["Search Panel"]
            Cards["Item Cards"]
            Lists["Item Lists"]
        end
        
        subgraph Hooks
            ContentHook["Content Processing"]
            AnalyticsHook["Analytics"]
            RepoHook["Repository Data"]
            MarkdownHook["Markdown Processing"]
        end
        
        subgraph Utils
            CodeProcessor["Code Block Processor"]
            MediaProcessor["Media Processor"]
            TableProcessor["Table Processor"]
            ListProcessor["List Processor"]
        end
    end
    
    subgraph External
        GitHub["GitHub API"]
        Analytics["Analytics Service"]
    end
    
    subgraph Infrastructure
        NextJS["Next.js SSR/SSG"]
        SEO["SEO Component"]
        Loading["Loading States"]
        ErrorHandler["Error Handling"]
        Types["Type Definitions"]
    end
    
    GitHub --> RepoHook
    RepoHook --> ContentHook
    ContentHook --> ContentPage
    AnalyticsHook --> Analytics
    
    ContentHook --> CodeProcessor
    ContentHook --> MediaProcessor
    ContentHook --> TableProcessor
    ContentHook --> ListProcessor
    
    MainLayout --> Nav
    MainLayout --> Footer
    MainLayout --> ContentPage
    
    ArticleLayout --> ArticleHeader
    ArticleLayout --> CodeBlock
    
    classDef default fill:#f9f9f9,stroke:#333,stroke-width:2px
    classDef infrastructure fill:#FFE4B5,stroke:#333
    classDef external fill:#90EE90,stroke:#333
    classDef client fill:#ADD8E6,stroke:#333
    
    class NextJS,SEO,Loading,ErrorHandler,Types infrastructure
    class GitHub,Analytics external
    class Pages,Components,Hooks,Utils client
    
    click Pages "https://github.com/prosamik/prosamik-frontend-app/tree/main/src/pages"
    click HomePage "https://github.com/prosamik/prosamik-frontend-app/blob/main/src/pages/index.tsx"
    click BlogPages "https://github.com/prosamik/prosamik-frontend-app/blob/main/src/pages/blogs/[slug].tsx"
    click ProjectPages "https://github.com/prosamik/prosamik-frontend-app/blob/main/src/pages/projects/[slug].tsx"
    click MainLayout "https://github.com/prosamik/prosamik-frontend-app/blob/main/src/components/MainLayout.tsx"
    click Nav "https://github.com/prosamik/prosamik-frontend-app/blob/main/src/components/layout/Navigation.tsx"
    click Footer "https://github.com/prosamik/prosamik-frontend-app/blob/main/src/components/layout/Footer.tsx"
    click ContentList "https://github.com/prosamik/prosamik-frontend-app/blob/main/src/components/ContentList.tsx"
    click ContentPage "https://github.com/prosamik/prosamik-frontend-app/blob/main/src/components/ContentPage.tsx"
    click PreviewCards "https://github.com/prosamik/prosamik-frontend-app/blob/main/src/components/ContentPreviewCards.tsx"
    click ArticleLayout "https://github.com/prosamik/prosamik-frontend-app/blob/main/src/components/article/ArticleLayout.tsx"
    click ArticleHeader "https://github.com/prosamik/prosamik-frontend-app/blob/main/src/components/article/ArticleHeader.tsx"
    click CodeBlock "https://github.com/prosamik/prosamik-frontend-app/blob/main/src/components/article/CodeBlockSyntaxHighlighter.tsx"
    click CodeProcessor "https://github.com/prosamik/prosamik-frontend-app/blob/main/src/utils/contentProcessors/codeBlockProcessor.ts"
    click MediaProcessor "https://github.com/prosamik/prosamik-frontend-app/blob/main/src/utils/contentProcessors/mediaCenterProcessor.ts"
    click TableProcessor "https://github.com/prosamik/prosamik-frontend-app/blob/main/src/utils/contentProcessors/tableProcessor.ts"
    click ListProcessor "https://github.com/prosamik/prosamik-frontend-app/blob/main/src/utils/contentProcessors/listItemProcessor.ts"
    click ContentHook "https://github.com/prosamik/prosamik-frontend-app/blob/main/src/hooks/useProcessedContent.ts"
    click AnalyticsHook "https://github.com/prosamik/prosamik-frontend-app/blob/main/src/hooks/usePageAnalytics.ts"
    click RepoHook "https://github.com/prosamik/prosamik-frontend-app/blob/main/src/hooks/useRepoHandler.ts"
    click MarkdownHook "https://github.com/prosamik/prosamik-frontend-app/blob/main/src/hooks/useMarkdownData.ts"
    click Search "https://github.com/prosamik/prosamik-frontend-app/blob/main/src/components/shared/SearchPanel.tsx"
    click Cards "https://github.com/prosamik/prosamik-frontend-app/blob/main/src/components/shared/ItemCard.tsx"
    click Lists "https://github.com/prosamik/prosamik-frontend-app/blob/main/src/components/shared/ItemList.tsx"
    click SEO "https://github.com/prosamik/prosamik-frontend-app/blob/main/src/components/layout/SEO.tsx"
    click Loading "https://github.com/prosamik/prosamik-frontend-app/blob/main/src/components/layout/Loading.tsx"
    click ErrorHandler "https://github.com/prosamik/prosamik-frontend-app/blob/main/src/components/layout/ErrorMessage.tsx"
```
