# empty-developer/verse architecture

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

- Interactive diagram: https://gitdiagram.com/empty-developer/verse
- Repository: https://github.com/empty-developer/verse

## Overview

Verse is a cross-platform writing and reading community: users onboard and authenticate, discover posts and books, publish writing, and interact through likes and comments. The graph includes the documented feed, library, reading, and author/profile capabilities. Source excerpts confirm authentication persistence, post creation and image upload, and comment/like state operations; wiring from individual screens to several domain modules is not shown, so those links are omitted.

Main entry points: [`lib/supabase.ts`](https://github.com/empty-developer/verse/blob/main/lib/supabase.ts) (Supabase client), [`app/index.tsx`](https://github.com/empty-developer/verse/blob/main/app/index.tsx) (App entry), [`hooks/usePosts.ts`](https://github.com/empty-developer/verse/blob/main/hooks/usePosts.ts) (Post creation), [`stores/useAuthStore.ts`](https://github.com/empty-developer/verse/blob/main/stores/useAuthStore.ts) (Authentication state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App navigation"]
  node_entry["App entry<br/>[index.tsx]"]
end

subgraph group_identity["Onboarding and identity"]
  node_onboarding["Onboarding<br/>[onboarding.tsx]"]
  node_onboarding_data["Onboarding content"]
  node_sign_in["Sign in<br/>[sign-in.tsx]"]
  node_registration["Registration<br/>[registration.tsx]"]
  node_auth_store["Authentication state<br/>[useAuthStore.ts]"]
end

subgraph group_community["Writing community"]
  node_feed["Social feed<br/>[index.tsx]"]
  node_post_detail["Post interaction<br/>[like.tsx]"]
  node_comments_ui["Comments interface<br/>[CommentsSheet.tsx]"]
  node_comments_state["Comment state<br/>[useCommentStore.ts]"]
  node_comments_hook["Comment hook<br/>[useComments.ts]"]
  node_post_hook["Post creation<br/>[usePosts.ts]"]
  node_profile["Writer profile<br/>[profile.tsx]"]
  node_bio["Profile operations<br/>[bio-user.ts]"]
end

subgraph group_reading["Reading library"]
  node_library["Book library<br/>[library.tsx]"]
  node_book_detail["Read a book<br/>[&#91;id&#93;.tsx]"]
  node_books["Book operations<br/>[books.ts]"]
end

subgraph group_backend["Backend and state"]
  node_post_store["Post state<br/>[usePostStore.ts]"]
  node_post_data["Post operations<br/>[posts.ts]"]
  node_comment_data["Comment operations<br/>[comments.ts]"]
  node_image_storage["Image uploads<br/>[storage.ts]"]
  node_supabase_client["Supabase client<br/>[supabase.ts]"]
end

node_writer(("Writer / reader"))
node_supabase[("Supabase service")]
node_local_storage[("Device persistence")]

node_writer -->|"opens app"| node_entry
node_entry -->|"routes first"| node_onboarding
node_entry -->|"routes unauthenticated"| node_sign_in
node_entry -->|"routes authenticated"| node_feed
node_onboarding -->|"uses content"| node_onboarding_data
node_sign_in -->|"authenticates via"| node_auth_store
node_registration -->|"registers via"| node_auth_store
node_auth_store -->|"calls auth"| node_supabase_client
node_auth_store -->|"persists state"| node_local_storage
node_feed -->|"publishes through"| node_post_hook
node_post_hook -->|"uploads cover"| node_image_storage
node_post_hook -->|"inserts post"| node_supabase_client
node_post_hook -->|"adds post"| node_post_store
node_image_storage -->|"uploads image"| node_supabase_client
node_post_store -->|"creates or removes likes"| node_post_data
node_comments_ui -->|"uses"| node_comments_hook
node_comments_hook -->|"reads and updates"| node_comments_state
node_comments_state -->|"loads and creates comments"| node_comment_data
node_library -->|"opens work"| node_book_detail
node_profile -.->|"profile data"| node_bio
node_books -.->|"backend access"| node_supabase_client
node_post_data -->|"backend access"| node_supabase_client
node_comment_data -->|"backend access"| node_supabase_client
node_supabase_client -->|"connects"| node_supabase

click node_entry "https://github.com/empty-developer/verse/blob/main/app/index.tsx"
click node_onboarding "https://github.com/empty-developer/verse/blob/main/app/onboarding.tsx"
click node_onboarding_data "https://github.com/empty-developer/verse/blob/main/service/options/OnboardingService.tsx"
click node_sign_in "https://github.com/empty-developer/verse/blob/main/app/(auth)/sign-in.tsx"
click node_registration "https://github.com/empty-developer/verse/blob/main/app/(auth)/registration.tsx"
click node_auth_store "https://github.com/empty-developer/verse/blob/main/stores/useAuthStore.ts"
click node_feed "https://github.com/empty-developer/verse/blob/main/app/(protected)/(tabs)/index.tsx"
click node_post_detail "https://github.com/empty-developer/verse/blob/main/app/(protected)/like.tsx"
click node_comments_ui "https://github.com/empty-developer/verse/blob/main/components/ui/comments/CommentsSheet.tsx"
click node_comments_state "https://github.com/empty-developer/verse/blob/main/stores/useCommentStore.ts"
click node_comments_hook "https://github.com/empty-developer/verse/blob/main/hooks/useComments.ts"
click node_post_hook "https://github.com/empty-developer/verse/blob/main/hooks/usePosts.ts"
click node_profile "https://github.com/empty-developer/verse/blob/main/app/(protected)/(tabs)/profile.tsx"
click node_library "https://github.com/empty-developer/verse/blob/main/app/(protected)/(tabs)/library.tsx"
click node_book_detail "https://github.com/empty-developer/verse/blob/main/app/(protected)/book/%5Bid%5D.tsx"
click node_books "https://github.com/empty-developer/verse/blob/main/lib/books.ts"
click node_bio "https://github.com/empty-developer/verse/blob/main/lib/bio-user.ts"
click node_post_store "https://github.com/empty-developer/verse/blob/main/stores/usePostStore.ts"
click node_post_data "https://github.com/empty-developer/verse/blob/main/lib/posts.ts"
click node_comment_data "https://github.com/empty-developer/verse/blob/main/lib/comments.ts"
click node_image_storage "https://github.com/empty-developer/verse/blob/main/lib/storage.ts"
click node_supabase_client "https://github.com/empty-developer/verse/blob/main/lib/supabase.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_entry toneBlue
class node_onboarding,node_onboarding_data,node_sign_in,node_registration,node_auth_store,node_supabase,node_local_storage toneAmber
class node_feed,node_post_detail,node_comments_ui,node_comments_state,node_comments_hook,node_post_hook,node_profile,node_bio toneMint
class node_library,node_book_detail,node_books toneRose
class node_post_store,node_post_data,node_comment_data,node_image_storage,node_supabase_client,node_writer toneIndigo
```

## Components

### App navigation

- [App entry](https://github.com/empty-developer/verse/blob/main/app/index.tsx): `app/index.tsx`

### Onboarding and identity

- [Onboarding](https://github.com/empty-developer/verse/blob/main/app/onboarding.tsx): `app/onboarding.tsx`
- [Onboarding content](https://github.com/empty-developer/verse/blob/main/service/options/OnboardingService.tsx): `service/options/OnboardingService.tsx`
- [Sign in](https://github.com/empty-developer/verse/blob/main/app/(auth)/sign-in.tsx): `app/(auth)/sign-in.tsx`
- [Registration](https://github.com/empty-developer/verse/blob/main/app/(auth)/registration.tsx): `app/(auth)/registration.tsx`
- [Authentication state](https://github.com/empty-developer/verse/blob/main/stores/useAuthStore.ts): `stores/useAuthStore.ts`

### Writing community

- [Social feed](https://github.com/empty-developer/verse/blob/main/app/(protected)/(tabs)/index.tsx): `app/(protected)/(tabs)/index.tsx`
- [Post interaction](https://github.com/empty-developer/verse/blob/main/app/(protected)/like.tsx): `app/(protected)/like.tsx`
- [Comments interface](https://github.com/empty-developer/verse/blob/main/components/ui/comments/CommentsSheet.tsx): `components/ui/comments/CommentsSheet.tsx`
- [Comment state](https://github.com/empty-developer/verse/blob/main/stores/useCommentStore.ts): `stores/useCommentStore.ts`
- [Comment hook](https://github.com/empty-developer/verse/blob/main/hooks/useComments.ts): `hooks/useComments.ts`
- [Post creation](https://github.com/empty-developer/verse/blob/main/hooks/usePosts.ts): `hooks/usePosts.ts`
- [Writer profile](https://github.com/empty-developer/verse/blob/main/app/(protected)/(tabs)/profile.tsx): `app/(protected)/(tabs)/profile.tsx`
- [Profile operations](https://github.com/empty-developer/verse/blob/main/lib/bio-user.ts): `lib/bio-user.ts`

### Reading library

- [Book library](https://github.com/empty-developer/verse/blob/main/app/(protected)/(tabs)/library.tsx): `app/(protected)/(tabs)/library.tsx`
- [Read a book](https://github.com/empty-developer/verse/blob/main/app/(protected)/book/%5Bid%5D.tsx): `app/(protected)/book/[id].tsx`
- [Book operations](https://github.com/empty-developer/verse/blob/main/lib/books.ts): `lib/books.ts`

### Backend and state

- [Post state](https://github.com/empty-developer/verse/blob/main/stores/usePostStore.ts): `stores/usePostStore.ts`
- [Post operations](https://github.com/empty-developer/verse/blob/main/lib/posts.ts): `lib/posts.ts`
- [Comment operations](https://github.com/empty-developer/verse/blob/main/lib/comments.ts): `lib/comments.ts`
- [Image uploads](https://github.com/empty-developer/verse/blob/main/lib/storage.ts): `lib/storage.ts`
- [Supabase client](https://github.com/empty-developer/verse/blob/main/lib/supabase.ts): `lib/supabase.ts`

### Other components

- **Writer / reader**
- **Supabase service**
- **Device persistence**

## Connections

- Writer / reader → App entry: opens app
- App entry → Onboarding: routes first
- App entry → Sign in: routes unauthenticated
- App entry → Social feed: routes authenticated
- Onboarding → Onboarding content: uses content
- Sign in → Authentication state: authenticates via
- Registration → Authentication state: registers via
- Authentication state → Supabase client: calls auth
- Authentication state → Device persistence: persists state
- Social feed → Post creation: publishes through
- Post creation → Image uploads: uploads cover
- Post creation → Supabase client: inserts post
- Post creation → Post state: adds post
- Image uploads → Supabase client: uploads image
- Post state → Post operations: creates or removes likes
- Comments interface → Comment hook: uses
- Comment hook → Comment state: reads and updates
- Comment state → Comment operations: loads and creates comments
- Book library → Read a book: opens work
- Writer profile → Profile operations: profile data
- Book operations → Supabase client: backend access
- Post operations → Supabase client: backend access
- Comment operations → Supabase client: backend access
- Supabase client → Supabase service: connects
