# gabehug/bpd-blog architecture

> Architecture diagram of the GitHub repository gabehug/bpd-blog, 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/gabehug/bpd-blog
- Repository: https://github.com/gabehug/bpd-blog

## Overview

##### Main Components

a) Client-Side Layer:
- Client-entry point (entry.client.tsx)
- Main routes structure (/postList, /postList/$postId)
- Static assets (CSS, images)

b) Server-Side Layer:
- Server entry point (entry.server.tsx)
- Remix runtime/router
- Root.tsx as the main layout container

c) Data Layer:
- Prisma ORM component
- MySQL database
- Database schema (from prisma/schema.prisma)

##### Component Relationships

- Browser → Client Entry → Remix Router
- Remix Router → Server Entry → Root Layout
- Root Layout → Individual Routes
- Routes → Prisma Client (db.server.ts)
- Prisma Client → MySQL Database

Create three main vertical sections:

- Client Layer  |

- Server Layer  |

- Data Layer   |

##### Additional Elements

Annotations for:
- Vercel hosting environment
- SSL certification (noted by sslCert.pem)
- Static asset handling (public directory)
- Style management (global and route-specific CSS)

##### Technical Details to Highlight

- TypeScript integration
- Prisma schema definition
- Route-based code splitting
- CSS organization strategy

- Special symbols used for Remix-specific features

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Client
        Browser["🌐 Browser"]
        ClientEntry["Client Entry"]:::client
        RemixRouter["Remix Router"]:::client
        StaticAssets["Static Assets"]:::client
        Analytics["Google Analytics"]:::client
    end

    subgraph Server
        ServerEntry["Server Entry"]:::server
        RootLayout["Root Layout"]:::server
        
        subgraph Routes
            PostList["Post List Route"]:::server
            PostDetail["Post Detail Route"]:::server
        end
    end

    subgraph Data
        PrismaClient["Prisma Client"]:::data
        Database[(MySQL Database)]:::data
        PrismaSchema["Prisma Schema"]:::data
    end

    %% Connections
    Browser --> ClientEntry
    ClientEntry --> RemixRouter
    RemixRouter --> ServerEntry
    ServerEntry --> RootLayout
    RootLayout --> PostList
    RootLayout --> PostDetail
    PostList --> PrismaClient
    PostDetail --> PrismaClient
    PrismaClient --> Database
    PrismaClient -.-> PrismaSchema
    Browser --> Analytics
    Browser --> StaticAssets

    %% Click Events
    click ClientEntry "https://github.com/gabehug/bpd-blog/blob/master/app/entry.client.tsx"
    click ServerEntry "https://github.com/gabehug/bpd-blog/blob/master/app/entry.server.tsx"
    click RootLayout "https://github.com/gabehug/bpd-blog/blob/master/app/root.tsx"
    click PostList "https://github.com/gabehug/bpd-blog/blob/master/app/routes/postList.tsx"
    click PostDetail "https://github.com/gabehug/bpd-blog/blob/master/app/routes/postList/$postId.tsx"
    click PrismaClient "https://github.com/gabehug/bpd-blog/blob/master/app/utils/db.server.ts"
    click PrismaSchema "https://github.com/gabehug/bpd-blog/blob/master/prisma/schema.prisma"
    click Analytics "https://github.com/gabehug/bpd-blog/blob/master/app/utils/gtags.client.ts"
    click StaticAssets "https://github.com/gabehug/bpd-blog/tree/master/public/"

    %% Styles
    classDef client fill:#E7B275,stroke:#333,stroke-width:2px
    classDef server fill:#5D3F2E,stroke:#333,stroke-width:2px,color:#fff
    classDef data fill:#F4F4F4,stroke:#333,stroke-width:2px

    %% Legend
    subgraph Legend
        ClientComp["Client Component"]:::client
        ServerComp["Server Component"]:::server
        DataComp["Data Component"]:::data
        Flow["→ Data Flow"]
        Dep["--> Dependency"]
    end
```
