# robertoumbelino/commemorative-dates architecture

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

- Interactive diagram: https://gitdiagram.com/robertoumbelino/commemorative-dates
- Repository: https://github.com/robertoumbelino/commemorative-dates

## Overview

##### Main Components

a) Client-Side Layer:
- PWA Shell
- React Components Structure
- Static Assets
- Service Worker

b) Server-Side Layer:
- Next.js Server
- API Routes
- Server-Side Rendering Logic

c) Build & Configuration:
- Next.js Configuration
- PWA Configuration
- TypeScript Configuration

**┌─────────────────────────────────────┐**
- Client Layer             │
- (Browser/PWA/Service Worker)       │
- ┘
- ↕
**┌─────────────────────────────────────┐**
- Next.js Server Layer        │
- (SSR/API Routes/Static Gen)      │
- ┘
- ↕
**┌─────────────────────────────────────┐**
- Build & Configuration        │
- ┘

##### Component Details

a) Client Layer (Blue):
- PWA Container (showing manifest.json and service worker integration)
- React Components Tree:
- Page Components (/src/pages)
- Shared Components (/src/components)
- CommemorativeDate Feature
- Chakra UI Integration

b) Server Layer (Green):
- API Routes (/src/pages/api)
- Server-Side Rendering Pipeline
- Static Generation

c) Build & Configuration (Gray):
- TypeScript Configuration
- Next.js Config
- PWA Config
- Prisma Integration

- Service worker communication with client
- SSR flow from server to client
- API route requests
- Build-time processes

##### Implementation Notes

- Rectangles: Major components
- Rounded rectangles: Features/modules
- Hexagons: External services/integrations

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        PWA[PWA Shell]
        SW[Service Worker]:::file
        Manifest[PWA Manifest]:::file
        Workbox[Workbox Implementation]:::file
        
        subgraph Components
            Pages[Page Components]:::dir
            Shared[Shared Components]:::dir
            CommDate[CommemorativeDate Feature]:::dir
            Layout[Page Layout]:::file
        end
        
        subgraph Static
            Images[Images Directory]:::dir
            Icons[Icons]:::dir
            AppleAssets[Apple Assets]:::dir
        end
        
        PWA --> SW
        PWA --> Manifest
        PWA --> Workbox
        PWA --> Components
        PWA --> Static
    end
    
    subgraph Server
        NextServer[Next.js Server]
        APIRoutes[API Routes]:::dir
        APIExample[API Endpoint Example]:::file
        AppEntry[App Entry Point]:::file
        DocConfig[Document Configuration]:::file
        
        NextServer --> APIRoutes
        NextServer --> AppEntry
        NextServer --> DocConfig
    end
    
    subgraph Config
        NextConfig[Next.js Config]:::file
        TSConfig[TypeScript Config]:::file
        TSDeclarations[TypeScript Declarations]:::file
        EnvVars[Environment Variables]:::file
        ESLint[ESLint Configuration]:::file
        Theme[Theme Configuration]:::file
    end
    
    subgraph Database
        PrismaSchema[Prisma Schema]:::file
    end
    
    subgraph CommDateFeature
        List[List Component]:::file
        Item[Item Component]:::file
        Dot[Dot Component]:::file
        Hook[Custom Hook]:::file
    end
    
    Server --> Client
    Config --> Server
    Database --> Server
    CommDateFeature --> Components
    
    %% Click Events
    click SW "https://github.com/robertoumbelino/commemorative-dates/blob/master//public/sw.js"
    click Manifest "https://github.com/robertoumbelino/commemorative-dates/blob/master//public/manifest.json"
    click Workbox "https://github.com/robertoumbelino/commemorative-dates/blob/master//public/workbox-1ffba242.js"
    click Pages "https://github.com/robertoumbelino/commemorative-dates/tree/master//src/pages"
    click Shared "https://github.com/robertoumbelino/commemorative-dates/tree/master//src/components"
    click CommDate "https://github.com/robertoumbelino/commemorative-dates/tree/master//src/components/CommemorativeDate"
    click Layout "https://github.com/robertoumbelino/commemorative-dates/tree/master//src/components/Page"
    click Images "https://github.com/robertoumbelino/commemorative-dates/tree/master//public/images"
    click Icons "https://github.com/robertoumbelino/commemorative-dates/tree/master//public/images/icons"
    click AppleAssets "https://github.com/robertoumbelino/commemorative-dates/tree/master//public/images/apple"
    click APIRoutes "https://github.com/robertoumbelino/commemorative-dates/tree/master//src/pages/api"
    click APIExample "https://github.com/robertoumbelino/commemorative-dates/blob/master//src/pages/api/current.ts"
    click AppEntry "https://github.com/robertoumbelino/commemorative-dates/blob/master//src/pages/_app.tsx"
    click DocConfig "https://github.com/robertoumbelino/commemorative-dates/blob/master//src/pages/_document.tsx"
    click NextConfig "https://github.com/robertoumbelino/commemorative-dates/blob/master//next.config.js"
    click TSConfig "https://github.com/robertoumbelino/commemorative-dates/blob/master//tsconfig.json"
    click TSDeclarations "https://github.com/robertoumbelino/commemorative-dates/blob/master//next-env.d.ts"
    click EnvVars "https://github.com/robertoumbelino/commemorative-dates/blob/master//.env.sample"
    click ESLint "https://github.com/robertoumbelino/commemorative-dates/blob/master//.eslintrc"
    click PrismaSchema "https://github.com/robertoumbelino/commemorative-dates/blob/master//prisma/schema.prisma"
    click Theme "https://github.com/robertoumbelino/commemorative-dates/blob/master//src/styles/theme.ts"
    click List "https://github.com/robertoumbelino/commemorative-dates/blob/master//src/components/CommemorativeDate/components/List/index.tsx"
    click Item "https://github.com/robertoumbelino/commemorative-dates/blob/master//src/components/CommemorativeDate/components/Item/index.tsx"
    click Dot "https://github.com/robertoumbelino/commemorative-dates/blob/master//src/components/CommemorativeDate/components/Dot/index.tsx"
    click Hook "https://github.com/robertoumbelino/commemorative-dates/blob/master//src/components/CommemorativeDate/hooks/useCommemorativeDate.ts"
    
    classDef file fill:#f9f,stroke:#333,stroke-width:2px
    classDef dir fill:#bbf,stroke:#333,stroke-width:2px
    
    %% Legend
    subgraph Legend
        F[File]:::file
        D[Directory]:::dir
    end
```
