# antony-jacob817/echoweave architecture

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

- Interactive diagram: https://gitdiagram.com/antony-jacob817/echoweave
- Repository: https://github.com/antony-jacob817/echoweave

## Overview

1. **Repository shape**
   - EchoWeave is a TypeScript frontend app with a small serverless/API layer.
   - The main client is built with Vite/Bun and organized around TanStack Router route files under `src/routes`.
   - The repo also includes Cloudflare-style deployment config (`wrangler.jsonc`) and two API handlers in `api/`.

2. **Primary user-facing surfaces**
   - There are two major app areas: a public marketing site and an authenticated dashboard.
   - Public pages are composed from `src/components/landing/*` plus shared header/footer/navigation.
   - The authenticated area centers on `src/routes/dashboard.tsx` and dashboard-specific components like `MindMap` and `VoiceRecorder`.

3. **Routing and page composition**
   - Routing is file-based/route-generated, with `src/routeTree.gen.ts` and `src/router.tsx` wiring the app shell.
   - `src/routes/__root.tsx` likely provides the top-level layout and providers.
   - `login.tsx`, `signup.tsx`, `index.tsx`, and `dashboard.tsx` define the main entry points and page boundaries.

4. **Authentication boundary**
   - Auth concerns are isolated in `src/lib/auth.tsx`, `src/services/authService.ts`, and `src/store/useAuthStore.ts`.
   - `src/components/auth/ProtectedRoute.tsx` guards the dashboard boundary.
   - `AuthLayout.tsx` and `SocialButtons.tsx` indicate a dedicated auth flow for login/signup, with social sign-in supported through Supabase.

5. **Data/backend dependency**
   - Supabase is the primary external backend dependency, surfaced through `src/lib/supabase.ts` and typed in `src/types/supabase.ts`.
   - The app appears to rely on Supabase for authentication and likely user/session persistence, rather than a custom backend in this repo.

6. **Core product workflow**
   - The dashboard seems to support recording a voice note, processing it into AI-generated outputs, and presenting a mind map.
   - `VoiceRecorder.tsx` is the capture/input boundary.
   - `MindMap.tsx` is the visualization/output boundary.
   - This suggests a pipeline from user speech input to structured insight/mind-map generation.

7. **Service layer and orchestration**
   - Business logic is separated from components in `src/services/*`.
   - `voiceNoteService.ts`, `projectService.ts`, and `mindmapService.ts` likely coordinate persistence and transformation of user content.
   - `aiService.ts` is the abstraction point for model-backed generation, keeping AI calls out of UI components.

8. **Serverless AI endpoints**
   - `api/generateInsight.ts` and `api/generateMindmap.ts` are the backend generation endpoints.
   - These are the key integration points for AI inference or prompt-based transformation.
   - The frontend service layer likely calls these endpoints to turn recordings or notes into structured insight and mind map data.

9. **Client state management**
   - Local app state is split into focused stores under `src/store`.
   - `useAuthStore.ts` tracks session/auth state.
   - `useProjectStore.ts` likely tracks project/session content and generated artifacts.
   - `useRecordingStore.ts` handles recorder state and audio capture lifecycle.

10. **Shared UI system**
   - Most primitives come from a component library under `src/components/ui`, matching a shadcn-style design system.
   - This provides reusable building blocks such as dialogs, forms, tables, tabs, tooltips, and sidebars.
   - Higher-level app components are composed on top of these primitives, keeping visual and behavioral concerns separated.

11. **Landing/marketing subsystem**
   - The landing page is broken into sections: Hero, Features, HowItWorks, Testimonials, Pricing, and FinalCTA.
   - These components indicate a conversion-oriented public funnel before authentication.
   - `Navbar`, `Logo`, and `Footer` provide shared branding/navigation across the public site.

12. **Error handling and environment**
   - `src/lib/error-capture.ts` and `src/lib/error-page.ts` suggest centralized error reporting and fallback UI.
   - `src/server.ts` and `src/start.ts` indicate a runtime entry structure beyond just static client rendering.
   - `public/` and `src/styles.css` contain the static assets and global presentation layer.

13. **Architecture boundaries to show in a diagram**
   - Boundary 1: public marketing pages vs authenticated dashboard.
   - Boundary 2: UI components vs service logic vs state stores.
   - Boundary 3: client app vs external Supabase auth/backend.
   - Boundary 4: client app vs serverless AI endpoints in `api/`.

