# yogank09/memorysaver architecture

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

- Interactive diagram: https://gitdiagram.com/yogank09/memorysaver
- Repository: https://github.com/yogank09/memorysaver

## Overview

MemorySaver is a React photo-storytelling and social-memory application backed by Appwrite. The main workflow restores or creates a session, enters the application shell, and lets users discover, publish, and revisit memories. Separate branches cover profiles and follows, interactions and notifications, highlights, and account settings. Some page implementations and the shell were not sampled; those capabilities and links are included only where the README or source index supports them.

Main entry points: [`src/Components/Layout/AppShell.jsx`](https://github.com/yogank09/memorysaver/blob/main/src/Components/Layout/AppShell.jsx) (App shell), [`src/App.jsx`](https://github.com/yogank09/memorysaver/blob/main/src/App.jsx) (App bootstrap), [`src/pages/Profile.jsx`](https://github.com/yogank09/memorysaver/blob/main/src/pages/Profile.jsx) (My profile), [`src/appwrite/auth.js`](https://github.com/yogank09/memorysaver/blob/main/src/appwrite/auth.js) (Authentication service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_app["App bootstrap<br/>[App.jsx]"]
  node_shell["App shell<br/>[AppShell.jsx]"]
  node_authstate["Auth state<br/>[authSlice.js]"]
  node_authpages["Authentication pages<br/>[PhoneLogin.jsx]"]
end

subgraph group_memories["Memory sharing"]
  node_feed["Memory feed<br/>[Home.jsx]"]
  node_explore["Explore memories<br/>[Explore.jsx]"]
  node_publish["Publish memory<br/>[PostForm.jsx]"]
  node_post["Memory detail<br/>[Post.jsx]"]
  node_bookmarks["Saved memories<br/>[Bookmarks.jsx]"]
end

subgraph group_social["Social features"]
  node_profile["My profile<br/>[Profile.jsx]"]
  node_userprofile["User profiles<br/>[UserProfile.jsx]"]
  node_discover["People discovery<br/>[Users.jsx]"]
  node_follow["Follow system<br/>[followService.js]"]
  node_notifications["Notifications<br/>[Notifications.jsx]"]
  node_messages["Messaging<br/>[Messages.jsx]"]
  node_interactions["Post interactions"]
  node_highlights["Story highlights<br/>[useHighlights.js]"]
end

subgraph group_services["Identity and services"]
  node_authservice["Authentication service<br/>[auth.js]"]
  node_appwrite["Appwrite data and media<br/>[config.js]"]
  node_client["Appwrite client<br/>[client.js]"]
  node_storage[("Browser storage<br/>[safeStorage.js]")]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_app
node_app -->|"restores session"| node_authservice
node_app -->|"dispatches auth"| node_authstate
node_app -->|"renders"| node_shell
node_authservice -->|"uses"| node_client
node_client -->|"restores token"| node_storage
node_authstate -->|"persists guest state"| node_storage
node_authpages -.->|"authenticates"| node_authservice
node_shell -.->|"routes to"| node_feed
node_shell -.->|"routes to"| node_explore
node_shell -.->|"routes to"| node_publish
node_shell -.->|"routes to"| node_profile
node_shell -.->|"routes to"| node_userprofile
node_shell -.->|"routes to"| node_discover
node_shell -.->|"routes to"| node_notifications
node_shell -.->|"routes to"| node_messages
node_shell -.->|"routes to"| node_post
node_shell -.->|"routes to"| node_bookmarks
node_publish -->|"publishes media"| node_appwrite
node_profile -->|"loads memories"| node_appwrite
node_profile -->|"manages highlights"| node_highlights
node_profile -->|"reads interactions"| node_interactions
node_userprofile -->|"uses follow system"| node_follow
node_discover -.->|"supports following"| node_follow
node_notifications -.->|"shows follow alerts"| node_follow
node_post -.->|"supports engagement"| node_interactions
node_bookmarks -.->|"reads bookmarks"| node_interactions
node_appwrite -.->|"uses"| node_client

click node_app "https://github.com/yogank09/memorysaver/blob/main/src/App.jsx"
click node_shell "https://github.com/yogank09/memorysaver/blob/main/src/Components/Layout/AppShell.jsx"
click node_authstate "https://github.com/yogank09/memorysaver/blob/main/src/store/authSlice.js"
click node_profile "https://github.com/yogank09/memorysaver/blob/main/src/pages/Profile.jsx"
click node_userprofile "https://github.com/yogank09/memorysaver/blob/main/src/pages/UserProfile.jsx"
click node_discover "https://github.com/yogank09/memorysaver/blob/main/src/pages/Users.jsx"
click node_follow "https://github.com/yogank09/memorysaver/blob/main/src/utils/followService.js"
click node_notifications "https://github.com/yogank09/memorysaver/blob/main/src/pages/Notifications.jsx"
click node_messages "https://github.com/yogank09/memorysaver/blob/main/src/pages/Messages.jsx"
click node_interactions "https://github.com/yogank09/memorysaver/blob/main/src/context/InteractionContext.jsx"
click node_highlights "https://github.com/yogank09/memorysaver/blob/main/src/hooks/useHighlights.js"
click node_feed "https://github.com/yogank09/memorysaver/blob/main/src/pages/Home.jsx"
click node_explore "https://github.com/yogank09/memorysaver/blob/main/src/pages/Explore.jsx"
click node_publish "https://github.com/yogank09/memorysaver/blob/main/src/Components/PostForm/PostForm.jsx"
click node_post "https://github.com/yogank09/memorysaver/blob/main/src/pages/Post.jsx"
click node_bookmarks "https://github.com/yogank09/memorysaver/blob/main/src/pages/Bookmarks.jsx"
click node_authpages "https://github.com/yogank09/memorysaver/blob/main/src/pages/PhoneLogin.jsx"
click node_authservice "https://github.com/yogank09/memorysaver/blob/main/src/appwrite/auth.js"
click node_appwrite "https://github.com/yogank09/memorysaver/blob/main/src/appwrite/config.js"
click node_client "https://github.com/yogank09/memorysaver/blob/main/src/appwrite/client.js"
click node_storage "https://github.com/yogank09/memorysaver/blob/main/src/utils/safeStorage.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_app,node_shell,node_authstate,node_authpages toneBlue
class node_feed,node_explore,node_publish,node_post,node_bookmarks toneAmber
class node_profile,node_userprofile,node_discover,node_follow,node_notifications,node_messages,node_interactions,node_highlights toneMint
class node_authservice,node_appwrite,node_client,node_storage toneRose
class node_visitor toneIndigo
```

## Components

### Application

- [App bootstrap](https://github.com/yogank09/memorysaver/blob/main/src/App.jsx): `src/App.jsx`
- [App shell](https://github.com/yogank09/memorysaver/blob/main/src/Components/Layout/AppShell.jsx): `src/Components/Layout/AppShell.jsx`
- [Auth state](https://github.com/yogank09/memorysaver/blob/main/src/store/authSlice.js): `src/store/authSlice.js`
- [Authentication pages](https://github.com/yogank09/memorysaver/blob/main/src/pages/PhoneLogin.jsx): `src/pages/PhoneLogin.jsx`

### Memory sharing

- [Memory feed](https://github.com/yogank09/memorysaver/blob/main/src/pages/Home.jsx): `src/pages/Home.jsx`
- [Explore memories](https://github.com/yogank09/memorysaver/blob/main/src/pages/Explore.jsx): `src/pages/Explore.jsx`
- [Publish memory](https://github.com/yogank09/memorysaver/blob/main/src/Components/PostForm/PostForm.jsx): `src/Components/PostForm/PostForm.jsx`
- [Memory detail](https://github.com/yogank09/memorysaver/blob/main/src/pages/Post.jsx): `src/pages/Post.jsx`
- [Saved memories](https://github.com/yogank09/memorysaver/blob/main/src/pages/Bookmarks.jsx): `src/pages/Bookmarks.jsx`

### Social features

- [My profile](https://github.com/yogank09/memorysaver/blob/main/src/pages/Profile.jsx): `src/pages/Profile.jsx`
- [User profiles](https://github.com/yogank09/memorysaver/blob/main/src/pages/UserProfile.jsx): `src/pages/UserProfile.jsx`
- [People discovery](https://github.com/yogank09/memorysaver/blob/main/src/pages/Users.jsx): `src/pages/Users.jsx`
- [Follow system](https://github.com/yogank09/memorysaver/blob/main/src/utils/followService.js): `src/utils/followService.js`
- [Notifications](https://github.com/yogank09/memorysaver/blob/main/src/pages/Notifications.jsx): `src/pages/Notifications.jsx`
- [Messaging](https://github.com/yogank09/memorysaver/blob/main/src/pages/Messages.jsx): `src/pages/Messages.jsx`
- [Post interactions](https://github.com/yogank09/memorysaver/blob/main/src/context/InteractionContext.jsx): `src/context/InteractionContext.jsx`
- [Story highlights](https://github.com/yogank09/memorysaver/blob/main/src/hooks/useHighlights.js): `src/hooks/useHighlights.js`

### Identity and services

- [Authentication service](https://github.com/yogank09/memorysaver/blob/main/src/appwrite/auth.js): `src/appwrite/auth.js`
- [Appwrite data and media](https://github.com/yogank09/memorysaver/blob/main/src/appwrite/config.js): `src/appwrite/config.js`
- [Appwrite client](https://github.com/yogank09/memorysaver/blob/main/src/appwrite/client.js): `src/appwrite/client.js`
- [Browser storage](https://github.com/yogank09/memorysaver/blob/main/src/utils/safeStorage.js): `src/utils/safeStorage.js`

### Other components

- **Visitor**

## Connections

- Visitor → App bootstrap: opens (evidence: `src/App.jsx`)
- App bootstrap → Authentication service: restores session (evidence: `src/App.jsx`)
- App bootstrap → Auth state: dispatches auth (evidence: `src/App.jsx`)
- App bootstrap → App shell: renders (evidence: `src/App.jsx`)
- Authentication service → Appwrite client: uses (evidence: `src/appwrite/auth.js`)
- Appwrite client → Browser storage: restores token (evidence: `src/appwrite/client.js`)
- Auth state → Browser storage: persists guest state (evidence: `src/store/authSlice.js`)
- Authentication pages → Authentication service: authenticates
- App shell → Memory feed: routes to
- App shell → Explore memories: routes to
- App shell → Publish memory: routes to
- App shell → My profile: routes to
- App shell → User profiles: routes to
- App shell → People discovery: routes to
- App shell → Notifications: routes to
- App shell → Messaging: routes to
- App shell → Memory detail: routes to
- App shell → Saved memories: routes to
- Publish memory → Appwrite data and media: publishes media (evidence: `src/Components/PostForm/PostForm.jsx`)
- My profile → Appwrite data and media: loads memories (evidence: `src/pages/Profile.jsx`)
- My profile → Story highlights: manages highlights (evidence: `src/pages/Profile.jsx`)
- My profile → Post interactions: reads interactions (evidence: `src/pages/Profile.jsx`)
- User profiles → Follow system: uses follow system (evidence: `src/pages/UserProfile.jsx`)
- People discovery → Follow system: supports following
- Notifications → Follow system: shows follow alerts
- Memory detail → Post interactions: supports engagement
- Saved memories → Post interactions: reads bookmarks
- Appwrite data and media → Appwrite client: uses
