# himynameisdave/davestack architecture

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

- Interactive diagram: https://gitdiagram.com/himynameisdave/davestack
- Repository: https://github.com/himynameisdave/davestack

## Overview

davestack is a SvelteKit starter application with authentication, account and admin pages, transactional email, and optional analytics. The main user workflow is to visit the app, sign in through a supported method, and reach the signed-in account or home experience; administrators also have a read-only dashboard. The graph preserves the documented auth methods and the email, analytics, and UI subsystems. Some route-to-service wiring is not visible in the excerpts, so those links are marked unverified rather than inferred as certain.

Main entry points: [`src/lib/server/auth/index.ts`](https://github.com/himynameisdave/davestack/blob/main/src/lib/server/auth/index.ts) (Auth configuration), [`src/routes/(auth)/login/+page.svelte`](https://github.com/himynameisdave/davestack/blob/main/src/routes/(auth)/login/%2Bpage.svelte) (Login and signup), [`src/lib/components/ui/dialog/dialog-content.svelte`](https://github.com/himynameisdave/davestack/blob/main/src/lib/components/ui/dialog/dialog-content.svelte) (Dialog composition), [`src/lib/client/auth.ts`](https://github.com/himynameisdave/davestack/blob/main/src/lib/client/auth.ts) (Auth client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_marketing["Marketing page<br/>[+page.svelte]"]
  node_login["Login and signup<br/>[+page.svelte]"]
  node_account["Account and passkeys<br/>[+page.svelte]"]
  node_home["App home<br/>[+page.svelte]"]
  node_admin["Admin dashboard<br/>[+page.server.ts]"]
  node_analytics["Analytics loader<br/>[+layout.svelte]"]
end

subgraph group_identity["Authentication"]
  node_clientauth["Auth client<br/>[auth.ts]"]
  node_passkeyui["Passkey sign-in"]
  node_authapi["Auth API route<br/>[+server.ts]"]
  node_authserver["Auth configuration<br/>[index.ts]"]
  node_password["Password auth"]
  node_magiclink["Magic link auth<br/>[magic-link.ts]"]
  node_google["Google OAuth<br/>[google.ts]"]
  node_passkeyserver["Passkey auth<br/>[passkey.ts]"]
end

subgraph group_services["Server services"]
  node_database[("PostgreSQL<br/>[db.ts]")]
  node_env["Environment config<br/>[env.ts]"]
  node_email["Email sender<br/>[index.ts]"]
  node_templates["Email templates<br/>[layout.ts]"]
end

subgraph group_presentation["Shared UI"]
  node_ui["UI components"]
  node_dialog["Dialog composition"]
end

node_visitor(("Visitor"))
node_resend["Resend"]
node_umami["Umami analytics"]

node_visitor -->|"visits"| node_marketing
node_visitor -->|"opens"| node_login
node_login -.->|"uses"| node_clientauth
node_clientauth -.->|"requests"| node_authapi
node_authapi -.->|"dispatches to"| node_authserver
node_authserver -.->|"configures"| node_password
node_authserver -.->|"configures"| node_magiclink
node_authserver -.->|"configures"| node_google
node_authserver -.->|"configures"| node_passkeyserver
node_passkeyui -->|"calls"| node_clientauth
node_login -.->|"uses"| node_passkeyui
node_account -.->|"manages credentials"| node_passkeyserver
node_authserver -.->|"persists auth data"| node_database
node_visitor -.->|"opens after sign-in"| node_home
node_visitor -.->|"opens after sign-in"| node_account
node_visitor -.->|"opens as admin"| node_admin
node_database -->|"reads config"| node_env
node_passkeyserver -->|"reads config"| node_env
node_email -->|"reads config"| node_env
node_email -->|"renders"| node_templates
node_templates -.->|"sends via"| node_resend
node_analytics -->|"loads script"| node_umami
node_dialog -->|"uses button"| node_ui
node_dialog -->|"composes overlay and portal"| node_dialog

click node_marketing "https://github.com/himynameisdave/davestack/blob/main/src/routes/(marketing)/%2Bpage.svelte"
click node_login "https://github.com/himynameisdave/davestack/blob/main/src/routes/(auth)/login/%2Bpage.svelte"
click node_account "https://github.com/himynameisdave/davestack/blob/main/src/routes/(app)/account/%2Bpage.svelte"
click node_home "https://github.com/himynameisdave/davestack/blob/main/src/routes/(app)/home/%2Bpage.svelte"
click node_admin "https://github.com/himynameisdave/davestack/blob/main/src/routes/(admin)/admin/%2Bpage.server.ts"
click node_analytics "https://github.com/himynameisdave/davestack/blob/main/src/routes/%2Blayout.svelte"
click node_clientauth "https://github.com/himynameisdave/davestack/blob/main/src/lib/client/auth.ts"
click node_passkeyui "https://github.com/himynameisdave/davestack/blob/main/src/lib/client/passkey-auth.svelte.ts"
click node_authapi "https://github.com/himynameisdave/davestack/blob/main/src/routes/api/auth/%5B...all%5D/%2Bserver.ts"
click node_authserver "https://github.com/himynameisdave/davestack/blob/main/src/lib/server/auth/index.ts"
click node_password "https://github.com/himynameisdave/davestack/tree/main/src/lib/server/auth"
click node_magiclink "https://github.com/himynameisdave/davestack/blob/main/src/lib/server/auth/magic-link.ts"
click node_google "https://github.com/himynameisdave/davestack/blob/main/src/lib/server/auth/google.ts"
click node_passkeyserver "https://github.com/himynameisdave/davestack/blob/main/src/lib/server/auth/passkey.ts"
click node_database "https://github.com/himynameisdave/davestack/blob/main/src/lib/server/db.ts"
click node_env "https://github.com/himynameisdave/davestack/blob/main/src/lib/server/env.ts"
click node_email "https://github.com/himynameisdave/davestack/blob/main/src/lib/server/email/index.ts"
click node_templates "https://github.com/himynameisdave/davestack/blob/main/src/lib/server/email/templates/layout.ts"
click node_ui "https://github.com/himynameisdave/davestack/tree/main/src/lib/components/ui"
click node_dialog "https://github.com/himynameisdave/davestack/blob/main/src/lib/components/ui/dialog/dialog-content.svelte"

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_marketing,node_login,node_account,node_home,node_admin,node_analytics toneBlue
class node_clientauth,node_passkeyui,node_authapi,node_authserver,node_password,node_magiclink,node_google,node_passkeyserver toneAmber
class node_database,node_env,node_email,node_templates toneMint
class node_ui,node_dialog toneRose
class node_visitor,node_resend,node_umami toneIndigo
```

## Components

### App experience

- [Marketing page](https://github.com/himynameisdave/davestack/blob/main/src/routes/(marketing)/%2Bpage.svelte): `src/routes/(marketing)/+page.svelte`
- [Login and signup](https://github.com/himynameisdave/davestack/blob/main/src/routes/(auth)/login/%2Bpage.svelte): `src/routes/(auth)/login/+page.svelte`
- [Account and passkeys](https://github.com/himynameisdave/davestack/blob/main/src/routes/(app)/account/%2Bpage.svelte): `src/routes/(app)/account/+page.svelte`
- [App home](https://github.com/himynameisdave/davestack/blob/main/src/routes/(app)/home/%2Bpage.svelte): `src/routes/(app)/home/+page.svelte`
- [Admin dashboard](https://github.com/himynameisdave/davestack/blob/main/src/routes/(admin)/admin/%2Bpage.server.ts): `src/routes/(admin)/admin/+page.server.ts`
- [Analytics loader](https://github.com/himynameisdave/davestack/blob/main/src/routes/%2Blayout.svelte): `src/routes/+layout.svelte`

### Authentication

- [Auth client](https://github.com/himynameisdave/davestack/blob/main/src/lib/client/auth.ts): `src/lib/client/auth.ts`
- [Passkey sign-in](https://github.com/himynameisdave/davestack/blob/main/src/lib/client/passkey-auth.svelte.ts): `src/lib/client/passkey-auth.svelte.ts`
- [Auth API route](https://github.com/himynameisdave/davestack/blob/main/src/routes/api/auth/%5B...all%5D/%2Bserver.ts): `src/routes/api/auth/[...all]/+server.ts`
- [Auth configuration](https://github.com/himynameisdave/davestack/blob/main/src/lib/server/auth/index.ts): `src/lib/server/auth/index.ts`
- [Password auth](https://github.com/himynameisdave/davestack/tree/main/src/lib/server/auth): `src/lib/server/auth`
- [Magic link auth](https://github.com/himynameisdave/davestack/blob/main/src/lib/server/auth/magic-link.ts): `src/lib/server/auth/magic-link.ts`
- [Google OAuth](https://github.com/himynameisdave/davestack/blob/main/src/lib/server/auth/google.ts): `src/lib/server/auth/google.ts`
- [Passkey auth](https://github.com/himynameisdave/davestack/blob/main/src/lib/server/auth/passkey.ts): `src/lib/server/auth/passkey.ts`

### Server services

- [PostgreSQL](https://github.com/himynameisdave/davestack/blob/main/src/lib/server/db.ts): `src/lib/server/db.ts`
- [Environment config](https://github.com/himynameisdave/davestack/blob/main/src/lib/server/env.ts): `src/lib/server/env.ts`
- [Email sender](https://github.com/himynameisdave/davestack/blob/main/src/lib/server/email/index.ts): `src/lib/server/email/index.ts`
- [Email templates](https://github.com/himynameisdave/davestack/blob/main/src/lib/server/email/templates/layout.ts): `src/lib/server/email/templates/layout.ts`

### Shared UI

- [UI components](https://github.com/himynameisdave/davestack/tree/main/src/lib/components/ui): `src/lib/components/ui`
- [Dialog composition](https://github.com/himynameisdave/davestack/blob/main/src/lib/components/ui/dialog/dialog-content.svelte): `src/lib/components/ui/dialog/dialog-content.svelte`

### Other components

- **Visitor**
- **Resend**
- **Umami analytics**

## Connections

- Visitor → Marketing page: visits (evidence: `README.md`)
- Visitor → Login and signup: opens (evidence: `README.md`)
- Login and signup → Auth client: uses
- Auth client → Auth API route: requests
- Auth API route → Auth configuration: dispatches to
- Auth configuration → Password auth: configures (evidence: `README.md`)
- Auth configuration → Magic link auth: configures (evidence: `README.md`)
- Auth configuration → Google OAuth: configures (evidence: `README.md`)
- Auth configuration → Passkey auth: configures (evidence: `README.md`)
- Passkey sign-in → Auth client: calls (evidence: `src/lib/client/passkey-auth.svelte.ts`)
- Login and signup → Passkey sign-in: uses
- Account and passkeys → Passkey auth: manages credentials (evidence: `README.md`)
- Auth configuration → PostgreSQL: persists auth data (evidence: `README.md`)
- Visitor → App home: opens after sign-in (evidence: `README.md`)
- Visitor → Account and passkeys: opens after sign-in (evidence: `README.md`)
- Visitor → Admin dashboard: opens as admin (evidence: `README.md`)
- PostgreSQL → Environment config: reads config (evidence: `src/lib/server/db.ts`)
- Passkey auth → Environment config: reads config (evidence: `src/lib/server/auth/passkey.ts`)
- Email sender → Environment config: reads config (evidence: `src/lib/server/email/index.ts`)
- Email sender → Email templates: renders (evidence: `src/lib/server/email/index.ts`)
- Email templates → Resend: sends via (evidence: `README.md`)
- Analytics loader → Umami analytics: loads script (evidence: `src/routes/+layout.svelte`)
- Dialog composition → UI components: uses button (evidence: `src/lib/components/ui/dialog/dialog-content.svelte`)
- Dialog composition → Dialog composition: composes overlay and portal (evidence: `src/lib/components/ui/dialog/dialog-content.svelte`)
