# opening-line/symbol_book_v3_demo_dao architecture

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

- Interactive diagram: https://gitdiagram.com/opening-line/symbol_book_v3_demo_dao
- Repository: https://github.com/opening-line/symbol_book_v3_demo_dao

## Overview

##### Project type and purpose
- This is a full-stack blockchain web application: a demo DAO (Decentralized Autonomous Organization) built on the Symbol blockchain.
- The README calls it “次世代組織のための実用 Symbol ブロックチェーンアプリケーションのデモアプリ（DAO）”, indicating it’s both a frontend SPA for users and a backend that wraps Symbol SDK calls.

##### File structure
- Top level:
- compose.yml (Docker-compose for client & server)
- client/ (React + TypeScript + Vite)
- server/ (Node.js + TypeScript + REST routes + blockchain functions)
- client/: typical Vite + React structure
- src/pages (per-feature pages: DAO, Exchange, GovernanceVoting, etc.)
- src/components (Layout, Header, SideMenu, ThemeContext)
- src/utils/config.ts
- server/:
- src/routes (HTTP endpoints, grouped by admin/exchange/governance/home/limited)
- src/functions (business logic for transactions: createMosaic, transfer, signTransaction, etc.)
- src/info (read-only queries: getAccountInfo, getMetadataInfoByQuery, etc.)
- src/utils (config, address encoding, metadata helpers)
- No relational database: data persistence and state live on the Symbol blockchain network.

##### README
- Describes how to set up .env (with PRIVATE_KEY), start server and client.
- No built-in database; all data operations use Symbol SDK and network calls.

##### Elements
- External service (orange cloud for Symbol network)
- Major modules: client/src/pages (feature modules), server/src/routes (endpoint groups), server/src/functions (logic units), server/src/info (query modules).

##### Final recommendations
- Major feature groups (DAO, Exchange, Governance, Point, Reward) as sub-areas or clusters within the frontend and backend.
- Do not omit the blockchain; treat it as a first-class component rather than a database.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Deployment Layer
    DC["Docker Compose\n(compose.yml)"]:::config
    ClientService["Client Service\n(Vite Dev or Static Host)"]:::frontend
    ServerService["API Server\n(Node.js/Express)"]:::api

    DC --> ClientService
    DC --> ServerService

    %% Browser Interaction
    Browser["Browser"]:::frontend
    ClientService -->|"Serves SPA"| Browser

    %% Frontend Layer
    subgraph "Frontend (client/src)"
        Main["main.tsx"]:::frontend
        App["App.tsx"]:::frontend
        Pages["Pages"]:::frontend
        Components["UI Components"]:::frontend
        ConfigF["config.ts"]:::config
    end

    ClientService --> Main
    Main --> App
    App --> Pages
    App --> Components
    App --> ConfigF

    Pages --> DAO["DAO (client/src/pages/DAO)"]:::frontend
    Pages --> Exchange["Exchange (client/src/pages/Exchange)"]:::frontend
    Pages --> Governance["GovernanceVoting"]:::frontend
    Pages --> HomeP["Home"]:::frontend
    Pages --> Limited["Limited"]:::frontend
    Pages --> Point["Point"]:::frontend
    Pages --> Reward["Reward"]:::frontend

    click Main "https://github.com/opening-line/symbol_book_v3_demo_dao/blob/main/client/src/main.tsx"
    click App "https://github.com/opening-line/symbol_book_v3_demo_dao/blob/main/client/src/App.tsx"
    click DAO "https://github.com/opening-line/symbol_book_v3_demo_dao/tree/main/client/src/pages/DAO"
    click Exchange "https://github.com/opening-line/symbol_book_v3_demo_dao/tree/main/client/src/pages/Exchange"
    click Governance "https://github.com/opening-line/symbol_book_v3_demo_dao/blob/main/client/src/pages/GovernanceVoting/index.tsx"
    click HomeP "https://github.com/opening-line/symbol_book_v3_demo_dao/blob/main/client/src/pages/Home/index.tsx"
    click Limited "https://github.com/opening-line/symbol_book_v3_demo_dao/blob/main/client/src/pages/Limited/index.tsx"
    click Point "https://github.com/opening-line/symbol_book_v3_demo_dao/tree/main/client/src/pages/Point"
    click Reward "https://github.com/opening-line/symbol_book_v3_demo_dao/tree/main/client/src/pages/Reward"
    click Components "https://github.com/opening-line/symbol_book_v3_demo_dao/tree/main/client/src/components"
    click ConfigF "https://github.com/opening-line/symbol_book_v3_demo_dao/blob/main/client/src/utils/config.ts"

    %% Backend Layer
    subgraph "Backend (server/src)"
        Index["index.ts"]:::api
        Routes["Routes"]:::api
        Funcs["Business Logic\nFunctions"]:::logic
        Info["Blockchain Query\nModules"]:::logic
        Utils["Utilities"]:::config
    end

    ServerService --> Index
    Index --> Routes
    Routes --> Funcs
    Routes --> Info
    Routes --> Utils
    Funcs --> Info
    Funcs --> Utils

    Routes --> Admin["Admin Routes"]:::api
    Routes --> ExchangeR["Exchange Routes"]:::api
    Routes --> GovR["Governance Routes"]:::api
    Routes --> HomeR["Home Routes"]:::api
    Routes --> LimitedR["Limited Routes"]:::api

    Funcs --> FL1["server/src/functions"]:::logic
    Info --> FI1["server/src/info"]:::logic
    Utils --> U1["server/src/utils"]:::config

    click Index "https://github.com/opening-line/symbol_book_v3_demo_dao/blob/main/server/src/index.ts"
    click Admin "https://github.com/opening-line/symbol_book_v3_demo_dao/tree/main/server/src/routes/admin"
    click ExchangeR "https://github.com/opening-line/symbol_book_v3_demo_dao/tree/main/server/src/routes/exchange"
    click GovR "https://github.com/opening-line/symbol_book_v3_demo_dao/tree/main/server/src/routes/governance"
    click HomeR "https://github.com/opening-line/symbol_book_v3_demo_dao/tree/main/server/src/routes/home"
    click LimitedR "https://github.com/opening-line/symbol_book_v3_demo_dao/tree/main/server/src/routes/limited"
    click FL1 "https://github.com/opening-line/symbol_book_v3_demo_dao/tree/main/server/src/functions"
    click FI1 "https://github.com/opening-line/symbol_book_v3_demo_dao/tree/main/server/src/info"
    click U1 "https://github.com/opening-line/symbol_book_v3_demo_dao/tree/main/server/src/utils"

    %% External Service
    Sym["Symbol Blockchain\nNetwork"]:::external
    ServerService -->|"Submits Transactions / Queries"| Sym

    %% Styles
    classDef frontend fill:#add8e6,stroke:#333,stroke-width:1px
    classDef api fill:#90ee90,stroke:#333,stroke-width:1px
    classDef logic fill:#ffff99,stroke:#333,stroke-width:1px
    classDef external fill:#ffcc99,stroke:#333,stroke-width:1px
    classDef config fill:#f0f0f0,stroke:#333,stroke-width:1px
```
