# djmirontos/unmconfession architecture

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

- Interactive diagram: https://gitdiagram.com/djmirontos/unmconfession
- Repository: https://github.com/djmirontos/unmconfession

## Overview

This repository combines a mobile community app for posts, lost-and-found and marketplace listings, chat, profiles, and moderation; a staff administration panel; a public information site; and a Supabase storage-cleanup function. The main member journey is account access, browsing or creating community content, interacting with other members, and handling moderation or notifications. Most product routes are represented by the tree rather than inspected source, so their connections are shown as unverified; the auth bootstrap, held-item review call, and cleanup function have direct source evidence.

Main entry points: [`supabase/functions/storage-cleanup/index.ts`](https://github.com/djmirontos/unmconfession/blob/main/supabase/functions/storage-cleanup/index.ts) (Cleanup worker), [`mobile/hooks/useAuthBootstrap.ts`](https://github.com/djmirontos/unmconfession/blob/main/mobile/hooks/useAuthBootstrap.ts) (Session bootstrap), [`mobile/lib/sessionStorage.ts`](https://github.com/djmirontos/unmconfession/blob/main/mobile/lib/sessionStorage.ts) (Encrypted sessions), [`mobile/lib/supabase.ts`](https://github.com/djmirontos/unmconfession/blob/main/mobile/lib/supabase.ts) (Supabase client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Member app"]
  node_auth["Account access<br/>[sign-in.tsx]"]
  node_feed["Community feed<br/>[index.tsx]"]
  node_create["Content creation<br/>[create.tsx]"]
  node_market["Marketplace<br/>[market.tsx]"]
  node_chat["Member chat<br/>[&#91;id&#93;.tsx]"]
  node_profile["Profiles and settings<br/>[profile.tsx]"]
  node_moderation["Member moderation<br/>[index.tsx]"]
  node_heldreview["Held-item review<br/>[useReviewHeld.ts]"]
  node_notifications["Notifications<br/>[notifications.tsx]"]
  node_authbootstrap["Session bootstrap"]
  node_sessionstore["Encrypted sessions<br/>[sessionStorage.ts]"]
  node_querycache["Query persistence<br/>[queryClient.ts]"]
  node_supabaseclient["Supabase client<br/>[supabase.ts]"]
end

subgraph group_admin["Staff administration"]
  node_adminlogin["Staff sign-in<br/>[page.tsx]"]
  node_admincontent["Content operations<br/>[page.tsx]"]
  node_adminreview["Review queues<br/>[page.tsx]"]
  node_adminreports["User reports<br/>[page.tsx]"]
  node_adminusers["User management<br/>[page.tsx]"]
  node_adminkeywords["Keyword controls<br/>[page.tsx]"]
  node_adminannouncements["Announcements<br/>[page.tsx]"]
  node_adminaudit["Audit and logs<br/>[page.tsx]"]
end

subgraph group_site["Public information"]
  node_publicsite["Public information<br/>[page.tsx]"]
  node_legalcontent["Legal and safety pages<br/>[legal.ts]"]
end

subgraph group_maintenance["Storage maintenance"]
  node_cleanup["Cleanup worker<br/>[index.ts]"]
  node_cleanuplogic["Cleanup rules<br/>[logic.ts]"]
end

node_member(("Member"))
node_supabase[("Supabase services")]
node_objectstorage[("Object storage")]
node_asyncstorage[("Device storage")]
node_staff(("Staff member"))
node_visitor(("Site visitor"))
node_scheduler(("Scheduled trigger"))

node_member -.->|"signs in"| node_auth
node_member -.->|"browses"| node_feed
node_member -.->|"creates content"| node_create
node_member -.->|"browses listings"| node_market
node_member -.->|"starts chat"| node_chat
node_member -.->|"manages profile"| node_profile
node_member -.->|"views moderation"| node_moderation
node_member -.->|"checks alerts"| node_notifications
node_authbootstrap -->|"restores session"| node_supabaseclient
node_authbootstrap -->|"reads fallback"| node_sessionstore
node_authbootstrap -->|"observes auth"| node_supabase
node_sessionstore -->|"stores ciphertext"| node_asyncstorage
node_sessionstore -.->|"provides auth storage"| node_supabaseclient
node_querycache -->|"persists queries"| node_asyncstorage
node_heldreview -->|"calls review RPC"| node_supabaseclient
node_heldreview -->|"submits decision"| node_supabase
node_staff -.->|"signs in"| node_adminlogin
node_visitor -.->|"visits"| node_publicsite
node_scheduler -->|"invokes nightly"| node_cleanup
node_cleanup -->|"uses rules"| node_cleanuplogic
node_cleanup -->|"claims cleanup batches"| node_supabase
node_cleanup -->|"removes files"| node_objectstorage
node_adminreview -.->|"manages review"| node_supabase

click node_auth "https://github.com/djmirontos/unmconfession/blob/main/mobile/app/(auth)/sign-in.tsx"
click node_feed "https://github.com/djmirontos/unmconfession/blob/main/mobile/app/(tabs)/index.tsx"
click node_create "https://github.com/djmirontos/unmconfession/blob/main/mobile/app/(tabs)/create.tsx"
click node_market "https://github.com/djmirontos/unmconfession/blob/main/mobile/app/(tabs)/market.tsx"
click node_chat "https://github.com/djmirontos/unmconfession/blob/main/mobile/app/chat/%5Bid%5D.tsx"
click node_profile "https://github.com/djmirontos/unmconfession/blob/main/mobile/app/(tabs)/profile.tsx"
click node_moderation "https://github.com/djmirontos/unmconfession/blob/main/mobile/app/moderation/index.tsx"
click node_heldreview "https://github.com/djmirontos/unmconfession/blob/main/mobile/hooks/useReviewHeld.ts"
click node_notifications "https://github.com/djmirontos/unmconfession/blob/main/mobile/app/notifications.tsx"
click node_authbootstrap "https://github.com/djmirontos/unmconfession/blob/main/mobile/hooks/useAuthBootstrap.ts"
click node_sessionstore "https://github.com/djmirontos/unmconfession/blob/main/mobile/lib/sessionStorage.ts"
click node_querycache "https://github.com/djmirontos/unmconfession/blob/main/mobile/lib/queryClient.ts"
click node_supabaseclient "https://github.com/djmirontos/unmconfession/blob/main/mobile/lib/supabase.ts"
click node_adminlogin "https://github.com/djmirontos/unmconfession/blob/main/admin/app/(auth)/login/page.tsx"
click node_admincontent "https://github.com/djmirontos/unmconfession/blob/main/admin/app/(panel)/content/page.tsx"
click node_adminreview "https://github.com/djmirontos/unmconfession/blob/main/admin/app/(panel)/review/%5Btype%5D/%5Bid%5D/page.tsx"
click node_adminreports "https://github.com/djmirontos/unmconfession/blob/main/admin/app/(panel)/reports/page.tsx"
click node_adminusers "https://github.com/djmirontos/unmconfession/blob/main/admin/app/(panel)/users/%5Bid%5D/page.tsx"
click node_adminkeywords "https://github.com/djmirontos/unmconfession/blob/main/admin/app/(panel)/keywords/page.tsx"
click node_adminannouncements "https://github.com/djmirontos/unmconfession/blob/main/admin/app/(panel)/announcements/page.tsx"
click node_adminaudit "https://github.com/djmirontos/unmconfession/blob/main/admin/app/(panel)/audit/page.tsx"
click node_publicsite "https://github.com/djmirontos/unmconfession/blob/main/site/app/page.tsx"
click node_legalcontent "https://github.com/djmirontos/unmconfession/blob/main/site/content/legal.ts"
click node_cleanup "https://github.com/djmirontos/unmconfession/blob/main/supabase/functions/storage-cleanup/index.ts"
click node_cleanuplogic "https://github.com/djmirontos/unmconfession/blob/main/supabase/functions/storage-cleanup/logic.ts"

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_auth,node_feed,node_create,node_market,node_chat,node_profile,node_moderation,node_heldreview,node_notifications,node_authbootstrap,node_sessionstore,node_querycache,node_supabaseclient toneBlue
class node_adminlogin,node_admincontent,node_adminreview,node_adminreports,node_adminusers,node_adminkeywords,node_adminannouncements,node_adminaudit,node_supabase,node_objectstorage,node_asyncstorage toneAmber
class node_publicsite,node_legalcontent toneMint
class node_cleanup,node_cleanuplogic toneRose
class node_member,node_staff,node_visitor,node_scheduler toneIndigo
```

## Components

### Member app

- [Account access](https://github.com/djmirontos/unmconfession/blob/main/mobile/app/(auth)/sign-in.tsx): `mobile/app/(auth)/sign-in.tsx`
- [Community feed](https://github.com/djmirontos/unmconfession/blob/main/mobile/app/(tabs)/index.tsx): `mobile/app/(tabs)/index.tsx`
- [Content creation](https://github.com/djmirontos/unmconfession/blob/main/mobile/app/(tabs)/create.tsx): `mobile/app/(tabs)/create.tsx`
- [Marketplace](https://github.com/djmirontos/unmconfession/blob/main/mobile/app/(tabs)/market.tsx): `mobile/app/(tabs)/market.tsx`
- [Member chat](https://github.com/djmirontos/unmconfession/blob/main/mobile/app/chat/%5Bid%5D.tsx): `mobile/app/chat/[id].tsx`
- [Profiles and settings](https://github.com/djmirontos/unmconfession/blob/main/mobile/app/(tabs)/profile.tsx): `mobile/app/(tabs)/profile.tsx`
- [Member moderation](https://github.com/djmirontos/unmconfession/blob/main/mobile/app/moderation/index.tsx): `mobile/app/moderation/index.tsx`
- [Held-item review](https://github.com/djmirontos/unmconfession/blob/main/mobile/hooks/useReviewHeld.ts): `mobile/hooks/useReviewHeld.ts`
- [Notifications](https://github.com/djmirontos/unmconfession/blob/main/mobile/app/notifications.tsx): `mobile/app/notifications.tsx`
- [Session bootstrap](https://github.com/djmirontos/unmconfession/blob/main/mobile/hooks/useAuthBootstrap.ts): `mobile/hooks/useAuthBootstrap.ts`
- [Encrypted sessions](https://github.com/djmirontos/unmconfession/blob/main/mobile/lib/sessionStorage.ts): `mobile/lib/sessionStorage.ts`
- [Query persistence](https://github.com/djmirontos/unmconfession/blob/main/mobile/lib/queryClient.ts): `mobile/lib/queryClient.ts`
- [Supabase client](https://github.com/djmirontos/unmconfession/blob/main/mobile/lib/supabase.ts): `mobile/lib/supabase.ts`

### Staff administration

- [Staff sign-in](https://github.com/djmirontos/unmconfession/blob/main/admin/app/(auth)/login/page.tsx): `admin/app/(auth)/login/page.tsx`
- [Content operations](https://github.com/djmirontos/unmconfession/blob/main/admin/app/(panel)/content/page.tsx): `admin/app/(panel)/content/page.tsx`
- [Review queues](https://github.com/djmirontos/unmconfession/blob/main/admin/app/(panel)/review/%5Btype%5D/%5Bid%5D/page.tsx): `admin/app/(panel)/review/[type]/[id]/page.tsx`
- [User reports](https://github.com/djmirontos/unmconfession/blob/main/admin/app/(panel)/reports/page.tsx): `admin/app/(panel)/reports/page.tsx`
- [User management](https://github.com/djmirontos/unmconfession/blob/main/admin/app/(panel)/users/%5Bid%5D/page.tsx): `admin/app/(panel)/users/[id]/page.tsx`
- [Keyword controls](https://github.com/djmirontos/unmconfession/blob/main/admin/app/(panel)/keywords/page.tsx): `admin/app/(panel)/keywords/page.tsx`
- [Announcements](https://github.com/djmirontos/unmconfession/blob/main/admin/app/(panel)/announcements/page.tsx): `admin/app/(panel)/announcements/page.tsx`
- [Audit and logs](https://github.com/djmirontos/unmconfession/blob/main/admin/app/(panel)/audit/page.tsx): `admin/app/(panel)/audit/page.tsx`

### Public information

- [Public information](https://github.com/djmirontos/unmconfession/blob/main/site/app/page.tsx): `site/app/page.tsx`
- [Legal and safety pages](https://github.com/djmirontos/unmconfession/blob/main/site/content/legal.ts): `site/content/legal.ts`

### Storage maintenance

- [Cleanup worker](https://github.com/djmirontos/unmconfession/blob/main/supabase/functions/storage-cleanup/index.ts): `supabase/functions/storage-cleanup/index.ts`
- [Cleanup rules](https://github.com/djmirontos/unmconfession/blob/main/supabase/functions/storage-cleanup/logic.ts): `supabase/functions/storage-cleanup/logic.ts`

### Other components

- **Member**
- **Supabase services**
- **Object storage**
- **Device storage**
- **Staff member**
- **Site visitor**
- **Scheduled trigger**

## Connections

- Member → Account access: signs in
- Member → Community feed: browses
- Member → Content creation: creates content
- Member → Marketplace: browses listings
- Member → Member chat: starts chat
- Member → Profiles and settings: manages profile
- Member → Member moderation: views moderation
- Member → Notifications: checks alerts
- Session bootstrap → Supabase client: restores session (evidence: `mobile/hooks/useAuthBootstrap.ts`)
- Session bootstrap → Encrypted sessions: reads fallback (evidence: `mobile/hooks/useAuthBootstrap.ts`)
- Session bootstrap → Supabase services: observes auth (evidence: `mobile/hooks/useAuthBootstrap.ts`)
- Encrypted sessions → Device storage: stores ciphertext (evidence: `mobile/lib/sessionStorage.ts`)
- Encrypted sessions → Supabase client: provides auth storage
- Query persistence → Device storage: persists queries (evidence: `mobile/lib/queryClient.ts`)
- Held-item review → Supabase client: calls review RPC (evidence: `mobile/hooks/useReviewHeld.ts`)
- Held-item review → Supabase services: submits decision (evidence: `mobile/hooks/useReviewHeld.ts`)
- Staff member → Staff sign-in: signs in
- Site visitor → Public information: visits
- Scheduled trigger → Cleanup worker: invokes nightly (evidence: `supabase/functions/storage-cleanup/index.ts`)
- Cleanup worker → Cleanup rules: uses rules (evidence: `supabase/functions/storage-cleanup/index.ts`)
- Cleanup worker → Supabase services: claims cleanup batches (evidence: `supabase/functions/storage-cleanup/index.ts`)
- Cleanup worker → Object storage: removes files (evidence: `supabase/functions/storage-cleanup/index.ts`)
- Review queues → Supabase services: manages review
