# natnaelsolo/social-media-app architecture

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

- Interactive diagram: https://gitdiagram.com/natnaelsolo/social-media-app
- Repository: https://github.com/natnaelsolo/social-media-app

## Overview

This is an Expo social-posting app: users can sign in or sign up, view a post feed, create posts with media, and view or edit profiles. The main path runs from routed screens through shared UI and service helpers to Supabase for authentication, database access, and media storage. Notifications are present as a screen, but their behavior is not established by the available evidence. The source index supports screen-to-module references; unsampled implementation details and some runtime connections are therefore omitted.

Main entry points: [`lib/supabase.js`](https://github.com/natnaelsolo/social-media-app/blob/main/lib/supabase.js) (Supabase client), [`constants/theme.js`](https://github.com/natnaelsolo/social-media-app/blob/main/constants/theme.js) (Theme), [`components/Avatar.jsx`](https://github.com/natnaelsolo/social-media-app/blob/main/components/Avatar.jsx) (Avatar), [`app/(main)/newPost.jsx`](https://github.com/natnaelsolo/social-media-app/blob/main/app/(main)/newPost.jsx) (Post composer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_flows["App screens"]
  node_authscreens["Welcome and auth"]
  node_home["Post feed<br/>[home.jsx]"]
  node_newpost["Post composer<br/>[newPost.jsx]"]
  node_profile["Profile view<br/>[profile.jsx]"]
  node_editprofile["Profile editor<br/>[editProfile.jsx]"]
  node_notifications["Notifications<br/>[notifications.jsx]"]
  node_router["App routing<br/>[_layout.jsx]"]
end

subgraph group_ui["Shared interface"]
  node_screenwrapper["Screen wrapper<br/>[ScreenWrapper.jsx]"]
  node_postcard["Post card<br/>[PostCard.jsx]"]
  node_avatar["Avatar<br/>[Avatar.jsx]"]
  node_editor["Rich text editor<br/>[RichTextEditor.jsx]"]
  node_formui["Form controls<br/>[Input.jsx]"]
  node_buttons["Buttons and loading<br/>[ButtonNew.jsx]"]
  node_headers["Headers and back<br/>[Header.jsx]"]
end

subgraph group_services["Data services"]
  node_posts["Post service<br/>[postService.js]"]
  node_users["User service<br/>[userService.js]"]
  node_images["Media service<br/>[imageService.js]"]
end

subgraph group_platform["Shared platform"]
  node_authstate["Auth state<br/>[AuthContext.js]"]
  node_supabase["Supabase client<br/>[supabase.js]"]
  node_theme["Theme<br/>[theme.js]"]
  node_common["Layout helpers<br/>[common.js]"]
end

node_user(("App user"))
node_backend[("Supabase services")]

node_user -->|"starts session"| node_authscreens
node_user -->|"views feed"| node_home
node_user -->|"creates post"| node_newpost
node_user -->|"views profile"| node_profile
node_user -->|"edits profile"| node_editprofile
node_router -->|"provides state"| node_authstate
node_router -->|"configures"| node_supabase
node_router -->|"loads user data"| node_users
node_authscreens -->|"uses auth"| node_supabase
node_home -->|"reads feed data"| node_supabase
node_home -->|"renders"| node_postcard
node_home -->|"renders"| node_avatar
node_newpost -->|"uses editor"| node_editor
node_newpost -->|"creates post"| node_posts
node_newpost -->|"uploads media"| node_images
node_newpost -->|"renders"| node_avatar
node_editprofile -->|"updates profile"| node_users
node_editprofile -->|"uploads image"| node_images
node_profile -->|"reads profile data"| node_supabase
node_profile -->|"renders"| node_avatar
node_images -->|"uploads files"| node_supabase
node_posts -->|"uploads post media"| node_images
node_posts -->|"reads and writes posts"| node_supabase
node_users -->|"reads and updates users"| node_supabase
node_supabase -->|"connects to"| node_backend
node_avatar -->|"gets image source"| node_images
node_postcard -->|"renders"| node_avatar
node_headers -.-> node_formui
node_screenwrapper -.-> node_theme
node_formui -->|"styles with"| node_theme
node_buttons -->|"styles with"| node_theme
node_headers -->|"styles with"| node_theme
node_postcard -->|"styles with"| node_theme
node_editor -->|"styles with"| node_theme
node_avatar -->|"styles with"| node_theme
node_formui -->|"uses sizing"| node_common
node_buttons -->|"uses sizing"| node_common
node_headers -->|"uses sizing"| node_common
node_postcard -->|"uses sizing"| node_common

click node_authscreens "https://github.com/natnaelsolo/social-media-app/tree/main/app"
click node_home "https://github.com/natnaelsolo/social-media-app/blob/main/app/(main)/home.jsx"
click node_newpost "https://github.com/natnaelsolo/social-media-app/blob/main/app/(main)/newPost.jsx"
click node_profile "https://github.com/natnaelsolo/social-media-app/blob/main/app/(main)/profile.jsx"
click node_editprofile "https://github.com/natnaelsolo/social-media-app/blob/main/app/(main)/editProfile.jsx"
click node_notifications "https://github.com/natnaelsolo/social-media-app/blob/main/app/(main)/notifications.jsx"
click node_router "https://github.com/natnaelsolo/social-media-app/blob/main/app/_layout.jsx"
click node_screenwrapper "https://github.com/natnaelsolo/social-media-app/blob/main/components/ScreenWrapper.jsx"
click node_postcard "https://github.com/natnaelsolo/social-media-app/blob/main/components/PostCard.jsx"
click node_avatar "https://github.com/natnaelsolo/social-media-app/blob/main/components/Avatar.jsx"
click node_editor "https://github.com/natnaelsolo/social-media-app/blob/main/components/RichTextEditor.jsx"
click node_formui "https://github.com/natnaelsolo/social-media-app/blob/main/components/Input.jsx"
click node_buttons "https://github.com/natnaelsolo/social-media-app/blob/main/components/ButtonNew.jsx"
click node_headers "https://github.com/natnaelsolo/social-media-app/blob/main/components/Header.jsx"
click node_posts "https://github.com/natnaelsolo/social-media-app/blob/main/services/postService.js"
click node_users "https://github.com/natnaelsolo/social-media-app/blob/main/services/userService.js"
click node_images "https://github.com/natnaelsolo/social-media-app/blob/main/services/imageService.js"
click node_authstate "https://github.com/natnaelsolo/social-media-app/blob/main/contexts/AuthContext.js"
click node_supabase "https://github.com/natnaelsolo/social-media-app/blob/main/lib/supabase.js"
click node_theme "https://github.com/natnaelsolo/social-media-app/blob/main/constants/theme.js"
click node_common "https://github.com/natnaelsolo/social-media-app/blob/main/helpers/common.js"

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_authscreens,node_home,node_newpost,node_profile,node_editprofile,node_notifications,node_router,node_user toneBlue
class node_screenwrapper,node_postcard,node_avatar,node_editor,node_formui,node_buttons,node_headers,node_backend toneAmber
class node_posts,node_users,node_images toneMint
class node_authstate,node_supabase,node_theme,node_common toneRose
```

## Components

### App screens

- [Welcome and auth](https://github.com/natnaelsolo/social-media-app/tree/main/app): `app`
- [Post feed](https://github.com/natnaelsolo/social-media-app/blob/main/app/(main)/home.jsx): `app/(main)/home.jsx`
- [Post composer](https://github.com/natnaelsolo/social-media-app/blob/main/app/(main)/newPost.jsx): `app/(main)/newPost.jsx`
- [Profile view](https://github.com/natnaelsolo/social-media-app/blob/main/app/(main)/profile.jsx): `app/(main)/profile.jsx`
- [Profile editor](https://github.com/natnaelsolo/social-media-app/blob/main/app/(main)/editProfile.jsx): `app/(main)/editProfile.jsx`
- [Notifications](https://github.com/natnaelsolo/social-media-app/blob/main/app/(main)/notifications.jsx): `app/(main)/notifications.jsx`
- [App routing](https://github.com/natnaelsolo/social-media-app/blob/main/app/_layout.jsx): `app/_layout.jsx`

### Shared interface

- [Screen wrapper](https://github.com/natnaelsolo/social-media-app/blob/main/components/ScreenWrapper.jsx): `components/ScreenWrapper.jsx`
- [Post card](https://github.com/natnaelsolo/social-media-app/blob/main/components/PostCard.jsx): `components/PostCard.jsx`
- [Avatar](https://github.com/natnaelsolo/social-media-app/blob/main/components/Avatar.jsx): `components/Avatar.jsx`
- [Rich text editor](https://github.com/natnaelsolo/social-media-app/blob/main/components/RichTextEditor.jsx): `components/RichTextEditor.jsx`
- [Form controls](https://github.com/natnaelsolo/social-media-app/blob/main/components/Input.jsx): `components/Input.jsx`
- [Buttons and loading](https://github.com/natnaelsolo/social-media-app/blob/main/components/ButtonNew.jsx): `components/ButtonNew.jsx`
- [Headers and back](https://github.com/natnaelsolo/social-media-app/blob/main/components/Header.jsx): `components/Header.jsx`

### Data services

- [Post service](https://github.com/natnaelsolo/social-media-app/blob/main/services/postService.js): `services/postService.js`
- [User service](https://github.com/natnaelsolo/social-media-app/blob/main/services/userService.js): `services/userService.js`
- [Media service](https://github.com/natnaelsolo/social-media-app/blob/main/services/imageService.js): `services/imageService.js`

### Shared platform

- [Auth state](https://github.com/natnaelsolo/social-media-app/blob/main/contexts/AuthContext.js): `contexts/AuthContext.js`
- [Supabase client](https://github.com/natnaelsolo/social-media-app/blob/main/lib/supabase.js): `lib/supabase.js`
- [Theme](https://github.com/natnaelsolo/social-media-app/blob/main/constants/theme.js): `constants/theme.js`
- [Layout helpers](https://github.com/natnaelsolo/social-media-app/blob/main/helpers/common.js): `helpers/common.js`

### Other components

- **App user**
- **Supabase services**

## Connections

- App user → Welcome and auth: starts session (evidence: `app/login.jsx`)
- App user → Post feed: views feed (evidence: `app/(main)/home.jsx`)
- App user → Post composer: creates post (evidence: `app/(main)/newPost.jsx`)
- App user → Profile view: views profile (evidence: `app/(main)/profile.jsx`)
- App user → Profile editor: edits profile (evidence: `app/(main)/editProfile.jsx`)
- App routing → Auth state: provides state (evidence: `app/_layout.jsx`)
- App routing → Supabase client: configures (evidence: `app/_layout.jsx`)
- App routing → User service: loads user data (evidence: `app/_layout.jsx`)
- Welcome and auth → Supabase client: uses auth (evidence: `app/login.jsx`)
- Post feed → Supabase client: reads feed data (evidence: `app/(main)/home.jsx`)
- Post feed → Post card: renders (evidence: `app/(main)/home.jsx`)
- Post feed → Avatar: renders (evidence: `app/(main)/home.jsx`)
- Post composer → Rich text editor: uses editor (evidence: `app/(main)/newPost.jsx`)
- Post composer → Post service: creates post (evidence: `app/(main)/newPost.jsx`)
- Post composer → Media service: uploads media (evidence: `app/(main)/newPost.jsx`)
- Post composer → Avatar: renders (evidence: `app/(main)/newPost.jsx`)
- Profile editor → User service: updates profile (evidence: `app/(main)/editProfile.jsx`)
- Profile editor → Media service: uploads image (evidence: `app/(main)/editProfile.jsx`)
- Profile view → Supabase client: reads profile data (evidence: `app/(main)/profile.jsx`)
- Profile view → Avatar: renders (evidence: `app/(main)/profile.jsx`)
- Media service → Supabase client: uploads files (evidence: `services/imageService.js`)
- Post service → Media service: uploads post media (evidence: `services/postService.js`)
- Post service → Supabase client: reads and writes posts (evidence: `services/postService.js`)
- User service → Supabase client: reads and updates users (evidence: `services/userService.js`)
- Supabase client → Supabase services: connects to (evidence: `lib/supabase.js`)
- Avatar → Media service: gets image source (evidence: `components/Avatar.jsx`)
- Post card → Avatar: renders (evidence: `components/PostCard.jsx`)
- Headers and back → Form controls
- Screen wrapper → Theme
- Form controls → Theme: styles with (evidence: `components/Input.jsx`)
- Buttons and loading → Theme: styles with (evidence: `components/ButtonNew.jsx`)
- Headers and back → Theme: styles with (evidence: `components/Header.jsx`)
- Post card → Theme: styles with (evidence: `components/PostCard.jsx`)
- Rich text editor → Theme: styles with (evidence: `components/RichTextEditor.jsx`)
- Avatar → Theme: styles with (evidence: `components/Avatar.jsx`)
- Form controls → Layout helpers: uses sizing (evidence: `components/Input.jsx`)
- Buttons and loading → Layout helpers: uses sizing (evidence: `components/ButtonNew.jsx`)
- Headers and back → Layout helpers: uses sizing (evidence: `components/Header.jsx`)
- Post card → Layout helpers: uses sizing (evidence: `components/PostCard.jsx`)
