# junjpan/serafina_storm architecture

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

- Interactive diagram: https://gitdiagram.com/junjpan/serafina_storm
- Repository: https://github.com/junjpan/serafina_storm

## Overview

##### Main Components

a) Application Layer:
- Next.js Application Core
- Pages/Routes Structure
- API Routes
- Theme Context System

b) Component Library Layer:
- Storybook Integration
- UI Components Repository
- Design System Integration

c) External Services:
- Chromatic (for Storybook hosting)
- Vercel/Heroku (deployment platforms)
- Figma Integration Points

**Top Tier: External Services & Integrations**
**Middle Tier: Application Core**
**Bottom Tier: Component Library & Design System**

##### Specific Component Relationships

a) Application Core:
- Next.js pages router structure (/src/app)
- ThemeContext provider to the application wrapper
- API routes integration

b) Component Library:
- Relationship between components and their stories
- Connection between Storybook and Chromatic
- Demonstrate the Figma integration workflow

##### Key Elements to Emphasize

a) Development Flow:
- Local development path
- Component development through Storybook
- Deployment pipelines (Vercel/Heroku)
- Chromatic review process

b) Design System Integration:
- Storybook to Figma workflow
- Component synchronization process
- Design token management (M3_token_reference.json)

##### Technical Details

- SCSS Module integration
- TypeScript configuration
- Next.js API routes
- GitHub workflow automation
- Storybook configuration

**┌─ External Services ─────────────┐**
- Chromatic - Figma - Deployment │
- Application Layer ─────────────┤
- Next.js Core                   │
- Pages & Routes                 │
- Theme Context                  │
- Component Library ────────────┤
- Storybook                     │
- UI Components                 │
- Style System                  │
- ┘

- Component Development Flow:
Component → Storybook → Chromatic → Figma
- Deployment Flow:
GitHub → CI/CD → Vercel/Heroku
- Theme Management:
ThemeContext → Components → SCSS

Remember to:
- Version/environment indicators
- Configuration dependencies
- Build/deployment pipelines

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph External
        CH[Chromatic]
        FG[Figma]
        VE[Vercel/Heroku]
    end

    subgraph AppLayer
        NC["Next.js Core"]:::core
        PR["Pages Router"]:::pages
        AR["API Routes"]:::api
        TC["Theme Context"]:::theme
        GS["Global Styles"]:::styles
    end

    subgraph ComponentLib
        SB["Storybook"]:::storybook
        UI["UI Components"]:::components
        DS["Design System"]:::design
        CS["Component Stories"]:::stories
        SS["Style System"]:::styles
    end

    %% Relationships
    NC --> PR
    NC --> AR
    NC --> TC
    NC --> GS
    
    UI --> CS
    UI --> SS
    DS --> UI
    SB --> CS
    
    CS --> CH
    CH --> FG
    TC --> UI
    
    %% External Service Connections
    NC --> VE
    SB --> CH

    %% Click Events
    click NC "https://github.com/Junjpan/serafina_storm/blob/master/src/app/layout.tsx"
    click PR "https://github.com/Junjpan/serafina_storm/tree/master/src/app/pages/"
    click AR "https://github.com/Junjpan/serafina_storm/blob/master/src/app/api/route.js"
    click TC "https://github.com/Junjpan/serafina_storm/blob/master/src/app/context/themeContext.tsx"
    click SB "https://github.com/Junjpan/serafina_storm/tree/master/.storybook/"
    click UI "https://github.com/Junjpan/serafina_storm/tree/master/src/components/"
    click DS "https://github.com/Junjpan/serafina_storm/blob/master/lib/M3_token_reference.json.json"
    click CH "https://github.com/Junjpan/serafina_storm/blob/master/.github/workflows/chromatic.yml"
    click CS "https://github.com/Junjpan/serafina_storm/blob/master/src/components/Button/Button.stories.tsx"
    click GS "https://github.com/Junjpan/serafina_storm/blob/master/src/app/globals.scss"
    click SS "https://github.com/Junjpan/serafina_storm/blob/master/src/components/Button/_button.scss"

    %% Styling
    classDef core fill:#2b6cb0,stroke:#1a365d,color:white
    classDef pages fill:#3182ce,stroke:#2c5282,color:white
    classDef api fill:#4299e1,stroke:#2b6cb0,color:white
    classDef theme fill:#805ad5,stroke:#553c9a,color:white
    classDef storybook fill:#48bb78,stroke:#2f855a,color:white
    classDef components fill:#68d391,stroke:#38a169,color:white
    classDef design fill:#9ae6b4,stroke:#48bb78,color:white
    classDef stories fill:#c6f6d5,stroke:#68d391,color:black
    classDef styles fill:#cbd5e0,stroke:#a0aec0,color:black
    classDef external fill:#ed8936,stroke:#c05621,color:white

    %% Legend
    subgraph Legend
        L1[Next.js Components]:::core
        L2[Storybook Elements]:::storybook
        L3[External Services]:::external
        L4[Theme Management]:::theme
        L5[Styling]:::styles
    end
```
