# dan-carlo-villafranca/kaya-website architecture

> Architecture diagram of the GitHub repository dan-carlo-villafranca/kaya-website, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dan-carlo-villafranca/kaya-website
- Repository: https://github.com/dan-carlo-villafranca/kaya-website

## Overview

KAYA is a browser-based marketplace connecting clients with job seekers. The visible workflow supports account registration or login, role-based routing, job-seeker profile completion, and a job-seeker dashboard; a separate search page filters sample worker listings. Supabase supplies authentication and profile records. The client dashboard is present in the tree, but its behavior is unsampled, and the search implementation shows local sample data rather than a backend query, so those links are not inferred.

Main entry points: [`js/supabase.js`](https://github.com/dan-carlo-villafranca/kaya-website/blob/main/js/supabase.js) (Supabase client), [`js/app.js`](https://github.com/dan-carlo-villafranca/kaya-website/blob/main/js/app.js) (Session guard), [`js/profile.js`](https://github.com/dan-carlo-villafranca/kaya-website/blob/main/js/profile.js) (Profile editor), [`pages/login.html`](https://github.com/dan-carlo-villafranca/kaya-website/blob/main/pages/login.html) (Login & register)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_account["Accounts &amp; access"]
  node_authpages["Login &amp; register<br/>[login.html]"]
  node_authflow["Account auth<br/>[auth.js]"]
  node_sessionui["Session guard<br/>[app.js]"]
  node_supabaseclient["Supabase client<br/>[supabase.js]"]
end

subgraph group_profiles["Worker profiles"]
  node_profilepage["Profile form<br/>[profile.html]"]
  node_profilehandler["Profile editor<br/>[profile.js]"]
  node_profilesdb[("Profiles table")]
  node_jobdashboard["Job-seeker dashboard"]
  node_clientdashboard["Client dashboard"]
end

subgraph group_marketplace["Marketplace"]
  node_searchpage["Worker search<br/>[search.html]"]
  node_searchlogic["Search &amp; filters<br/>[search.js]"]
  node_landing["Landing page<br/>[index.html]"]
end

node_visitor(("Visitor"))
node_supabase[("Supabase")]

node_visitor -->|"opens"| node_authpages
node_authpages -.->|"submits credentials"| node_authflow
node_authflow -->|"authenticates via"| node_supabaseclient
node_supabaseclient -->|"auth and profile requests"| node_supabase
node_sessionui -->|"checks session"| node_supabaseclient
node_sessionui -->|"routes client"| node_clientdashboard
node_sessionui -->|"routes job seeker"| node_jobdashboard
node_sessionui -->|"requires completion"| node_profilepage
node_profilepage -.->|"loads form"| node_profilehandler
node_profilehandler -->|"loads current user"| node_supabaseclient
node_profilehandler -->|"upserts profile"| node_profilesdb
node_jobdashboard -->|"loads user profile"| node_supabaseclient
node_searchpage -.->|"renders listings"| node_searchlogic
node_visitor -->|"searches workers"| node_searchpage
node_visitor -->|"browses"| node_landing

click node_authpages "https://github.com/dan-carlo-villafranca/kaya-website/blob/main/pages/login.html"
click node_authflow "https://github.com/dan-carlo-villafranca/kaya-website/blob/main/js/auth.js"
click node_sessionui "https://github.com/dan-carlo-villafranca/kaya-website/blob/main/js/app.js"
click node_supabaseclient "https://github.com/dan-carlo-villafranca/kaya-website/blob/main/js/supabase.js"
click node_profilepage "https://github.com/dan-carlo-villafranca/kaya-website/blob/main/pages/profile.html"
click node_profilehandler "https://github.com/dan-carlo-villafranca/kaya-website/blob/main/js/profile.js"
click node_jobdashboard "https://github.com/dan-carlo-villafranca/kaya-website/blob/main/js/jobseeker-dashboard.js"
click node_clientdashboard "https://github.com/dan-carlo-villafranca/kaya-website/blob/main/pages/client-dashboard.html"
click node_searchpage "https://github.com/dan-carlo-villafranca/kaya-website/blob/main/pages/search.html"
click node_searchlogic "https://github.com/dan-carlo-villafranca/kaya-website/blob/main/js/search.js"
click node_landing "https://github.com/dan-carlo-villafranca/kaya-website/blob/main/index.html"

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_authpages,node_authflow,node_sessionui,node_supabaseclient toneBlue
class node_profilepage,node_profilehandler,node_profilesdb,node_jobdashboard,node_clientdashboard,node_supabase toneAmber
class node_searchpage,node_searchlogic,node_landing toneMint
class node_visitor toneIndigo
```

## Components

### Accounts & access

- [Login & register](https://github.com/dan-carlo-villafranca/kaya-website/blob/main/pages/login.html): `pages/login.html`
- [Account auth](https://github.com/dan-carlo-villafranca/kaya-website/blob/main/js/auth.js): `js/auth.js`
- [Session guard](https://github.com/dan-carlo-villafranca/kaya-website/blob/main/js/app.js): `js/app.js`
- [Supabase client](https://github.com/dan-carlo-villafranca/kaya-website/blob/main/js/supabase.js): `js/supabase.js`

### Worker profiles

- [Profile form](https://github.com/dan-carlo-villafranca/kaya-website/blob/main/pages/profile.html): `pages/profile.html`
- [Profile editor](https://github.com/dan-carlo-villafranca/kaya-website/blob/main/js/profile.js): `js/profile.js`
- **Profiles table**
- [Job-seeker dashboard](https://github.com/dan-carlo-villafranca/kaya-website/blob/main/js/jobseeker-dashboard.js): `js/jobseeker-dashboard.js`
- [Client dashboard](https://github.com/dan-carlo-villafranca/kaya-website/blob/main/pages/client-dashboard.html): `pages/client-dashboard.html`

### Marketplace

- [Worker search](https://github.com/dan-carlo-villafranca/kaya-website/blob/main/pages/search.html): `pages/search.html`
- [Search & filters](https://github.com/dan-carlo-villafranca/kaya-website/blob/main/js/search.js): `js/search.js`
- [Landing page](https://github.com/dan-carlo-villafranca/kaya-website/blob/main/index.html): `index.html`

### Other components

- **Visitor**
- **Supabase**

## Connections

- Visitor → Login & register: opens
- Login & register → Account auth: submits credentials
- Account auth → Supabase client: authenticates via (evidence: `js/auth.js`)
- Supabase client → Supabase: auth and profile requests (evidence: `js/supabase.js`)
- Session guard → Supabase client: checks session (evidence: `js/app.js`)
- Session guard → Client dashboard: routes client (evidence: `js/app.js`)
- Session guard → Job-seeker dashboard: routes job seeker (evidence: `js/app.js`)
- Session guard → Profile form: requires completion (evidence: `js/app.js`)
- Profile form → Profile editor: loads form
- Profile editor → Supabase client: loads current user (evidence: `js/profile.js`)
- Profile editor → Profiles table: upserts profile (evidence: `js/profile.js`)
- Job-seeker dashboard → Supabase client: loads user profile (evidence: `js/jobseeker-dashboard.js`)
- Worker search → Search & filters: renders listings
- Visitor → Worker search: searches workers
- Visitor → Landing page: browses
