# zuby012/kivo architecture

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

- Interactive diagram: https://gitdiagram.com/zuby012/kivo
- Repository: https://github.com/zuby012/kivo

## Overview

Kivo is a Nuxt authentication frontend: users can reach login or registration, establish a session, and access a protected home page; verification is a distinct authorization stage. The sampled code shows in-memory session state, refresh/logout requests, and route middleware, plus Apple/Google OAuth links. Login and registration components, verification UI, and legal pages are present, but their wiring was not shown in the excerpts, so those links are omitted. The README identifies only a Nuxt starter and documents no additional product capabilities.

Main entry points: [`app/middleware/auth.ts`](https://github.com/zuby012/kivo/blob/main/app/middleware/auth.ts) (Auth middleware), [`app/composables/useAuth.ts`](https://github.com/zuby012/kivo/blob/main/app/composables/useAuth.ts) (Auth session), [`app/composables/useAPI.ts`](https://github.com/zuby012/kivo/blob/main/app/composables/useAPI.ts) (Authorized API client), [`app/pages/index.vue`](https://github.com/zuby012/kivo/blob/main/app/pages/index.vue) (Protected home)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_auth_ui["Authentication UI"]
  node_login_page["Login page<br/>[login.vue]"]
  node_register_page["Registration page<br/>[register.vue]"]
  node_login_form["Login form<br/>[LoginForm.vue]"]
  node_register_form["Registration form<br/>[RegisterForm.vue]"]
  node_oauth_button["OAuth links<br/>[OAuthButton.vue]"]
  node_verify_page["Verification page<br/>[verify.vue]"]
  node_legal_pages["Legal pages<br/>[privacy.vue]"]
  node_terms_page["Terms page<br/>[terms.vue]"]
  node_validators["Input validation<br/>[validators.ts]"]
end

subgraph group_session_access["Session and access"]
  node_auth_state["Auth session<br/>[useAuth.ts]"]
  node_api_client["Authorized API client<br/>[useAPI.ts]"]
  node_route_guard["Auth middleware<br/>[auth.ts]"]
  node_home_page["Protected home<br/>[index.vue]"]
end

subgraph group_app_shell["Application shell"]
  node_app_root["Nuxt root<br/>[app.vue]"]
  node_default_layout["Default layout<br/>[default.vue]"]
end

node_visitor(("Visitor"))
node_auth_api{{"Auth API"}}

node_visitor -.->|"opens"| node_login_page
node_app_root -->|"renders"| node_default_layout
node_api_client -->|"reads session"| node_auth_state
node_api_client -->|"refreshes token"| node_auth_api
node_route_guard -->|"checks session"| node_auth_state
node_route_guard -->|"refreshes token"| node_auth_api
node_route_guard -->|"redirects unauthenticated"| node_login_page
node_route_guard -->|"redirects unverified"| node_verify_page
node_home_page -->|"declares middleware"| node_route_guard
node_home_page -->|"reads session"| node_auth_state
node_auth_state -->|"refreshes and logs out"| node_auth_api
node_oauth_button -->|"links to OAuth"| node_auth_api

click node_login_page "https://github.com/zuby012/kivo/blob/main/app/pages/login.vue"
click node_register_page "https://github.com/zuby012/kivo/blob/main/app/pages/register.vue"
click node_login_form "https://github.com/zuby012/kivo/blob/main/app/components/auth/LoginForm.vue"
click node_register_form "https://github.com/zuby012/kivo/blob/main/app/components/auth/RegisterForm.vue"
click node_oauth_button "https://github.com/zuby012/kivo/blob/main/app/components/auth/OAuthButton.vue"
click node_verify_page "https://github.com/zuby012/kivo/blob/main/app/pages/verify.vue"
click node_legal_pages "https://github.com/zuby012/kivo/blob/main/app/pages/privacy.vue"
click node_terms_page "https://github.com/zuby012/kivo/blob/main/app/pages/terms.vue"
click node_validators "https://github.com/zuby012/kivo/blob/main/app/utils/validators.ts"
click node_auth_state "https://github.com/zuby012/kivo/blob/main/app/composables/useAuth.ts"
click node_api_client "https://github.com/zuby012/kivo/blob/main/app/composables/useAPI.ts"
click node_route_guard "https://github.com/zuby012/kivo/blob/main/app/middleware/auth.ts"
click node_home_page "https://github.com/zuby012/kivo/blob/main/app/pages/index.vue"
click node_app_root "https://github.com/zuby012/kivo/blob/main/app/app.vue"
click node_default_layout "https://github.com/zuby012/kivo/blob/main/app/layouts/default.vue"

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_login_page,node_register_page,node_login_form,node_register_form,node_oauth_button,node_verify_page,node_legal_pages,node_terms_page,node_validators toneBlue
class node_auth_state,node_api_client,node_route_guard,node_home_page toneAmber
class node_app_root,node_default_layout,node_auth_api toneMint
class node_visitor toneIndigo
```

## Components

### Authentication UI

- [Login page](https://github.com/zuby012/kivo/blob/main/app/pages/login.vue): `app/pages/login.vue`
- [Registration page](https://github.com/zuby012/kivo/blob/main/app/pages/register.vue): `app/pages/register.vue`
- [Login form](https://github.com/zuby012/kivo/blob/main/app/components/auth/LoginForm.vue): `app/components/auth/LoginForm.vue`
- [Registration form](https://github.com/zuby012/kivo/blob/main/app/components/auth/RegisterForm.vue): `app/components/auth/RegisterForm.vue`
- [OAuth links](https://github.com/zuby012/kivo/blob/main/app/components/auth/OAuthButton.vue): `app/components/auth/OAuthButton.vue`
- [Verification page](https://github.com/zuby012/kivo/blob/main/app/pages/verify.vue): `app/pages/verify.vue`
- [Legal pages](https://github.com/zuby012/kivo/blob/main/app/pages/privacy.vue): `app/pages/privacy.vue`
- [Terms page](https://github.com/zuby012/kivo/blob/main/app/pages/terms.vue): `app/pages/terms.vue`
- [Input validation](https://github.com/zuby012/kivo/blob/main/app/utils/validators.ts): `app/utils/validators.ts`

### Session and access

- [Auth session](https://github.com/zuby012/kivo/blob/main/app/composables/useAuth.ts): `app/composables/useAuth.ts`
- [Authorized API client](https://github.com/zuby012/kivo/blob/main/app/composables/useAPI.ts): `app/composables/useAPI.ts`
- [Auth middleware](https://github.com/zuby012/kivo/blob/main/app/middleware/auth.ts): `app/middleware/auth.ts`
- [Protected home](https://github.com/zuby012/kivo/blob/main/app/pages/index.vue): `app/pages/index.vue`

### Application shell

- [Nuxt root](https://github.com/zuby012/kivo/blob/main/app/app.vue): `app/app.vue`
- [Default layout](https://github.com/zuby012/kivo/blob/main/app/layouts/default.vue): `app/layouts/default.vue`

### Other components

- **Visitor**
- **Auth API**

## Connections

- Visitor → Login page: opens
- Nuxt root → Default layout: renders (evidence: `app/app.vue`)
- Authorized API client → Auth session: reads session (evidence: `app/composables/useAPI.ts`)
- Authorized API client → Auth API: refreshes token (evidence: `app/composables/useAPI.ts`)
- Auth middleware → Auth session: checks session (evidence: `app/middleware/auth.ts`)
- Auth middleware → Auth API: refreshes token (evidence: `app/middleware/auth.ts`)
- Auth middleware → Login page: redirects unauthenticated (evidence: `app/middleware/auth.ts`)
- Auth middleware → Verification page: redirects unverified (evidence: `app/middleware/auth.ts`)
- Protected home → Auth middleware: declares middleware (evidence: `app/pages/index.vue`)
- Protected home → Auth session: reads session (evidence: `app/pages/index.vue`)
- Auth session → Auth API: refreshes and logs out (evidence: `app/composables/useAuth.ts`)
- OAuth links → Auth API: links to OAuth (evidence: `app/components/auth/OAuthButton.vue`)
