# codeaashu/enoughaashuu architecture

> Architecture diagram of the GitHub repository codeaashu/enoughaashuu, 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/codeaashu/enoughaashuu
- Repository: https://github.com/codeaashu/enoughaashuu

## Overview

1. **Repository shape**
   - This is a Next.js + React + TypeScript monorepo-style app, but it really contains **two products**:
     - the main “Enough Aashuu” utility site
     - a self-contained **IconLogo** editor application under `/iconlogo`
   - The app router in `src/app` provides the public site shell, while `src/iconlogo` contains a much richer client-side subsystem with its own routing, state, and server hooks.

2. **Main site shell**
   - `src/app/layout.tsx`, `globals.css`, `TopNavbar`, `Footer`, and the route pages under `src/app/*` define the shared site frame.
   - Most top-level pages are simple route entry points for marketing/content: About, Contact, Privacy, Terms, Blog, and feature landing pages.
   - SEO/PWA metadata is centralized through `src/app/manifest.ts`, `robots.ts`, `sitemap.ts`, and `src/lib/brand.ts`.

3. **Main product tools are split by processing model**
   - The repo’s tools fall into two architectural groups:
     - **browser-local processing**: image watermark removal, background removal, QR generation
     - **server-assisted workflows**: Sora extraction and AI-image detection
   - That split is important for diagramming because it defines whether the browser handles the media directly or sends requests to route handlers.

4. **Client-side media workflows**
   - `BackgroundRemover`, `GeminiRemover`, `QrCodeGenerator`, and `AiImageDetector` are the key tool components mounted by their route pages.
   - The background remover is explicitly designed to run locally and has cross-origin isolation requirements via `next.config.ts` headers, which suggests a browser model/WASM-style pipeline rather than a normal API call.
   - The watermark remover uses shared logic in `src/lib/watermark.ts`, emphasizing in-browser pixel processing rather than a backend dependency.

5. **Server-side API routes**
   - `src/app/api/detect-ai-image`, `extract-sora`, and `remove-gemini` are the main Next route handlers for backend-assisted processing.
   - `extract-sora` handles link parsing/fetching for Sora shared URLs and returns clean MP4/prompt data.
   - `detect-ai-image` acts as an aggregation point for the AI detector workflow, likely combining external signals and local heuristics.
   - `remove-gemini` provides a dedicated server endpoint for the watermark-removal tool, even though the overall product emphasizes local-first processing.

6. **AI detector architecture**
   - The AI detector is an ensemble pipeline, not a single model call.
   - It combines external classification/inference services plus local metadata analysis, then applies weighted voting and thresholding before showing a final result and JSON export.
   - This means the browser UI is only the presentation layer; the decision logic is split between route handler, upstream providers, and local scoring.

7. **QR generator architecture**
   - The QR tool is fully client-side and supports multiple payload types: URL/text, Wi‑Fi, vCard, event, phone, SMS, and geo.
   - The UI handles styling, logo upload, randomization, and export to PNG/JPEG/SVG.
   - Because export and visual styling are local, it behaves like a self-contained graphics editor rather than an API-backed service.

8. **IconLogo is a full editor subsystem**
   - `src/iconlogo` is organized like an application within the application:
     - `features/` for editor, landing, picker, collections, dock, share, etc.
     - `domain/` for icon/logo/share types, validators, fonts, and randomization
     - `commands/` for user actions like load, update, undo/redo, export, and collection management
     - `store/` for persistent client state
     - `infra/` for canvas rendering, clipboard, file download, Iconify access, and KV interaction
   - The route layer in `src/iconlogo/routes` and generated `routeTree.gen.ts` indicates a dedicated client-side router, not just simple Next pages.

9. **IconLogo data flow**
   - User actions in the editor flow through commands into the logo/collection stores.
   - The store drives query hooks such as `use-logo-state`, `use-logo-svg`, and collection/search hooks.
   - Rendering/export is handled through the canvas and download infrastructure, while icon search pulls from the Iconify client.
   - This is a classic editor pipeline: UI event → command/state mutation → render/export infrastructure.

