# aady01/wallet0 architecture

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

- Interactive diagram: https://gitdiagram.com/aady01/wallet0
- Repository: https://github.com/aady01/wallet0

## Overview

1. **Top-level shape**
   - This is a **Next.js App Router** frontend written in **TypeScript**.
   - The repo is structured as a **client-first wallet UI** with no visible backend, API routes, database, or server-side business services.

2. **Route boundaries**
   - `app/page.tsx` is the root entry, likely the landing/home experience.
   - `app/solana/page.tsx` and `app/ethereum/page.tsx` are separate chain-specific routes.
   - Each route has its own `loading.tsx`, so the app uses **route-level suspense/loading states** rather than a single monolithic shell.

3. **Primary product flow**
   - The README describes the app as a **secure HD wallet generator**, especially for **Solana**.
   - The architectural intent is: user enters or generates a mnemonic in the browser, the app derives wallets locally, and the UI lets the user inspect, hide, copy, and manage those wallets during the session.

4. **Security and trust boundary**
   - The key architectural boundary is **browser-only cryptography**.
   - Sensitive operations are meant to stay on the client side, with no evidence of server transmission or persistence.
   - This keeps the “wallet engine” inside the frontend runtime and makes the browser the trusted execution environment.

5. **State and lifetime**
   - Wallet data appears to be **session-scoped/in-memory**, not persisted in a backend.
   - The UI supports adding multiple wallets, deleting individual wallets, and clearing the session, so the state model is likely centered around **local React state** and transient derived values.

6. **UI composition**
   - The app uses a large **shadcn/ui-style component set** under `components/ui/`.
   - These primitives provide the application shell and interactive controls: dialogs, sheets, tabs, inputs, buttons, tables, tooltips, cards, etc.
   - This suggests the product UI is assembled from reusable building blocks rather than custom one-off widgets.

7. **Custom feature components**
   - `components/homepage/LandingPage.tsx` is the main custom landing-page composition layer.
   - `components/ui/TextPressure/TextPressure.tsx` and `components/svg/` indicate extra visual/branding components layered on top of the design system.
   - These custom components likely handle hero treatment and animated presentation, not core wallet logic.

8. **Responsive behavior**
   - `hooks/use-mobile.ts` provides a dedicated mobile breakpoint hook.
   - That implies the UI has explicit responsive branching for layout or interaction density, which matters for diagramming the frontend as **adaptive, not fixed-layout**.

9. **Styling and theming**
   - Styling is handled through **Tailwind CSS** with `app/globals.css` for global theme/base styles.
   - The README advertises dark/light mode, so theme handling is part of the UI layer rather than the wallet engine.
   - `lib/utils.ts` is likely a shared helper layer for class composition and UI consistency.

10. **Infrastructure and dependencies**
   - The repo is centered on the **Next.js runtime** and frontend libraries; there are no visible external services.
   - The architecture relies on browser-friendly wallet libraries mentioned in the README: **Solana Web3.js**, **bip39**, and **ed25519-hd-key** for mnemonic and derivation logic.
   - That means the main dependency boundary is between the React UI and local cryptographic libraries, not between frontend and backend.

11. **What is not present**
   - No API layer, auth system, database, worker queue, or server-rendered data pipeline is visible in the tree.
   - For an architecture diagram, this should be shown as a **self-contained client application** with route segments, shared UI primitives, and local wallet derivation logic.

12. **Diagram-worthy mental model**
   - Think of the repo as: **Next.js app shell → route pages (`/`, `/solana`, `/ethereum`) → shared UI system → local wallet/crypto behavior in the browser**.
   - The most important boundary is between **presentation/UI** and **client-side sensitive wallet operations**.

