# leepule/0.1-to-sui-fullstack architecture

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

- Interactive diagram: https://gitdiagram.com/leepule/0.1-to-sui-fullstack
- Repository: https://github.com/leepule/0.1-to-sui-fullstack

## Overview

##### Project Type Analysis
This is a full-stack educational DApp project focusing on Sui blockchain development, combining:
- Smart contracts (Move language)
- Frontend development (React/Next.js)
- Blockchain interaction (Sui network)

##### Main Components

A. Development Environment Layer:
- Sui Development Environment
- Move Framework
- React/Next.js Development Environment

B. Smart Contract Layer (smart_contract directory):
- Resource Management Module
- NFT Module
- Token/Coin Module
- Testing Framework

C. Frontend Layer (front_end directory):
- React/Next.js Applications
- Sui SDK Integration
- Wallet Connection
- UI Components

D. Student Implementation Layer (fullstack directory):
- Individual Student Workspaces
- Weekly Assignments
- Progress Tracking

- Blue: Frontend Components
- Green: Smart Contract Components
- Yellow: Blockchain Infrastructure
- Gray: Development Tools
- Purple: Educational Framework

**[Component Relationships]**
**→ Direct Interaction**
**⇢ Data Flow**
**⇄ Two-way Communication**

##### Key Elements to Highlight

a) Infrastructure Level:
- [Sui Blockchain Network]
- ↑
- [Move Runtime Environment]

b) Smart Contract Level:
- [Resource Management] ←→ [NFT System]
- ↕                      ↕
- [Token/Coin Module] ←→ [Testing Framework]

c) Frontend Level:
- [Wallet Integration] → [React/Next.js UI]
- ↓                     ↓
- [Sui SDK/Dapp-kit] ← [State Management]

##### Use a top-down approach, starting with
- [User Interface Layer]
- ↓
- [Application Logic Layer]
- ↓
- [Smart Contract Layer]
- ↓
- [Blockchain Layer]

##### Weekly progression elements
- Week 1: Resource Management + Basic React
- Week 2: Coin/Token Integration
- Week 3: NFT Implementation
- Week 4: Advanced Object Management

##### Interaction flows
- [Frontend] ⇄ [Sui SDK] ⇄ [Smart Contracts] ⇄ [Blockchain]

##### Technical Stack Indicators

- Move Language (Smart Contracts)
- React/Next.js (Frontend)
- TypeScript (Frontend Logic)
- Sui SDK/Dapp-kit (Blockchain Interaction)

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and Classes
    classDef frontend fill:#3498db,color:white
    classDef smartContract fill:#2ecc71,color:white
    classDef blockchain fill:#f1c40f,color:black
    classDef devTools fill:#95a5a6,color:white
    classDef education fill:#9b59b6,color:white

    %% Development Environment Layer
    subgraph DevEnv["Development Environment"]
        SuiDev["Sui Development Environment"]:::devTools
        MoveFw["Move Framework"]:::devTools
        ReactDev["React/Next.js Environment"]:::devTools
    end

    %% Smart Contract Layer
    subgraph SmartContracts["Smart Contract Layer"]
        ResourceMgmt["Resource Management Module"]:::smartContract
        NFTMod["NFT Module"]:::smartContract
        TokenMod["Token/Coin Module"]:::smartContract
        TestFw["Testing Framework"]:::smartContract
    end

    %% Frontend Layer
    subgraph Frontend["Frontend Layer"]
        ReactApp["React Application"]:::frontend
        WalletConn["Wallet Connection"]:::frontend
        UIComps["UI Components"]:::frontend
        NetConfig["Network Configuration"]:::frontend
    end

    %% Student Implementation Layer
    subgraph StudentImpl["Student Implementation"]
        StudentWS["Student Workspace"]:::education
        Week1["Week 1 Assignment"]:::education
        Week2["Week 2 Assignment"]:::education
        Week3["Week 3 Assignment"]:::education
        Week4["Week 4 Assignment"]:::education
    end

    %% Blockchain Infrastructure
    SuiNetwork["Sui Blockchain Network"]:::blockchain
    MoveRuntime["Move Runtime Environment"]:::blockchain

    %% Relationships
    SuiNetwork --> MoveRuntime
    MoveRuntime --> SmartContracts
    SmartContracts --> Frontend
    Frontend --> StudentImpl
    DevEnv --> SmartContracts
    DevEnv --> Frontend

    ResourceMgmt <--> NFTMod
    TokenMod <--> TestFw
    ResourceMgmt <--> TokenMod
    NFTMod <--> TestFw

    ReactApp --> WalletConn
    WalletConn --> UIComps
    UIComps --> NetConfig

    StudentWS --> Week1
    Week1 --> Week2
    Week2 --> Week3
    Week3 --> Week4

    %% Click Events
    click SmartContracts "https://github.com/leepule/0.1-to-Sui-Fullstack/tree/main/smart_contract"
    click ResourceMgmt "https://github.com/leepule/0.1-to-Sui-Fullstack/blob/main/smart_contract/week_1/sources/week_one.move"
    click NFTMod "https://github.com/leepule/0.1-to-Sui-Fullstack/blob/main/smart_contract/week_3/sources/nft.move"
    click TestFw "https://github.com/leepule/0.1-to-Sui-Fullstack/tree/main/smart_contract/week_1/tests"
    click Frontend "https://github.com/leepule/0.1-to-Sui-Fullstack/tree/main/front_end"
    click ReactApp "https://github.com/leepule/0.1-to-Sui-Fullstack/blob/main/front_end/week_1/src/App.tsx"
    click WalletConn "https://github.com/leepule/0.1-to-Sui-Fullstack/blob/main/front_end/week_1/src/WalletStatus.tsx"
    click UIComps "https://github.com/leepule/0.1-to-Sui-Fullstack/blob/main/front_end/week_1/src/OwnedObjects.tsx"
    click NetConfig "https://github.com/leepule/0.1-to-Sui-Fullstack/blob/main/front_end/week_1/src/networkConfig.ts"
    click StudentWS "https://github.com/leepule/0.1-to-Sui-Fullstack/tree/main/fullstack/0000"
    click Week1 "https://github.com/leepule/0.1-to-Sui-Fullstack/tree/main/fullstack/0000/week1"
    click Week2 "https://github.com/leepule/0.1-to-Sui-Fullstack/tree/main/fullstack/0000/week2"
    click Week3 "https://github.com/leepule/0.1-to-Sui-Fullstack/tree/main/fullstack/0000/week3"
    click Week4 "https://github.com/leepule/0.1-to-Sui-Fullstack/tree/main/fullstack/0000/week4"
```