10. **IconLogo sharing and persistence**
   - Sharing is backed by `src/iconlogo/server/share.create.ts` and `share.get.ts`, with route handlers under `src/app/api/iconlogo/share`.
   - The share subsystem appears to persist share payloads in a KV-like store (`src/iconlogo/infra/kv/share-kv.ts` and `src/lib/iconlogo-share-store.ts`).
   - That makes share links a server-backed feature, distinct from the otherwise client-heavy editor.

11. **IconLogo export and clipboard pipeline**
   - Export is modularized into PNG, SVG, ICO, app-icon bundles, and copy-to-clipboard variants.
   - The editor can push assets to the clipboard, download them as files, or package them for platform-specific icon use.
   - This boundary matters because rendering/export is not coupled to the UI; it’s a separate infra layer.

12. **Shared infrastructure and state**
   - Cross-cutting client state lives in lightweight stores and query hooks rather than a single global framework.
   - The repo also uses TanStack Query integration in the IconLogo app for async server state/devtools support.
   - Browser-only helpers like localStorage prompts, keyboard shortcuts, and analytics live alongside these UI flows.

13. **External dependencies that affect architecture**
   - The main external service dependencies are:
     - **Sightengine** and **Hugging Face** for AI-image detection
     - **Iconify** for icon search in the logo editor
     - a **KV store** for share persistence
   - These services shape the trust boundaries: the editor remains mostly local, but search/share/detection depend on networked services.

14. **Deployment/runtime boundaries**
   - This repo is architected as a **hybrid Next app**: static/content routes, client-heavy browser tools, and a few server route handlers.
   - `public/sw.js` and the install prompt indicate PWA-like behavior, but the service worker is intentionally lightweight and not the core of the product.
   - For an architecture diagram, the main boundaries are: browser UI, server route handlers, external APIs, and the separate IconLogo application subsystem.

