# shouryam-kumar/soa-portal architecture

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

- Interactive diagram: https://gitdiagram.com/shouryam-kumar/soa-portal
- Repository: https://github.com/shouryam-kumar/soa-portal

## Overview

##### Project type and purpose
- From the file tree and README, this is a full-stack web application built with Next.js (App Router) and TypeScript.
- It provides user authentication (login/register), role-based areas (admin dashboard, user dashboard), feature modules (proposals, bounties, ideaboard, rewards), and integrates with Supabase for auth & data, plus a Web3 wallet connector.

##### File structure
- Top-level config files: `next.config.ts`, `eslint.config.mjs`, `tsconfig.json`.
- `public/` holds static assets (images).
- `src/app/` follows Next.js’s App Router, with nested folders for each route (e.g., `(auth)`, `admin`, `bounties`, `dashboard`, `ideaboard`, `proposals`, `profile`, etc.).
- `src/components/` groups UI components by domain: `layout`, `admin`, `ideaboard`, `proposals`, `web3`, `providers`, `ui`.
- `src/lib/supabase.ts` contains the Supabase client setup.
- `src/middleware.ts` likely performs route-level checks (e.g., auth).
- `src/types/` holds shared TypeScript types.
- `src/utils/` has helper functions.

##### README for additional insights
- Confirms use of Next.js, optimized fonts, and Vercel for deployment.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Side
    subgraph "Client - Browser" 
        direction TB
        Browser["Browser Client\n(React UI)"]:::frontend
        SupabaseProvider["SupabaseProvider Context"]:::frontend
        WalletConnect["WalletConnect Component"]:::frontend
    end

    %% Next.js Server
    subgraph "Next.js App Server"
        direction TB
        Middleware["Middleware\n(src/middleware.ts)"]:::infra
        AppRouter["App Router\n(src/app/)"]:::backend
        Layout["Global Layout\n(src/app/layout.tsx)"]:::frontend
        API["API Routes"]:::backend
    end

    %% Pages & Modules
    subgraph "Pages & Modules"
        direction TB
        AuthLogin["Login Page"]:::frontend
        AuthRegister["Register Page"]:::frontend
        AdminDashboard["Admin Dashboard"]:::frontend
        AdminProposal["Admin Proposal Detail"]:::frontend
        UserDashboard["User Dashboard"]:::frontend
        ProposalsList["Proposals List"]:::frontend
        ProposalsNew["New Proposal"]:::frontend
        ProposalDetail["Proposal Detail"]:::frontend
        Bounties["Bounties Module"]:::frontend
        Ideaboard["Ideaboard Module"]:::frontend
        Rewards["Rewards Module"]:::frontend
        Profile["Profile Page"]:::frontend
    end

    %% UI Components
    subgraph "UI Components"
        direction TB
        AdminHeader["AdminHeader"]:::ui
        AdminSidebar["AdminSidebar"]:::ui
        ProposalCard["ProposalCard"]:::ui
        ProposalForm["ProposalForm"]:::ui
        ApproveRejectButton["ApproveRejectButton"]:::ui
        IdeasFilter["IdeasFilter"]:::ui
    end

    %% Supabase Services
    subgraph "Supabase Services"
        direction TB
        SupabaseClient["Supabase Client Setup\n(src/lib/supabase.ts)"]:::service
        SupabaseAuth["Supabase Auth"]:::service
        SupabaseDB["Postgres Database"]:::service
    end

    %% External Services
    subgraph "External"
        direction TB
        StaticAssets["CDN / Static Assets\n(public/)"]:::infra
        Blockchain["Blockchain Network"]:::external
    end

    %% Relationships
    Browser -->|requests| Middleware
    Middleware -->|routes to| AppRouter
    AppRouter -->|"renders"| Layout
    AppRouter -->|"serves pages"| AuthLogin
    AppRouter -->|"serves pages"| AuthRegister
    AppRouter -->|"serves pages"| AdminDashboard
    AppRouter -->|"serves pages"| AdminProposal
    AppRouter -->|"serves pages"| UserDashboard
    AppRouter -->|"serves pages"| ProposalsList
    AppRouter -->|"serves pages"| ProposalsNew
    AppRouter -->|"serves pages"| ProposalDetail
    AppRouter -->|"serves pages"| Bounties
    AppRouter -->|"serves pages"| Ideaboard
    AppRouter -->|"serves pages"| Rewards
    AppRouter -->|"serves pages"| Profile

    Browser -->|static request| StaticAssets
    Browser -->|wallet connect| WalletConnect
    WalletConnect -->|RPC calls| Blockchain

    Browser -->|wrapped with| SupabaseProvider
    SupabaseProvider -->|uses| SupabaseClient
    AppRouter -->|uses| SupabaseClient
    SupabaseClient -->|auth RPC| SupabaseAuth
    SupabaseClient -->|data queries| SupabaseDB

    %% UI Composition
    AdminDashboard --> AdminHeader
    AdminDashboard --> AdminSidebar
    ProposalDetail --> ProposalCard
    ProposalsNew --> ProposalForm
    ProposalDetail --> ApproveRejectButton
    Ideaboard --> IdeasFilter

    %% Click Events
    click Browser "https://github.com/shouryam-kumar/soa-portal/tree/main/src/components/"
    click SupabaseProvider "https://github.com/shouryam-kumar/soa-portal/blob/main/src/components/providers/SupabaseProvider.tsx"
    click WalletConnect "https://github.com/shouryam-kumar/soa-portal/blob/main/src/components/web3/WalletConnect.tsx"
    click Middleware "https://github.com/shouryam-kumar/soa-portal/blob/main/src/middleware.ts"
    click AppRouter "https://github.com/shouryam-kumar/soa-portal/tree/main/src/app/"
    click Layout "https://github.com/shouryam-kumar/soa-portal/blob/main/src/app/layout.tsx"
    click AuthLogin "https://github.com/shouryam-kumar/soa-portal/blob/main/src/app/(auth)/login/page.tsx"
    click AuthRegister "https://github.com/shouryam-kumar/soa-portal/blob/main/src/app/(auth)/register/page.tsx"
    click AdminDashboard "https://github.com/shouryam-kumar/soa-portal/blob/main/src/app/admin/dashboard/page.tsx"
    click AdminProposal "https://github.com/shouryam-kumar/soa-portal/blob/main/src/app/admin/proposals/[id]/page.tsx"
    click UserDashboard "https://github.com/shouryam-kumar/soa-portal/blob/main/src/app/dashboard/page.tsx"
    click ProposalsList "https://github.com/shouryam-kumar/soa-portal/blob/main/src/app/proposals/page.tsx"
    click ProposalsNew "https://github.com/shouryam-kumar/soa-portal/blob/main/src/app/proposals/new/page.tsx"
    click ProposalDetail "https://github.com/shouryam-kumar/soa-portal/blob/main/src/app/proposals/[id]/page.tsx"
    click Bounties "https://github.com/shouryam-kumar/soa-portal/blob/main/src/app/bounties/page.tsx"
    click Ideaboard "https://github.com/shouryam-kumar/soa-portal/blob/main/src/app/ideaboard/page.tsx"
    click Rewards "https://github.com/shouryam-kumar/soa-portal/blob/main/src/app/rewards/page.tsx"
    click Profile "https://github.com/shouryam-kumar/soa-portal/blob/main/src/app/profile/page.tsx"
    click AdminHeader "https://github.com/shouryam-kumar/soa-portal/blob/main/src/components/admin/AdminHeader.tsx"
    click AdminSidebar "https://github.com/shouryam-kumar/soa-portal/blob/main/src/components/admin/AdminSidebar.tsx"
    click ProposalCard "https://github.com/shouryam-kumar/soa-portal/blob/main/src/components/proposals/ProposalCard.tsx"
    click ProposalForm "https://github.com/shouryam-kumar/soa-portal/blob/main/src/components/proposals/ProposalForm.tsx"
    click ApproveRejectButton "https://github.com/shouryam-kumar/soa-portal/blob/main/src/components/proposals/ApproveRejectButton.tsx"
    click IdeasFilter "https://github.com/shouryam-kumar/soa-portal/blob/main/src/components/ideaboard/IdeasFilter.tsx"
    click SupabaseClient "https://github.com/shouryam-kumar/soa-portal/blob/main/src/lib/supabase.ts"
    click StaticAssets "https://github.com/shouryam-kumar/soa-portal/tree/main/public/"

    %% Styles
    classDef frontend fill:#AEDFF7,stroke:#0366d6,stroke-width:1px
    classDef backend fill:#A3F7BF,stroke:#048B54,stroke-width:1px
    classDef service fill:#B9F6CA,stroke:#1B5E20,stroke-width:1px
    classDef infra fill:#E0E0E0,stroke:#424242,stroke-width:1px
    classDef external fill:#FFD8B0,stroke:#E65100,stroke-width:1px
    classDef ui fill:#FFE082,stroke:#FF8F00,stroke-width:1px
```
