# roshanbvadassery/permissionless architecture

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

- Interactive diagram: https://gitdiagram.com/roshanbvadassery/permissionless
- Repository: https://github.com/roshanbvadassery/permissionless

## Overview

##### Main System Components

a) Frontend Layer
- Next.js Application (Main container)
- Component Structure
- UI Components (/src/components/ui)
- Page Components (/src/pages)
- Feature Components (SpaceShip, Seeds of Insurgency)
- State Management
- Context API (mouse-context)
- Redux/State Management (_state, _actions, _selectors)

b) Integration Layer
- Web3 Integration
- Wallet Connection
- Blockchain Interaction
- API Layer (/pages/api)

##### Component Relationships

**[Client Browser] ←→ [Next.js Frontend]**
- ↓
**[Web3 Wallet] ←→ [Wallet Integration]**
- ↓
**[Backend API] ←→ [API Routes]**

##### Detailed Component Breakdown

Create subdivisions showing:

a) Core Features:
- Space Ship Feature
- Seeds of Insurgency Feature
- Authentication/Wallet Connection

b) Shared Components:
- Layout System
- Common Components
- UI Elements

##### Data Flow Visualization

- User Interactions → Components
- Components → State Management
- State → Web3 Integration
- API Calls → External Services

##### Technical Stack Indicators

- Next.js
- TypeScript
- SCSS Modules
- Web3 Integration
- Vercel Deployment

##### Specific sections
- Component hierarchy
- State management flow
- Web3 integration points
- API endpoints
- Authentication flow

Key Considerations:

##### Web3 aspects
- Wallet connection flow
- Blockchain interaction points
- Permission management

##### Modular structure
- Common components
- Feature-specific components
- Page layouts

##### State management
- Actions
- Selectors
- State updates

##### Cross-cutting concerns
- Styling system (SCSS modules)
- Type definitions
- Configuration management

Remember to include notes about:
- Build/deployment pipeline
- Environment configurations
- Security considerations
- Performance optimization points

This will give other engineers a clear understanding of both the high-level architecture and the specific implementation details of this web3-enabled Next.js application.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Client
        Browser["Web Browser"]
        Wallet["Web3 Wallet"]
    end

    subgraph "Frontend Application"
        Next["Next.js App"]
        
        subgraph "Core Features"
            SpaceShip["SpaceShip Feature"]:::feature
            Seeds["Seeds of Insurgency"]:::feature
            Auth["Authentication"]:::auth
        end
        
        subgraph "Component Layer"
            UI["UI Components"]:::ui
            Layout["Layout System"]:::ui
            Common["Common Components"]:::common
            Pages["Page Components"]:::pages
        end
        
        subgraph "State Layer"
            State["State Management"]:::state
            Context["Mouse Context"]:::state
            Actions["Actions"]:::state
            Selectors["Selectors"]:::state
        end
        
        subgraph "Integration Layer"
            Web3Integration["Web3 Integration"]:::web3
            WalletConnect["Wallet Connection"]:::web3
            API["API Routes"]:::api
        end
        
        subgraph "Technical Infrastructure"
            Config["Configuration"]:::config
            Types["Type Definitions"]:::types
            Styles["Styling System"]:::styles
        end
    end

    Browser --> Next
    Wallet --> WalletConnect
    
    Next --> UI
    Next --> Layout
    Next --> Common
    Next --> Pages
    
    UI --> SpaceShip
    UI --> Seeds
    Common --> Auth
    
    SpaceShip --> State
    Seeds --> State
    Auth --> State
    
    State --> Actions
    State --> Selectors
    State --> Context
    
    Actions --> Web3Integration
    Actions --> API
    WalletConnect --> Web3Integration
    
    %% Component Mappings
    click UI "https://github.com/roshanbvadassery/permissionless/tree/master/src/components/ui"
    click State "https://github.com/roshanbvadassery/permissionless/tree/master/src/_state"
    click Actions "https://github.com/roshanbvadassery/permissionless/tree/master/src/_actions"
    click Selectors "https://github.com/roshanbvadassery/permissionless/tree/master/src/_selectors"
    click WalletConnect "https://github.com/roshanbvadassery/permissionless/tree/master/src/components/common/ConnectWallet"
    click SpaceShip "https://github.com/roshanbvadassery/permissionless/tree/master/src/components/SpaceShipPage"
    click Seeds "https://github.com/roshanbvadassery/permissionless/tree/master/src/components/seedsofinsurgency"
    click API "https://github.com/roshanbvadassery/permissionless/tree/master/src/pages/api"
    click Layout "https://github.com/roshanbvadassery/permissionless/tree/master/src/components/ui/Layout"
    click Common "https://github.com/roshanbvadassery/permissionless/tree/master/src/components/common"
    click Config "https://github.com/roshanbvadassery/permissionless/blob/master/src/config/AppConfig.ts"
    click Types "https://github.com/roshanbvadassery/permissionless/blob/master/@types/type.d.ts"
    click Styles "https://github.com/roshanbvadassery/permissionless/tree/master/styles/"
    click Context "https://github.com/roshanbvadassery/permissionless/blob/master/src/context/mouse-context.js"
    click Auth "https://github.com/roshanbvadassery/permissionless/blob/master/src/_actions/user.actions.ts"
    click Pages "https://github.com/roshanbvadassery/permissionless/tree/master/src/pages"

    %% Styling
    classDef feature fill:#ff9900,stroke:#333,stroke-width:2px
    classDef ui fill:#3498db,stroke:#333,stroke-width:2px
    classDef common fill:#2ecc71,stroke:#333,stroke-width:2px
    classDef state fill:#9b59b6,stroke:#333,stroke-width:2px
    classDef web3 fill:#e67e22,stroke:#333,stroke-width:2px
    classDef api fill:#1abc9c,stroke:#333,stroke-width:2px
    classDef config fill:#95a5a6,stroke:#333,stroke-width:2px
    classDef types fill:#34495e,stroke:#333,stroke-width:2px
    classDef styles fill:#e74c3c,stroke:#333,stroke-width:2px
    classDef auth fill:#8e44ad,stroke:#333,stroke-width:2px
    classDef pages fill:#16a085,stroke:#333,stroke-width:2px
```