Main entry points: [`src/app/page.tsx`](https://github.com/codeaashu/enoughaashuu/blob/main/src/app/page.tsx) (Content pages), [`src/lib/brand.ts`](https://github.com/codeaashu/enoughaashuu/blob/main/src/lib/brand.ts) (Shared lib), [`src/app/layout.tsx`](https://github.com/codeaashu/enoughaashuu/blob/main/src/app/layout.tsx) (App shell), [`src/iconlogo/features/editor/EditorPage.tsx`](https://github.com/codeaashu/enoughaashuu/blob/main/src/iconlogo/features/editor/EditorPage.tsx) (Editor UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_main_site["Main site"]
  node_app_shell["App shell<br/>next app router<br/>[layout.tsx]"]
  node_content_routes["Content pages<br/>marketing routes<br/>[page.tsx]"]
  node_seo_runtime["SEO runtime<br/>metadata config<br/>[manifest.ts]"]
end

subgraph group_browser_tools["Browser tools"]
  node_bg_remover["Background remover<br/>local image tool"]
  node_gemini_remover["Gemini remover<br/>image tool<br/>[GeminiRemover.tsx]"]
  node_qr_generator["QR generator<br/>client graphics tool"]
  node_ai_detector["AI detector<br/>ensemble client"]
end

subgraph group_server_apis["Server APIs"]
  node_detect_api["Detect API<br/>route handler<br/>[route.ts]"]
  node_sora_api["Sora API<br/>route handler<br/>[route.ts]"]
  node_gemini_api["Gemini API<br/>route handler<br/>[route.ts]"]
end

subgraph group_iconlogo_app["IconLogo app"]
  node_iconlogo_landing["IconLogo landing<br/>app landing<br/>[page.tsx]"]
  node_iconlogo_editor["IconLogo editor<br/>client app<br/>[page.tsx]"]
  node_iconlogo_routes["IconLogo routes<br/>client router<br/>[router.tsx]"]
  node_editor_features["Editor UI<br/>feature modules<br/>[EditorPage.tsx]"]
  node_editor_domain["Editor domain<br/>types and validators<br/>[logo.types.ts]"]
  node_editor_commands["Commands<br/>action pipeline<br/>[update-logo.ts]"]
  node_editor_store[("Stores<br/>client state<br/>[logo-store.ts]")]
  node_editor_infra["Editor infra<br/>render/export infra<br/>[canvas-renderer.ts]"]
  node_share_server["Share server<br/>server persistence<br/>[share.create.ts]"]
end

subgraph group_shared_infra["Shared infra"]
  node_shared_ui["Shared UI<br/>components<br/>[TopNavbar.tsx]"]
  node_shared_lib["Shared lib<br/>utilities<br/>[brand.ts]"]
end

node_app_shell -->|"uses"| node_shared_ui
node_app_shell -->|"hosts"| node_content_routes
node_app_shell -->|"publishes"| node_seo_runtime
node_content_routes -->|"mounts"| node_bg_remover
node_content_routes -->|"mounts"| node_gemini_remover
node_content_routes -->|"mounts"| node_qr_generator
node_content_routes -->|"mounts"| node_ai_detector
node_bg_remover -->|"uses"| node_shared_lib
node_gemini_remover -->|"calls"| node_gemini_api
node_ai_detector -->|"calls"| node_detect_api
node_sora_api -->|"uses"| node_shared_lib
node_gemini_api -->|"uses"| node_shared_lib
node_iconlogo_landing -->|"launches"| node_iconlogo_editor
node_iconlogo_editor -->|"hosts"| node_iconlogo_routes
node_iconlogo_routes -->|"renders"| node_editor_features
node_editor_features -->|"dispatches"| node_editor_commands
node_editor_commands -->|"mutates"| node_editor_store
node_editor_store -->|"shapes"| node_editor_domain
node_editor_features -->|"uses"| node_editor_infra
node_editor_commands -->|"creates"| node_share_server
node_share_server -->|"uses"| node_shared_lib

click node_app_shell "https://github.com/codeaashu/enoughaashuu/blob/main/src/app/layout.tsx"
click node_content_routes "https://github.com/codeaashu/enoughaashuu/blob/main/src/app/page.tsx"
click node_seo_runtime "https://github.com/codeaashu/enoughaashuu/blob/main/src/app/manifest.ts"
click node_bg_remover "https://github.com/codeaashu/enoughaashuu/blob/main/src/components/BackgroundRemover.tsx"
click node_gemini_remover "https://github.com/codeaashu/enoughaashuu/blob/main/src/components/GeminiRemover.tsx"
click node_qr_generator "https://github.com/codeaashu/enoughaashuu/blob/main/src/components/QrCodeGenerator.tsx"
click node_ai_detector "https://github.com/codeaashu/enoughaashuu/blob/main/src/components/AiImageDetector.tsx"
click node_detect_api "https://github.com/codeaashu/enoughaashuu/blob/main/src/app/api/detect-ai-image/route.ts"
click node_sora_api "https://github.com/codeaashu/enoughaashuu/blob/main/src/app/api/extract-sora/route.ts"
click node_gemini_api "https://github.com/codeaashu/enoughaashuu/blob/main/src/app/api/remove-gemini/route.ts"
click node_iconlogo_landing "https://github.com/codeaashu/enoughaashuu/blob/main/src/app/iconlogo/page.tsx"
click node_iconlogo_editor "https://github.com/codeaashu/enoughaashuu/blob/main/src/app/iconlogo/editor/page.tsx"
click node_iconlogo_routes "https://github.com/codeaashu/enoughaashuu/blob/main/src/iconlogo/router.tsx"
click node_editor_features "https://github.com/codeaashu/enoughaashuu/blob/main/src/iconlogo/features/editor/EditorPage.tsx"
click node_editor_domain "https://github.com/codeaashu/enoughaashuu/blob/main/src/iconlogo/domain/logo/logo.types.ts"
click node_editor_commands "https://github.com/codeaashu/enoughaashuu/blob/main/src/iconlogo/commands/logo/update-logo.ts"
click node_editor_store "https://github.com/codeaashu/enoughaashuu/blob/main/src/iconlogo/store/logo-store.ts"
click node_editor_infra "https://github.com/codeaashu/enoughaashuu/blob/main/src/iconlogo/infra/canvas/canvas-renderer.ts"
click node_share_server "https://github.com/codeaashu/enoughaashuu/blob/main/src/iconlogo/server/share.create.ts"
click node_shared_ui "https://github.com/codeaashu/enoughaashuu/blob/main/src/components/TopNavbar.tsx"
click node_shared_lib "https://github.com/codeaashu/enoughaashuu/blob/main/src/lib/brand.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_app_shell,node_content_routes,node_seo_runtime toneBlue
class node_bg_remover,node_gemini_remover,node_qr_generator,node_ai_detector toneAmber
class node_detect_api,node_sora_api,node_gemini_api toneMint
class node_iconlogo_landing,node_iconlogo_editor,node_iconlogo_routes,node_editor_features,node_editor_domain,node_editor_commands,node_editor_store,node_editor_infra,node_share_server toneRose
class node_shared_ui,node_shared_lib toneIndigo
```

## Components

### Main site

Public App Router shell and content pages.

- [App shell](https://github.com/codeaashu/enoughaashuu/blob/main/src/app/layout.tsx): next app router · Root layout, shared navigation/footer, metadata, and site-wide pages. · `src/app/layout.tsx`
- [Content pages](https://github.com/codeaashu/enoughaashuu/blob/main/src/app/page.tsx): marketing routes · About, contact, policy, blog, and feature landing pages. · `src/app/page.tsx`
- [SEO runtime](https://github.com/codeaashu/enoughaashuu/blob/main/src/app/manifest.ts): metadata config · Manifest, robots, sitemap, and brand metadata for the site. · `src/app/manifest.ts`

### Browser tools

Client-side media and QR workflows that run mostly in the browser.

- [Background remover](https://github.com/codeaashu/enoughaashuu/blob/main/src/components/BackgroundRemover.tsx): local image tool · Client-side background removal workflow with browser processing requirements. · `src/components/BackgroundRemover.tsx`
- [Gemini remover](https://github.com/codeaashu/enoughaashuu/blob/main/src/components/GeminiRemover.tsx): image tool · Watermark removal UI backed by shared watermark logic and a server endpoint. · `src/components/GeminiRemover.tsx`
- [QR generator](https://github.com/codeaashu/enoughaashuu/blob/main/src/components/QrCodeGenerator.tsx): client graphics tool · Fully client-side QR creation, styling, and export workflow. · `src/components/QrCodeGenerator.tsx`
- [AI detector](https://github.com/codeaashu/enoughaashuu/blob/main/src/components/AiImageDetector.tsx): ensemble client · UI for AI-image detection results, scoring, and JSON export presentation. · `src/components/AiImageDetector.tsx`

### Server APIs

Route handlers that broker external services or share persistence.

- [Detect API](https://github.com/codeaashu/enoughaashuu/blob/main/src/app/api/detect-ai-image/route.ts): route handler · Server aggregation point for AI-image detection providers and heuristics. · `src/app/api/detect-ai-image/route.ts`
- [Sora API](https://github.com/codeaashu/enoughaashuu/blob/main/src/app/api/extract-sora/route.ts): route handler · Parses shared Sora links and returns extracted media/prompt data. · `src/app/api/extract-sora/route.ts`
- [Gemini API](https://github.com/codeaashu/enoughaashuu/blob/main/src/app/api/remove-gemini/route.ts): route handler · Dedicated server endpoint used by the watermark removal workflow. · `src/app/api/remove-gemini/route.ts`

### IconLogo app

Self-contained logo editor subsystem inside the main app.

- [IconLogo landing](https://github.com/codeaashu/enoughaashuu/blob/main/src/app/iconlogo/page.tsx): app landing · Public entry and editor launch surface for the IconLogo product. · `src/app/iconlogo/page.tsx`
- [IconLogo editor](https://github.com/codeaashu/enoughaashuu/blob/main/src/app/iconlogo/editor/page.tsx): client app · Dedicated editor shell and route entry for the logo application. · `src/app/iconlogo/editor/page.tsx`
- [IconLogo routes](https://github.com/codeaashu/enoughaashuu/blob/main/src/iconlogo/router.tsx): client router · TanStack-style app router and generated route tree for the editor subsystem. · `src/iconlogo/router.tsx`
- [Editor UI](https://github.com/codeaashu/enoughaashuu/blob/main/src/iconlogo/features/editor/EditorPage.tsx): feature modules · Editor shell, dock, picker, share, landing, and interaction components. · `src/iconlogo/features/editor/EditorPage.tsx`
- [Editor domain](https://github.com/codeaashu/enoughaashuu/blob/main/src/iconlogo/domain/logo/logo.types.ts): types and validators · Logo, icon, collection, and share domain models plus randomization rules. · `src/iconlogo/domain/logo/logo.types.ts`
- [Commands](https://github.com/codeaashu/enoughaashuu/blob/main/src/iconlogo/commands/logo/update-logo.ts): action pipeline · User actions for load, update, undo/redo, export, collection, and sharing. · `src/iconlogo/commands/logo/update-logo.ts`
- [Stores](https://github.com/codeaashu/enoughaashuu/blob/main/src/iconlogo/store/logo-store.ts): client state · Persistent logo and collection state used by queries and editor workflows. · `src/iconlogo/store/logo-store.ts`
- [Editor infra](https://github.com/codeaashu/enoughaashuu/blob/main/src/iconlogo/infra/canvas/canvas-renderer.ts): render/export infra · Canvas rendering, clipboard, download, Iconify access, and KV helpers. · `src/iconlogo/infra/canvas/canvas-renderer.ts`
- [Share server](https://github.com/codeaashu/enoughaashuu/blob/main/src/iconlogo/server/share.create.ts): server persistence · Create/get server-side share payloads for IconLogo links. · `src/iconlogo/server/share.create.ts`

### Shared infra

Cross-cutting UI, state, and utility modules used across the repo.

- [Shared UI](https://github.com/codeaashu/enoughaashuu/blob/main/src/components/TopNavbar.tsx): components · Reusable site-wide UI such as navbar, footer, loader, and install prompt. · `src/components/TopNavbar.tsx`
- [Shared lib](https://github.com/codeaashu/enoughaashuu/blob/main/src/lib/brand.ts): utilities · Branding, watermark processing, and IconLogo share-store utilities. · `src/lib/brand.ts`

## Connections

- App shell → Shared UI: uses · The root layout composes shared chrome and prompts.
- App shell → Content pages: hosts · The App Router shell serves content and landing pages.
- App shell → SEO runtime: publishes · Site metadata and discovery files are centralized here.
- Content pages → Background remover: mounts · Feature routes mount the corresponding client tool components.
- Content pages → Gemini remover: mounts · Feature routes mount the corresponding client tool components.
- Content pages → QR generator: mounts · Feature routes mount the corresponding client tool components.
- Content pages → AI detector: mounts · Feature routes mount the corresponding client tool components.
- Background remover → Shared lib: uses · Watermark/image processing logic is shared from library code.
- Gemini remover → Gemini API: calls · The watermark-removal UI delegates server-backed work to the API.
- AI detector → Detect API: calls · The detector UI submits images for ensemble scoring.
- Sora API → Shared lib: uses · Shared utilities support media extraction and processing.
- Gemini API → Shared lib: uses · Server-assisted removal shares core watermark logic.
- IconLogo landing → IconLogo editor: launches · The landing surface routes users into the editor experience.
- IconLogo editor → IconLogo routes: hosts · The editor page is driven by a dedicated client router.
- IconLogo routes → Editor UI: renders · Routes load the editor UI feature modules.
- Editor UI → Commands: dispatches · UI actions are converted into command operations.
- Commands → Stores: mutates · Commands update persistent editor state.
- Stores → Editor domain: shapes · Stored state follows domain types and validators.
- Editor UI → Editor infra: uses · Rendering, export, clipboard, and icon search are handled in infra.
- Commands → Share server: creates · Share commands persist and retrieve server-backed link payloads.
- Share server → Shared lib: uses · Share persistence relies on shared store helpers.