Main entry points: [`components/homepage/LandingPage.tsx`](https://github.com/aady01/wallet0/blob/main/components/homepage/LandingPage.tsx) (Landing page), [`app/layout.tsx`](https://github.com/aady01/wallet0/blob/main/app/layout.tsx) (App layout), [`app/page.tsx`](https://github.com/aady01/wallet0/blob/main/app/page.tsx) (Home route), [`app/solana/page.tsx`](https://github.com/aady01/wallet0/blob/main/app/solana/page.tsx) (Solana route)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App Router"]
  node_app_layout["App layout<br/>Next.js shell<br/>[layout.tsx]"]
  node_app_home["Home route<br/>route page<br/>[page.tsx]"]
  node_app_solana["Solana route<br/>route page<br/>[page.tsx]"]
  node_app_ethereum["Ethereum route<br/>route page<br/>[page.tsx]"]
  node_app_loading["Root loading<br/>suspense state<br/>[loading.tsx]"]
  node_solana_loading["Solana loading<br/>suspense state<br/>[loading.tsx]"]
  node_ethereum_loading["Ethereum loading<br/>suspense state<br/>[loading.tsx]"]
end

subgraph group_shared["Shared UI"]
  node_landing_page["Landing page<br/>ui composition<br/>[LandingPage.tsx]"]
  node_text_pressure["Text pressure<br/>animated hero<br/>[TextPressure.tsx]"]
  node_ui_primitives["UI kit<br/>shadcn primitives<br/>[button.tsx]"]
end

subgraph group_foundation["Foundation"]
  node_mobile_hook(("Mobile hook<br/>responsive helper<br/>[use-mobile.ts]"))
  node_utils["Utils<br/>helper lib<br/>[utils.ts]"]
  node_global_styles["Global styles<br/>tailwind base<br/>[globals.css]"]
end

node_app_layout -->|"wraps"| node_app_home
node_app_layout -->|"wraps"| node_app_solana
node_app_layout -->|"wraps"| node_app_ethereum
node_app_layout -->|"loads"| node_global_styles
node_app_home -->|"renders"| node_landing_page
node_app_solana -->|"uses"| node_ui_primitives
node_app_ethereum -->|"uses"| node_ui_primitives
node_landing_page -->|"includes"| node_text_pressure
node_landing_page -->|"adapts"| node_mobile_hook
node_landing_page -->|"composes"| node_ui_primitives
node_landing_page -->|"shares"| node_utils
node_app_home -.->|"suspense"| node_app_loading
node_app_solana -.->|"suspense"| node_solana_loading
node_app_ethereum -.->|"suspense"| node_ethereum_loading

click node_app_layout "https://github.com/aady01/wallet0/blob/main/app/layout.tsx"
click node_app_home "https://github.com/aady01/wallet0/blob/main/app/page.tsx"
click node_app_solana "https://github.com/aady01/wallet0/blob/main/app/solana/page.tsx"
click node_app_ethereum "https://github.com/aady01/wallet0/blob/main/app/ethereum/page.tsx"
click node_app_loading "https://github.com/aady01/wallet0/blob/main/app/loading.tsx"
click node_solana_loading "https://github.com/aady01/wallet0/blob/main/app/solana/loading.tsx"
click node_ethereum_loading "https://github.com/aady01/wallet0/blob/main/app/ethereum/loading.tsx"
click node_landing_page "https://github.com/aady01/wallet0/blob/main/components/homepage/LandingPage.tsx"
click node_text_pressure "https://github.com/aady01/wallet0/blob/main/components/ui/TextPressure/TextPressure.tsx"
click node_ui_primitives "https://github.com/aady01/wallet0/blob/main/components/ui/button.tsx"
click node_mobile_hook "https://github.com/aady01/wallet0/blob/main/hooks/use-mobile.ts"
click node_utils "https://github.com/aady01/wallet0/blob/main/lib/utils.ts"
click node_global_styles "https://github.com/aady01/wallet0/blob/main/app/globals.css"

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_app_layout,node_app_home,node_app_solana,node_app_ethereum,node_app_loading,node_solana_loading,node_ethereum_loading toneBlue
class node_landing_page,node_text_pressure,node_ui_primitives toneAmber
class node_mobile_hook,node_utils,node_global_styles toneMint
```

## Components

### App Router

Next.js App Router entrypoints and route-level suspense states.

- [App layout](https://github.com/aady01/wallet0/blob/main/app/layout.tsx): Next.js shell · Root application shell that wraps all routes. · `app/layout.tsx`
- [Home route](https://github.com/aady01/wallet0/blob/main/app/page.tsx): route page · Landing entry for the app. · `app/page.tsx`
- [Solana route](https://github.com/aady01/wallet0/blob/main/app/solana/page.tsx): route page · Chain-specific Solana experience. · `app/solana/page.tsx`
- [Ethereum route](https://github.com/aady01/wallet0/blob/main/app/ethereum/page.tsx): route page · Chain-specific Ethereum experience. · `app/ethereum/page.tsx`
- [Root loading](https://github.com/aady01/wallet0/blob/main/app/loading.tsx): suspense state · Fallback shown while the root route is loading. · `app/loading.tsx`
- [Solana loading](https://github.com/aady01/wallet0/blob/main/app/solana/loading.tsx): suspense state · Fallback shown while the Solana route is loading. · `app/solana/loading.tsx`
- [Ethereum loading](https://github.com/aady01/wallet0/blob/main/app/ethereum/loading.tsx): suspense state · Fallback shown while the Ethereum route is loading. · `app/ethereum/loading.tsx`

### Shared UI

Reusable presentation and interaction layer used across routes.

- [Landing page](https://github.com/aady01/wallet0/blob/main/components/homepage/LandingPage.tsx): ui composition · Main custom homepage composition layer. · `components/homepage/LandingPage.tsx`
- [Text pressure](https://github.com/aady01/wallet0/blob/main/components/ui/TextPressure/TextPressure.tsx): animated hero · Branding and headline animation component. · `components/ui/TextPressure/TextPressure.tsx`
- [UI kit](https://github.com/aady01/wallet0/blob/main/components/ui/button.tsx): shadcn primitives · Reusable component set for dialogs, inputs, tables, tabs, and other controls. · `components/ui/button.tsx`

### Foundation

Global styling, helpers, and responsive support.

- [Mobile hook](https://github.com/aady01/wallet0/blob/main/hooks/use-mobile.ts): responsive helper · Breakpoint-aware hook for adaptive layouts. · `hooks/use-mobile.ts`
- [Utils](https://github.com/aady01/wallet0/blob/main/lib/utils.ts): helper lib · Shared utility helpers for class composition and UI consistency. · `lib/utils.ts`
- [Global styles](https://github.com/aady01/wallet0/blob/main/app/globals.css): tailwind base · Global theme and base styling for the app. · `app/globals.css`

## Connections

- App layout → Home route: wraps · Root shell provides the home route frame.
- App layout → Solana route: wraps · Root shell provides the Solana route frame.
- App layout → Ethereum route: wraps · Root shell provides the Ethereum route frame.
- App layout → Global styles: loads · Global theme and base styles are applied at the app shell.
- Home route → Landing page: renders · Home route is composed from the landing experience.
- Solana route → UI kit: uses · Solana flow is assembled from shared UI controls.
- Ethereum route → UI kit: uses · Ethereum flow is assembled from shared UI controls.
- Landing page → Text pressure: includes · Landing page uses animated branding treatment.
- Landing page → Mobile hook: adapts · Landing page branches for mobile layout density.
- Landing page → UI kit: composes · Landing page is built from reusable UI building blocks.
- Landing page → Utils: shares · Landing page relies on shared helper utilities.
- Home route → Root loading: suspense · Root route has a loading fallback.
- Solana route → Solana loading: suspense · Solana route has a loading fallback.
- Ethereum route → Ethereum loading: suspense · Ethereum route has a loading fallback.
