# neru-neru/blockory architecture

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

- Interactive diagram: https://gitdiagram.com/neru-neru/blockory
- Repository: https://github.com/neru-neru/blockory

## Overview

- Within the React Application, indicate the “index.tsx” bootstrapping App.tsx.

##### Architectural patterns
- Component-Based Architecture: Different directories for pages and components show a modular approach.
- Context API Usage: The “Authentication/AuthContext” indicates global state management.
- Separation of Concerns: Distinct folders for “blocks”, “components”, “pages”, and “pixi” help separate UI, logic, domain processing, and utilities.
- Docker Containerization: Including docker-compose, note that the app may be deployed or run in a containerized environment.

- Clear labels for each component (e.g., “Browser”, “React Application”, “Authentication Context”, “Diary Page”, “Header Component”, “Utility Modules – Blocks & Pixi”).
- Connections such as:
- The index.tsx bootstrapping the App.
- The App organizing routes that map to different pages.
- The AuthContext wrapping parts of the app that require authentication.
- Utility modules (blocks and pixi) being used by certain pages (for diary entry creation or thumbnail generation).

## Diagram (Mermaid)

```mermaid
flowchart TD
    Browser["Browser"]:::browser

    Browser -->|"HTTP/Localhost(3000)"| entry

    subgraph "React Application"
        entry["index.tsx / App.tsx (Entry Point)"]:::entry

        subgraph "Routing & Page Layer"
            routing["Routing"]:::routing
            subgraph "Pages"
                diary["Diary Page"]:::page
                diary_code["DiaryCode"]:::pageSub
                diary_content["DiaryContent"]:::pageSub

                writing1["WritingDiaryStep1 Page"]:::page
                editor["Editor"]:::pageSub
                note["Note"]:::pageSub
                procedure["Procedure"]:::pageSub
                toStep2["ToStep2Button"]:::pageSub

                writing2["WritingDiaryStep2 Page"]:::page
                description["DescriptionForm"]:::pageSub

                myDiaryList["MyDiaryList Page"]:::page
                otherDiaryList["OtherDiaryList Page"]:::page

                register["Register Page"]:::page
                signIn["SignIn Page"]:::page
                topPage["Top Page"]:::page
            end
        end

        auth["Authentication Context"]:::auth

        subgraph "Reusable UI Components"
            header["Header Component"]:::component
            headerButton["HeaderButton"]:::componentSub
            calendar["Calendar"]:::component
            flatButton["FlatButton"]:::component
            pageWrapper["PageWrapper"]:::component
            thumbnailList["ThumbnailList"]:::component
        end

        subgraph "Utility Modules"
            blocks["Blocks Scripts"]:::util
            pixi["Pixi Utilities"]:::util
        end

        types["Type Definitions"]:::types
    end

    docker["Docker Container (docker-compose.yml)"]:::docker

    %% Connections within React Application
    entry -->|"Bootstraps"| routing

    routing -->|"Renders"| diary
    diary -->|"Contains"| diary_code
    diary -->|"Contains"| diary_content

    routing -->|"Renders"| writing1
    writing1 -->|"Includes"| editor
    writing1 -->|"Includes"| note
    writing1 -->|"Includes"| procedure
    writing1 -->|"Includes"| toStep2

    routing -->|"Renders"| writing2
    writing2 -->|"Includes"| description

    routing -->|"Renders"| myDiaryList
    routing -->|"Renders"| otherDiaryList
    routing -->|"Renders"| register
    routing -->|"Renders"| signIn
    routing -->|"Renders"| topPage

    %% Authentication providing user state
    auth -->|"ProvidesUserContext"| routing

    %% UI Components usage in pages
    header -->|"UsedInPages"| routing
    calendar -->|"UsedInPages"| routing
    flatButton -->|"UsedInPages"| routing
    pageWrapper -->|"UsedInPages"| routing
    thumbnailList -->|"UsedInPages"| routing

    %% Utility Modules supporting pages
    blocks -->|"ProcessesContent"| routing
    pixi -->|"GeneratesThumbnails"| routing

    %% Type Definitions support overall design
    types -->|"DefinesModelsFor"| routing

    %% Docker container hosting the application
    docker -->|"HostsApp"| entry

    %% Click Events
    click entry "https://github.com/neru-neru/blockory/blob/main/blockory/src/index.tsx & blockory/src/App.tsx"
    click auth "https://github.com/neru-neru/blockory/blob/main/blockory/src/Authentication/AuthContext/AuthContext.tsx"

    click diary "https://github.com/neru-neru/blockory/blob/main/blockory/src/pages/Diary/Diary.tsx"
    click diary_code "https://github.com/neru-neru/blockory/blob/main/blockory/src/pages/Diary/DiaryCode/DiaryCode.tsx"
    click diary_content "https://github.com/neru-neru/blockory/blob/main/blockory/src/pages/Diary/DiaryContent/DiaryContent.tsx"

    click writing1 "https://github.com/neru-neru/blockory/blob/main/blockory/src/pages/WritingDiaryStep1/WritingDiaryStep1.tsx"
    click editor "https://github.com/neru-neru/blockory/blob/main/blockory/src/pages/WritingDiaryStep1/Editor/Editor.tsx"
    click note "https://github.com/neru-neru/blockory/blob/main/blockory/src/pages/WritingDiaryStep1/Note/Note.tsx"
    click procedure "https://github.com/neru-neru/blockory/blob/main/blockory/src/pages/WritingDiaryStep1/Procedure/Procedure.tsx"
    click toStep2 "https://github.com/neru-neru/blockory/blob/main/blockory/src/pages/WritingDiaryStep1/ToStep2Button/ToStep2Button.tsx"

    click writing2 "https://github.com/neru-neru/blockory/blob/main/blockory/src/pages/WritingDiaryStep2/WritingDiaryStep2.tsx"
    click description "https://github.com/neru-neru/blockory/blob/main/blockory/src/pages/WritingDiaryStep2/DescriptionForm/DescriptionForm.tsx"

    click myDiaryList "https://github.com/neru-neru/blockory/blob/main/blockory/src/pages/MyDiaryList/MyDiaryList.tsx"
    click otherDiaryList "https://github.com/neru-neru/blockory/blob/main/blockory/src/pages/OtherDiaryList/OtherDiaryList.tsx"

    click register "https://github.com/neru-neru/blockory/blob/main/blockory/src/pages/Register/Register.tsx"
    click signIn "https://github.com/neru-neru/blockory/blob/main/blockory/src/pages/SignIn/SignIn.tsx"
    click topPage "https://github.com/neru-neru/blockory/blob/main/blockory/src/pages/Top/Top.tsx"

    click header "https://github.com/neru-neru/blockory/blob/main/blockory/src/components/Header/Header.tsx"
    click headerButton "https://github.com/neru-neru/blockory/blob/main/blockory/src/components/Header/HeaderButton/HeaderButton.tsx"
    click calendar "https://github.com/neru-neru/blockory/blob/main/blockory/src/components/Calendar/Calendar.tsx"
    click flatButton "https://github.com/neru-neru/blockory/blob/main/blockory/src/components/FlatButton/FlatButton.tsx"
    click pageWrapper "https://github.com/neru-neru/blockory/blob/main/blockory/src/components/PageWrapper/PageWrapper.tsx"
    click thumbnailList "https://github.com/neru-neru/blockory/blob/main/blockory/src/components/ThumbnailList/ThumbnailList.tsx"

    click blocks "https://github.com/neru-neru/blockory/tree/main/blockory/src/blocks"
    click pixi "https://github.com/neru-neru/blockory/tree/main/blockory/src/pixi"

    click types "https://github.com/neru-neru/blockory/tree/main/blockory/src/@types"

    click docker "https://github.com/neru-neru/blockory/blob/main/docker-compose.yml"

    %% Styling
    classDef browser fill:#f7dc6f,stroke:#555,stroke-width:2px;
    classDef entry fill:#d5f5e3,stroke:#555,stroke-width:2px;
    classDef routing fill:#aed6f1,stroke:#555,stroke-width:2px;
    classDef auth fill:#fadbd8,stroke:#555,stroke-width:2px;
    classDef util fill:#d2b4de,stroke:#555,stroke-width:2px;
    classDef types fill:#a9cce3,stroke:#555,stroke-width:2px;
    classDef page fill:#a3e4d7,stroke:#555,stroke-width:2px;
    classDef pageSub fill:#d4efdf,stroke:#555,stroke-width:1px;
    classDef component fill:#f9e79f,stroke:#555,stroke-width:2px;
    classDef componentSub fill:#fcf3cf,stroke:#555,stroke-width:1px;
    classDef docker fill:#f5cba7,stroke:#555,stroke-width:2px;
```