14. **Operational/deployment model**
   - The repo is set up for modern TypeScript frontend delivery with Bun/npm tooling, Vite bundling, and Cloudflare-compatible deployment.
   - `wrangler.jsonc` and `bun.lock` are the strongest signals of the execution/deploy target and package/runtime choices.

Main entry points: [`src/services/aiService.ts`](https://github.com/antony-jacob817/echoweave/blob/main/src/services/aiService.ts) (Services), [`src/components/auth/AuthLayout.tsx`](https://github.com/antony-jacob817/echoweave/blob/main/src/components/auth/AuthLayout.tsx) (Auth UI), [`src/components/ui/button.tsx`](https://github.com/antony-jacob817/echoweave/blob/main/src/components/ui/button.tsx) (UI kit), [`src/components/dashboard/VoiceRecorder.tsx`](https://github.com/antony-jacob817/echoweave/blob/main/src/components/dashboard/VoiceRecorder.tsx) (Dashboard UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_group_public["Public site"]
  node_node_home["Home page<br/>landing route<br/>[index.tsx]"]
  node_node_public_ui["Public chrome<br/>shared components<br/>[Navbar.tsx]"]
  node_node_hero["Landing sections<br/>marketing sections<br/>[Hero.tsx]"]
end

subgraph group_group_auth["Auth boundary"]
  node_node_login["Login page<br/>auth route<br/>[login.tsx]"]
  node_node_signup["Signup page<br/>auth route<br/>[signup.tsx]"]
  node_node_auth_ui["Auth UI<br/>auth components<br/>[AuthLayout.tsx]"]
end

subgraph group_group_dashboard["Dashboard"]
  node_node_dashboard_route["Dashboard page<br/>app route<br/>[dashboard.tsx]"]
  node_node_dashboard_ui["Dashboard UI<br/>product components<br/>[VoiceRecorder.tsx]"]
end

subgraph group_group_app["App core"]
  node_node_root["Root layout<br/>route shell<br/>[__root.tsx]"]
  node_node_router["Router<br/>route wiring<br/>[router.tsx]"]
  node_node_route_tree["Route tree<br/>generated routes<br/>[routeTree.gen.ts]"]
  node_node_ui_kit["UI kit<br/>design system<br/>[button.tsx]"]
  node_node_auth_lib["Auth layer<br/>auth integration<br/>[auth.tsx]"]
  node_node_state["Client state<br/>stores<br/>[useAuthStore.ts]"]
  node_node_services["Services<br/>business logic<br/>[aiService.ts]"]
end

subgraph group_group_backend["Backend edge"]
  node_node_insight_api["Insight API<br/>serverless handler<br/>[generateInsight.ts]"]
  node_node_mindmap_api["Mindmap API<br/>serverless handler<br/>[generateMindmap.ts]"]
  node_node_runtime["Runtime entry<br/>server startup<br/>[start.ts]"]
  node_node_server["Server bridge<br/>server entry<br/>[server.ts]"]
  node_node_deploy["Deployment<br/>cloudflare config<br/>[wrangler.jsonc]"]
end

node_node_supabase[("Supabase<br/>external backend<br/>[supabase.ts]")]

node_node_router -->|"loads"| node_node_route_tree
node_node_root -->|"hosts"| node_node_router
node_node_home -->|"uses"| node_node_public_ui
node_node_home -->|"renders"| node_node_hero
node_node_login -->|"uses"| node_node_auth_ui
node_node_signup -->|"uses"| node_node_auth_ui
node_node_dashboard_route -->|"guards"| node_node_auth_ui
node_node_dashboard_route -->|"renders"| node_node_dashboard_ui
node_node_auth_ui -->|"checks"| node_node_auth_lib
node_node_auth_lib -->|"integrates"| node_node_supabase
node_node_state -->|"stores"| node_node_auth_lib
node_node_state -->|"drives"| node_node_services
node_node_services -->|"calls"| node_node_insight_api
node_node_services -->|"calls"| node_node_mindmap_api
node_node_services -->|"persists"| node_node_supabase
node_node_dashboard_ui -->|"requests"| node_node_services
node_node_public_ui -->|"composes"| node_node_ui_kit
node_node_hero -->|"composes"| node_node_ui_kit
node_node_auth_ui -->|"composes"| node_node_ui_kit
node_node_dashboard_ui -->|"composes"| node_node_ui_kit
node_node_server -->|"boots"| node_node_runtime
node_node_server -->|"targets"| node_node_deploy

click node_node_root "https://github.com/antony-jacob817/echoweave/blob/main/src/routes/__root.tsx"
click node_node_router "https://github.com/antony-jacob817/echoweave/blob/main/src/router.tsx"
click node_node_route_tree "https://github.com/antony-jacob817/echoweave/blob/main/src/routeTree.gen.ts"
click node_node_home "https://github.com/antony-jacob817/echoweave/blob/main/src/routes/index.tsx"
click node_node_login "https://github.com/antony-jacob817/echoweave/blob/main/src/routes/login.tsx"
click node_node_signup "https://github.com/antony-jacob817/echoweave/blob/main/src/routes/signup.tsx"
click node_node_dashboard_route "https://github.com/antony-jacob817/echoweave/blob/main/src/routes/dashboard.tsx"
click node_node_public_ui "https://github.com/antony-jacob817/echoweave/blob/main/src/components/Navbar.tsx"
click node_node_hero "https://github.com/antony-jacob817/echoweave/blob/main/src/components/landing/Hero.tsx"
click node_node_auth_ui "https://github.com/antony-jacob817/echoweave/blob/main/src/components/auth/AuthLayout.tsx"
click node_node_dashboard_ui "https://github.com/antony-jacob817/echoweave/blob/main/src/components/dashboard/VoiceRecorder.tsx"
click node_node_ui_kit "https://github.com/antony-jacob817/echoweave/blob/main/src/components/ui/button.tsx"
click node_node_auth_lib "https://github.com/antony-jacob817/echoweave/blob/main/src/lib/auth.tsx"
click node_node_supabase "https://github.com/antony-jacob817/echoweave/blob/main/src/lib/supabase.ts"
click node_node_state "https://github.com/antony-jacob817/echoweave/blob/main/src/store/useAuthStore.ts"
click node_node_services "https://github.com/antony-jacob817/echoweave/blob/main/src/services/aiService.ts"
click node_node_insight_api "https://github.com/antony-jacob817/echoweave/blob/main/api/generateInsight.ts"
click node_node_mindmap_api "https://github.com/antony-jacob817/echoweave/blob/main/api/generateMindmap.ts"
click node_node_runtime "https://github.com/antony-jacob817/echoweave/blob/main/src/start.ts"
click node_node_server "https://github.com/antony-jacob817/echoweave/blob/main/src/server.ts"
click node_node_deploy "https://github.com/antony-jacob817/echoweave/blob/main/wrangler.jsonc"

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_node_home,node_node_public_ui,node_node_hero toneBlue
class node_node_login,node_node_signup,node_node_auth_ui toneAmber
class node_node_dashboard_route,node_node_dashboard_ui toneMint
class node_node_root,node_node_router,node_node_route_tree,node_node_ui_kit,node_node_auth_lib,node_node_state,node_node_services toneRose
class node_node_insight_api,node_node_mindmap_api,node_node_runtime,node_node_server,node_node_deploy toneIndigo
class node_node_supabase toneNeutral
```

## Components

### Public site

Marketing pages and shared public-facing chrome.

- [Home page](https://github.com/antony-jacob817/echoweave/blob/main/src/routes/index.tsx): landing route · Public entry page for the marketing funnel. · `src/routes/index.tsx`
- [Public chrome](https://github.com/antony-jacob817/echoweave/blob/main/src/components/Navbar.tsx): shared components · Shared header, logo, and footer used across marketing pages. · `src/components/Navbar.tsx`
- [Landing sections](https://github.com/antony-jacob817/echoweave/blob/main/src/components/landing/Hero.tsx): marketing sections · Hero, features, how-it-works, testimonials, pricing, and CTA sections. · `src/components/landing/Hero.tsx`

### Auth boundary

Login, signup, and route protection for authenticated access.

- [Login page](https://github.com/antony-jacob817/echoweave/blob/main/src/routes/login.tsx): auth route · Authentication entry for existing users. · `src/routes/login.tsx`
- [Signup page](https://github.com/antony-jacob817/echoweave/blob/main/src/routes/signup.tsx): auth route · Registration entry for new users. · `src/routes/signup.tsx`
- [Auth UI](https://github.com/antony-jacob817/echoweave/blob/main/src/components/auth/AuthLayout.tsx): auth components · Auth layout, social sign-in, and protected route guard. · `src/components/auth/AuthLayout.tsx`

### Dashboard

Voice capture and generated mind map workflow.

- [Dashboard page](https://github.com/antony-jacob817/echoweave/blob/main/src/routes/dashboard.tsx): app route · Authenticated product workspace entry. · `src/routes/dashboard.tsx`
- [Dashboard UI](https://github.com/antony-jacob817/echoweave/blob/main/src/components/dashboard/VoiceRecorder.tsx): product components · Voice recorder and mind map presentation components. · `src/components/dashboard/VoiceRecorder.tsx`

### App core

Routing, providers, services, state, and shared libraries.

- [Root layout](https://github.com/antony-jacob817/echoweave/blob/main/src/routes/__root.tsx): route shell · Top-level route layout and app-wide providers. · `src/routes/__root.tsx`
- [Router](https://github.com/antony-jacob817/echoweave/blob/main/src/router.tsx): route wiring · Router setup and generated route tree integration. · `src/router.tsx`
- [Route tree](https://github.com/antony-jacob817/echoweave/blob/main/src/routeTree.gen.ts): generated routes · File-based route manifest generated from route files. · `src/routeTree.gen.ts`
- [UI kit](https://github.com/antony-jacob817/echoweave/blob/main/src/components/ui/button.tsx): design system · Reusable primitive component library used throughout the app. · `src/components/ui/button.tsx`
- [Auth layer](https://github.com/antony-jacob817/echoweave/blob/main/src/lib/auth.tsx): auth integration · Supabase-backed auth helpers and session plumbing. · `src/lib/auth.tsx`
- [Client state](https://github.com/antony-jacob817/echoweave/blob/main/src/store/useAuthStore.ts): stores · Focused app stores for auth, projects, and recording lifecycle. · `src/store/useAuthStore.ts`
- [Services](https://github.com/antony-jacob817/echoweave/blob/main/src/services/aiService.ts): business logic · Orchestration layer for auth, voice notes, projects, AI, and mind maps. · `src/services/aiService.ts`

### Backend edge

Serverless AI handlers and deployment/runtime entrypoints.

- [Insight API](https://github.com/antony-jacob817/echoweave/blob/main/api/generateInsight.ts): serverless handler · Endpoint that generates structured insights from user content. · `api/generateInsight.ts`
- [Mindmap API](https://github.com/antony-jacob817/echoweave/blob/main/api/generateMindmap.ts): serverless handler · Endpoint that generates mind map structures for the dashboard. · `api/generateMindmap.ts`
- [Runtime entry](https://github.com/antony-jacob817/echoweave/blob/main/src/start.ts): server startup · Application startup and server-side runtime hooks. · `src/start.ts`
- [Server bridge](https://github.com/antony-jacob817/echoweave/blob/main/src/server.ts): server entry · Server-facing entry used alongside the client app. · `src/server.ts`
- [Deployment](https://github.com/antony-jacob817/echoweave/blob/main/wrangler.jsonc): cloudflare config · Cloudflare-compatible deployment configuration. · `wrangler.jsonc`

### Other components

- [Supabase](https://github.com/antony-jacob817/echoweave/blob/main/src/lib/supabase.ts): external backend · Primary authentication and backend dependency. · `src/lib/supabase.ts`

## Connections

- Router → Route tree: loads · Router consumes the generated route manifest.
- Root layout → Router: hosts · Root layout wraps the routed app shell.
- Home page → Public chrome: uses · Public page composes shared branding/navigation.
- Home page → Landing sections: renders · Landing page is built from marketing sections.
- Login page → Auth UI: uses · Login flow is wrapped by auth-specific UI.
- Signup page → Auth UI: uses · Signup flow is wrapped by auth-specific UI.
- Dashboard page → Auth UI: guards · Dashboard access is protected by auth boundary components.
- Dashboard page → Dashboard UI: renders · Dashboard page centers on capture and visualization UI.
- Auth UI → Auth layer: checks · Auth boundary consults auth helpers and session state.
- Auth layer → Supabase: integrates · Authentication is backed by Supabase.
- Client state → Auth layer: stores · Stores persist auth/session state.
- Client state → Services: drives · Stores coordinate app content and workflow state.
- Services → Insight API: calls · Service layer invokes insight generation endpoint.
- Services → Mindmap API: calls · Service layer invokes mind map generation endpoint.
- Services → Supabase: persists · Services rely on Supabase for backend data and auth context.
- Dashboard UI → Services: requests · Recorder and mind map UI depend on orchestration services.
- Public chrome → UI kit: composes · Shared chrome is assembled from UI primitives.
- Landing sections → UI kit: composes · Landing sections are built on the common UI kit.
- Auth UI → UI kit: composes · Auth screens use the shared component library.
- Dashboard UI → UI kit: composes · Dashboard visuals are built from shared primitives.
- Server bridge → Runtime entry: boots · Server entry hooks into runtime startup.
- Server bridge → Deployment: targets · Deployment config defines the runtime environment.
