# netrumlabs/testnet-web architecture

> Architecture diagram of the GitHub repository netrumlabs/testnet-web, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/netrumlabs/testnet-web
- Repository: https://github.com/netrumlabs/testnet-web

## Overview

This is a Next.js testnet dapp dashboard. Users enter the app to manage wallet-linked profiles and use dashboard features for points and tasks, contract submissions, AI chat, and weekly mint verification; settings and social connections support those activities. The tree shows these distinct product areas, while sampled API handlers establish the request-to-server pattern. Source excerpts and index references confirm only some links, so unsampled feature wiring is intentionally not inferred; the README provides no additional capability documentation.

Main entry points: [`src/app/(app)/Dapp/page.tsx`](https://github.com/netrumlabs/testnet-web/blob/main/src/app/(app)/Dapp/page.tsx) (Dapp dashboard), [`src/app/api`](https://github.com/netrumlabs/testnet-web/tree/main/src/app/api) (API handlers), [`src/lib/server/client.ts`](https://github.com/netrumlabs/testnet-web/blob/main/src/lib/server/client.ts) (Server API client), [`src/components/ui`](https://github.com/netrumlabs/testnet-web/tree/main/src/components/ui) (UI components)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Dashboard experience"]
  node_dashboard["Dapp dashboard<br/>[page.tsx]"]
  node_chat["AI chat"]
  node_contract["Contract interaction"]
  node_profile["Profile settings"]
  node_theme["Theme customization"]
  node_ui["UI components"]
  node_mobile["Mobile detection<br/>[use-mobile.ts]"]
end

subgraph group_engagement["Points and engagement"]
  node_points["Points system"]
  node_weekly["Weekly mint"]
  node_discord["Discord tasks"]
end

subgraph group_integrations["Wallet and integrations"]
  node_social["Social connections"]
  node_wallet["Wallet connection<br/>[wagmi.ts]"]
end

subgraph group_backend["API and server"]
  node_routes["API handlers"]
  node_client["Server API client<br/>[client.ts]"]
  node_profile_service["Profile service<br/>[profile.ts]"]
  node_global_service["Global deployments<br/>[global.ts]"]
  node_points_service["Discord points service<br/>[discord.ts]"]
  node_mint_service["Mint verification<br/>[mint1.ts]"]
  node_app_data[("Dashboard state<br/>[data.ts]")]
  node_mail_data[("Mail preferences<br/>[data.ts]")]
  node_theme_config["Theme configuration<br/>[theme-config.ts]"]
end

node_user(("User"))
node_antra["Antra server"]

node_user -.->|"uses"| node_dashboard
node_dashboard -.->|"opens"| node_chat
node_dashboard -.->|"opens"| node_contract
node_dashboard -.->|"opens"| node_points
node_dashboard -.->|"opens"| node_weekly
node_dashboard -.->|"opens"| node_discord
node_dashboard -.->|"opens"| node_profile
node_dashboard -.->|"opens"| node_social
node_dashboard -.->|"connects"| node_wallet
node_theme -->|"reads settings"| node_theme_config
node_ui -->|"detects viewport"| node_mobile
node_ui -.->|"composes controls"| node_ui
node_routes -->|"creates profile"| node_profile_service
node_routes -->|"reads profile"| node_profile_service
node_routes -->|"gets deployments"| node_global_service
node_routes -->|"connects Discord"| node_points_service
node_routes -->|"verifies mint"| node_mint_service
node_profile_service -->|"calls API"| node_client
node_global_service -->|"calls API"| node_client
node_points_service -->|"calls API"| node_client
node_mint_service -.->|"calls API"| node_client
node_client -->|"sends requests"| node_antra
node_app_data -->|"supports sessions"| node_chat
node_mail_data -->|"stores preferences"| node_profile

click node_dashboard "https://github.com/netrumlabs/testnet-web/blob/main/src/app/(app)/Dapp/page.tsx"
click node_chat "https://github.com/netrumlabs/testnet-web/tree/main/src/app/(app)/Dapp/chat"
click node_contract "https://github.com/netrumlabs/testnet-web/tree/main/src/app/(app)/Dapp/interaction"
click node_profile "https://github.com/netrumlabs/testnet-web/tree/main/src/app/(app)/Dapp/settings"
click node_theme "https://github.com/netrumlabs/testnet-web/blob/main/src/components/theme-customizer.tsx"
click node_ui "https://github.com/netrumlabs/testnet-web/tree/main/src/components/ui"
click node_mobile "https://github.com/netrumlabs/testnet-web/blob/main/src/hooks/use-mobile.ts"
click node_points "https://github.com/netrumlabs/testnet-web/tree/main/src/app/(app)/Dapp/points-system"
click node_weekly "https://github.com/netrumlabs/testnet-web/tree/main/src/app/(app)/Dapp/weekly"
click node_discord "https://github.com/netrumlabs/testnet-web/tree/main/src/app/(app)/Dapp/discord-task"
click node_social "https://github.com/netrumlabs/testnet-web/tree/main/src/app/api/social-connect"
click node_wallet "https://github.com/netrumlabs/testnet-web/blob/main/src/lib/wagmi.ts"
click node_routes "https://github.com/netrumlabs/testnet-web/tree/main/src/app/api"
click node_client "https://github.com/netrumlabs/testnet-web/blob/main/src/lib/server/client.ts"
click node_profile_service "https://github.com/netrumlabs/testnet-web/blob/main/src/lib/server/profile.ts"
click node_global_service "https://github.com/netrumlabs/testnet-web/blob/main/src/lib/server/global.ts"
click node_points_service "https://github.com/netrumlabs/testnet-web/blob/main/src/lib/server/points-system/discord.ts"
click node_mint_service "https://github.com/netrumlabs/testnet-web/blob/main/src/lib/server/weeks/mint1.ts"
click node_app_data "https://github.com/netrumlabs/testnet-web/blob/main/src/store/data.ts"
click node_mail_data "https://github.com/netrumlabs/testnet-web/blob/main/src/store/mail/data.ts"
click node_theme_config "https://github.com/netrumlabs/testnet-web/blob/main/src/lib/theme-config.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_dashboard,node_chat,node_contract,node_profile,node_theme,node_ui,node_mobile,node_user toneBlue
class node_points,node_weekly,node_discord toneAmber
class node_social,node_wallet,node_antra toneMint
class node_routes,node_client,node_profile_service,node_global_service,node_points_service,node_mint_service,node_app_data,node_mail_data,node_theme_config toneRose
```

## Components

### Dashboard experience

- [Dapp dashboard](https://github.com/netrumlabs/testnet-web/blob/main/src/app/(app)/Dapp/page.tsx): `src/app/(app)/Dapp/page.tsx`
- [AI chat](https://github.com/netrumlabs/testnet-web/tree/main/src/app/(app)/Dapp/chat): `src/app/(app)/Dapp/chat`
- [Contract interaction](https://github.com/netrumlabs/testnet-web/tree/main/src/app/(app)/Dapp/interaction): `src/app/(app)/Dapp/interaction`
- [Profile settings](https://github.com/netrumlabs/testnet-web/tree/main/src/app/(app)/Dapp/settings): `src/app/(app)/Dapp/settings`
- [Theme customization](https://github.com/netrumlabs/testnet-web/blob/main/src/components/theme-customizer.tsx): `src/components/theme-customizer.tsx`
- [UI components](https://github.com/netrumlabs/testnet-web/tree/main/src/components/ui): `src/components/ui`
- [Mobile detection](https://github.com/netrumlabs/testnet-web/blob/main/src/hooks/use-mobile.ts): `src/hooks/use-mobile.ts`

### Points and engagement

- [Points system](https://github.com/netrumlabs/testnet-web/tree/main/src/app/(app)/Dapp/points-system): `src/app/(app)/Dapp/points-system`
- [Weekly mint](https://github.com/netrumlabs/testnet-web/tree/main/src/app/(app)/Dapp/weekly): `src/app/(app)/Dapp/weekly`
- [Discord tasks](https://github.com/netrumlabs/testnet-web/tree/main/src/app/(app)/Dapp/discord-task): `src/app/(app)/Dapp/discord-task`

### Wallet and integrations

- [Social connections](https://github.com/netrumlabs/testnet-web/tree/main/src/app/api/social-connect): `src/app/api/social-connect`
- [Wallet connection](https://github.com/netrumlabs/testnet-web/blob/main/src/lib/wagmi.ts): `src/lib/wagmi.ts`

### API and server

- [API handlers](https://github.com/netrumlabs/testnet-web/tree/main/src/app/api): `src/app/api`
- [Server API client](https://github.com/netrumlabs/testnet-web/blob/main/src/lib/server/client.ts): `src/lib/server/client.ts`
- [Profile service](https://github.com/netrumlabs/testnet-web/blob/main/src/lib/server/profile.ts): `src/lib/server/profile.ts`
- [Global deployments](https://github.com/netrumlabs/testnet-web/blob/main/src/lib/server/global.ts): `src/lib/server/global.ts`
- [Discord points service](https://github.com/netrumlabs/testnet-web/blob/main/src/lib/server/points-system/discord.ts): `src/lib/server/points-system/discord.ts`
- [Mint verification](https://github.com/netrumlabs/testnet-web/blob/main/src/lib/server/weeks/mint1.ts): `src/lib/server/weeks/mint1.ts`
- [Dashboard state](https://github.com/netrumlabs/testnet-web/blob/main/src/store/data.ts): `src/store/data.ts`
- [Mail preferences](https://github.com/netrumlabs/testnet-web/blob/main/src/store/mail/data.ts): `src/store/mail/data.ts`
- [Theme configuration](https://github.com/netrumlabs/testnet-web/blob/main/src/lib/theme-config.ts): `src/lib/theme-config.ts`

### Other components

- **User**
- **Antra server**

## Connections

- User → Dapp dashboard: uses
- Dapp dashboard → AI chat: opens
- Dapp dashboard → Contract interaction: opens
- Dapp dashboard → Points system: opens
- Dapp dashboard → Weekly mint: opens
- Dapp dashboard → Discord tasks: opens
- Dapp dashboard → Profile settings: opens
- Dapp dashboard → Social connections: opens
- Dapp dashboard → Wallet connection: connects
- Theme customization → Theme configuration: reads settings (evidence: `src/components/theme-customizer.tsx`)
- UI components → Mobile detection: detects viewport (evidence: `src/components/ui/sidebar.tsx`)
- UI components → UI components: composes controls
- API handlers → Profile service: creates profile (evidence: `src/app/api/profile/route.ts`)
- API handlers → Profile service: reads profile (evidence: `src/app/api/profile/avatar/route.ts`)
- API handlers → Global deployments: gets deployments (evidence: `src/app/api/global/route.ts`)
- API handlers → Discord points service: connects Discord (evidence: `src/app/api/points-system/discord-Connect/route.ts`)
- API handlers → Mint verification: verifies mint (evidence: `src/app/api/weeks/mint1/route.ts`)
- Profile service → Server API client: calls API (evidence: `src/lib/server/profile.ts`)
- Global deployments → Server API client: calls API (evidence: `src/lib/server/global.ts`)
- Discord points service → Server API client: calls API (evidence: `src/lib/server/points-system/discord.ts`)
- Mint verification → Server API client: calls API
- Server API client → Antra server: sends requests (evidence: `src/lib/server/client.ts`)
- Dashboard state → AI chat: supports sessions
- Mail preferences → Profile settings: stores preferences
