# eyeoosh/forus architecture

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

- Interactive diagram: https://gitdiagram.com/eyeoosh/forus
- Repository: https://github.com/eyeoosh/forus

## Overview

For us is a private relationship-memory site with a public-facing (authenticated) archive and an admin editor. Visitors sign in, browse month cards, and open individual memories; admins sign in separately, then add, edit, or delete months and upload photos. Supabase provides authentication, database, and photo storage, while database and storage policies enforce access. The README documents the security and deployment model; source excerpts show the page-level operations. The schema and HTML wiring are represented from the tree and README, not sampled source.

Main entry points: [`js/index.js`](https://github.com/eyeoosh/forus/blob/main/js/index.js) (Month listing), [`js/month.js`](https://github.com/eyeoosh/forus/blob/main/js/month.js) (Memory detail), [`js/admin.js`](https://github.com/eyeoosh/forus/blob/main/js/admin.js) (Month editor), [`supabase/schema.sql`](https://github.com/eyeoosh/forus/blob/main/supabase/schema.sql) (RLS policies)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Memory experience"]
  node_home["Login and archive<br/>[index.html]"]
  node_archive["Month listing<br/>[index.js]"]
  node_detail["Memory detail<br/>[month.js]"]
  node_monthpage["Memory page<br/>[month.html]"]
end

subgraph group_admin["Admin editing"]
  node_adminpage["Admin page<br/>[admin.html]"]
  node_editor["Month editor<br/>[admin.js]"]
end

subgraph group_backend["Supabase services"]
  node_client["Supabase client<br/>[supabase-client.js]"]
  node_config["Service config<br/>[config.js]"]
  node_authsvc{{"Supabase Auth"}}
  node_months[("Months database")]
  node_photos[("Photo storage")]
end

subgraph group_security["Access control"]
  node_authguard["Login guard<br/>[auth.js]"]
  node_policies["RLS policies<br/>[schema.sql]"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_home
node_home -->|"loads"| node_archive
node_archive -->|"queries via"| node_client
node_client -->|"uses"| node_config
node_archive -->|"checks session"| node_authsvc
node_archive -->|"reads months"| node_months
node_archive -->|"links cards"| node_monthpage
node_visitor -->|"opens link"| node_monthpage
node_monthpage -->|"loads"| node_detail
node_detail -->|"requires login"| node_authguard
node_authguard -->|"checks session"| node_authsvc
node_detail -->|"queries via"| node_client
node_detail -->|"reads memory"| node_months
node_visitor -->|"opens"| node_adminpage
node_adminpage -->|"loads"| node_editor
node_editor -->|"signs in"| node_authsvc
node_editor -->|"manages months"| node_months
node_editor -->|"uploads photos"| node_photos
node_policies -->|"defines access"| node_months
node_policies -->|"defines access"| node_photos
node_authsvc -.->|"authenticated access"| node_policies

click node_home "https://github.com/eyeoosh/forus/blob/main/index.html"
click node_archive "https://github.com/eyeoosh/forus/blob/main/js/index.js"
click node_detail "https://github.com/eyeoosh/forus/blob/main/js/month.js"
click node_adminpage "https://github.com/eyeoosh/forus/blob/main/admin.html"
click node_editor "https://github.com/eyeoosh/forus/blob/main/js/admin.js"
click node_authguard "https://github.com/eyeoosh/forus/blob/main/js/auth.js"
click node_client "https://github.com/eyeoosh/forus/blob/main/js/supabase-client.js"
click node_config "https://github.com/eyeoosh/forus/blob/main/js/config.js"
click node_policies "https://github.com/eyeoosh/forus/blob/main/supabase/schema.sql"
click node_monthpage "https://github.com/eyeoosh/forus/blob/main/month.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_home,node_archive,node_detail,node_monthpage toneBlue
class node_adminpage,node_editor toneAmber
class node_client,node_config,node_authsvc,node_months,node_photos toneMint
class node_authguard,node_policies toneRose
class node_visitor toneIndigo
```

## Components

### Memory experience

- [Login and archive](https://github.com/eyeoosh/forus/blob/main/index.html): `index.html`
- [Month listing](https://github.com/eyeoosh/forus/blob/main/js/index.js): `js/index.js`
- [Memory detail](https://github.com/eyeoosh/forus/blob/main/js/month.js): `js/month.js`
- [Memory page](https://github.com/eyeoosh/forus/blob/main/month.html): `month.html`

### Admin editing

- [Admin page](https://github.com/eyeoosh/forus/blob/main/admin.html): `admin.html`
- [Month editor](https://github.com/eyeoosh/forus/blob/main/js/admin.js): `js/admin.js`

### Supabase services

- [Supabase client](https://github.com/eyeoosh/forus/blob/main/js/supabase-client.js): `js/supabase-client.js`
- [Service config](https://github.com/eyeoosh/forus/blob/main/js/config.js): `js/config.js`
- **Supabase Auth**
- **Months database**
- **Photo storage**

### Access control

- [Login guard](https://github.com/eyeoosh/forus/blob/main/js/auth.js): `js/auth.js`
- [RLS policies](https://github.com/eyeoosh/forus/blob/main/supabase/schema.sql): `supabase/schema.sql`

### Other components

- **Visitor**

## Connections

- Visitor → Login and archive: opens (evidence: `README.md`)
- Login and archive → Month listing: loads (evidence: `README.md`)
- Month listing → Supabase client: queries via (evidence: `js/index.js`)
- Supabase client → Service config: uses (evidence: `js/supabase-client.js`)
- Month listing → Supabase Auth: checks session (evidence: `js/index.js`)
- Month listing → Months database: reads months (evidence: `js/index.js`)
- Month listing → Memory page: links cards (evidence: `js/index.js`)
- Visitor → Memory page: opens link (evidence: `README.md`)
- Memory page → Memory detail: loads (evidence: `README.md`)
- Memory detail → Login guard: requires login (evidence: `js/month.js`)
- Login guard → Supabase Auth: checks session (evidence: `js/auth.js`)
- Memory detail → Supabase client: queries via (evidence: `js/month.js`)
- Memory detail → Months database: reads memory (evidence: `js/month.js`)
- Visitor → Admin page: opens (evidence: `README.md`)
- Admin page → Month editor: loads (evidence: `README.md`)
- Month editor → Supabase Auth: signs in (evidence: `js/admin.js`)
- Month editor → Months database: manages months (evidence: `js/admin.js`)
- Month editor → Photo storage: uploads photos (evidence: `js/admin.js`)
- RLS policies → Months database: defines access (evidence: `README.md`)
- RLS policies → Photo storage: defines access (evidence: `README.md`)
- Supabase Auth → RLS policies: authenticated access
