# ganesshkumar/obsidian-plugins-stats-ui architecture

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

- Interactive diagram: https://gitdiagram.com/ganesshkumar/obsidian-plugins-stats-ui
- Repository: https://github.com/ganesshkumar/obsidian-plugins-stats-ui

## Overview

##### Main Components

a) Frontend Layer:
- Next.js Application (React)
- Components Structure
- Layout Components (Header, Footer, Navbar)
- Feature Components (Plugin Lists, Cards, Stats)
- Page Components (Home, New, Updates, etc.)
- Client-side State Management (for favorites)

b) Data Layer:
- Prisma Database (indicated by prisma/schema.prisma)
- Cache System (shown by cache directory)
- Static Data Files (in data directory)

c) API Integration:
- GitHub API Integration (for plugin repository data)
- Telemetry System (Azure Application Insights)

##### Key Relationships to Highlight

**User Interface → Next.js Pages → Data Fetching Layer → External Services**
- ↳ Cache Layer
- ↳ Database Layer

##### Specific Implementation Details

- Plugin Statistics Collection
- Favoriting System
- Update Tracking
- Tag Management
- Search & Filtering
- RSS Generation

##### Important Architectural Patterns

- Server-Side Rendering (Next.js)
- Static Site Generation (for blog posts)
- API Routes
- Caching Strategy

##### Technical Stack Indicators

Technology badges for:
- Next.js
- TypeScript
- Prisma
- Tailwind CSS
- Azure Application Insights

a) Frontend Section:
**Pages (pages/)**
- ↳ Components (components/)
- ↳ Shared Components
- ↳ Feature-specific Components

b) Data Management:
**Data Sources**
- ↳ Prisma DB
- ↳ Cache Layer
- ↳ Static Files

c) External Services:
**GitHub API**
- ↳ Plugin Repository Data
- ↳ Repository Tags
- ↳ Release Information

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend
        NextApp["Next.js Application"]
        click NextApp "https://github.com/ganesshkumar/obsidian-plugins-stats-ui/blob/master/pages/_app.tsx"
        
        subgraph Layouts
            Header["Header Component"]
            Footer["Footer Component"]
            Navbar["Navigation Bar"]
            PageLayout["Page Layout"]
            click Header "https://github.com/ganesshkumar/obsidian-plugins-stats-ui/blob/master/components/Header.tsx"
            click Footer "https://github.com/ganesshkumar/obsidian-plugins-stats-ui/blob/master/components/Footer.tsx"
            click Navbar "https://github.com/ganesshkumar/obsidian-plugins-stats-ui/blob/master/components/Navbar.tsx"
            click PageLayout "https://github.com/ganesshkumar/obsidian-plugins-stats-ui/blob/master/components/Page.tsx"
        end

        subgraph Features
            PluginList["Plugin Lists"]
            PluginCard["Plugin Cards"]
            StatsDisplay["Stats Display"]
            FavoritesComp["Favorites Component"]
            click PluginList "https://github.com/ganesshkumar/obsidian-plugins-stats-ui/blob/master/components/AllPluinsList.tsx"
            click PluginCard "https://github.com/ganesshkumar/obsidian-plugins-stats-ui/blob/master/components/NewPluginCard.tsx"
            click StatsDisplay "https://github.com/ganesshkumar/obsidian-plugins-stats-ui/blob/master/components/PluginEcosystemStats.tsx"
            click FavoritesComp "https://github.com/ganesshkumar/obsidian-plugins-stats-ui/blob/master/components/Favorites.tsx"
        end

        subgraph Pages
            HomePage["Home Page"]
            NewPage["New Plugins"]
            UpdatesPage["Updates Page"]
            PluginDetail["Plugin Details"]
            click HomePage "https://github.com/ganesshkumar/obsidian-plugins-stats-ui/blob/master/pages/index.tsx"
            click NewPage "https://github.com/ganesshkumar/obsidian-plugins-stats-ui/blob/master/pages/new.tsx"
            click UpdatesPage "https://github.com/ganesshkumar/obsidian-plugins-stats-ui/blob/master/pages/updates.tsx"
            click PluginDetail "https://github.com/ganesshkumar/obsidian-plugins-stats-ui/blob/master/pages/plugins/[slug].tsx"
        end
    end

    subgraph DataLayer
        Database[(Prisma DB)]
        CacheSystem["Cache System"]
        StaticData["Static Data"]
        click Database "https://github.com/ganesshkumar/obsidian-plugins-stats-ui/blob/master/prisma/schema.prisma"
        click CacheSystem "https://github.com/ganesshkumar/obsidian-plugins-stats-ui/tree/master/cache"
        click StaticData "https://github.com/ganesshkumar/obsidian-plugins-stats-ui/tree/master/data"
    end

    subgraph Utils
        FavoritesUtil["Favorites System"]
        RSSGen["RSS Generator"]
        PluginMgmt["Plugin Management"]
        DateUtils["DateTime Utilities"]
        click FavoritesUtil "https://github.com/ganesshkumar/obsidian-plugins-stats-ui/blob/master/utils/favorites.ts"
        click RSSGen "https://github.com/ganesshkumar/obsidian-plugins-stats-ui/blob/master/utils/generate-rss.js"
        click PluginMgmt "https://github.com/ganesshkumar/obsidian-plugins-stats-ui/blob/master/utils/plugins.ts"
        click DateUtils "https://github.com/ganesshkumar/obsidian-plugins-stats-ui/blob/master/utils/datetime.ts"
    end

    subgraph ExternalServices
        GitHub["GitHub API"]
        Telemetry["Azure App Insights"]
        click Telemetry "https://github.com/ganesshkumar/obsidian-plugins-stats-ui/blob/master/telemetry/next-applicationInsights.ts"
    end

    subgraph StaticContent
        Posts["Blog Posts"]
        Assets["Public Assets"]
        Styles["Global Styles"]
        TailwindConfig["Tailwind Config"]
        click Posts "https://github.com/ganesshkumar/obsidian-plugins-stats-ui/tree/master/posts"
        click Assets "https://github.com/ganesshkumar/obsidian-plugins-stats-ui/tree/master/public/images"
        click Styles "https://github.com/ganesshkumar/obsidian-plugins-stats-ui/blob/master/styles/globals.css"
        click TailwindConfig "https://github.com/ganesshkumar/obsidian-plugins-stats-ui/blob/master/tailwind.config.js"
    end

    %% Relationships
    NextApp --> Layouts
    NextApp --> Features
    NextApp --> Pages
    Features --> Utils
    Pages --> DataLayer
    Utils --> DataLayer
    DataLayer --> ExternalServices
    NextApp --> StaticContent

    %% Styling
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef data fill:#2ecc71,stroke:#27ae60,color:white
    classDef external fill:#e67e22,stroke:#d35400,color:white
    classDef static fill:#9b59b6,stroke:#8e44ad,color:white
    classDef util fill:#f1c40f,stroke:#f39c12,color:black

    class NextApp,Layouts,Features,Pages frontend
    class Database,CacheSystem,StaticData data
    class GitHub,Telemetry external
    class Posts,Assets,Styles,TailwindConfig static
    class FavoritesUtil,RSSGen,PluginMgmt,DateUtils util
```
