# hsoj-dev/saypi-blog architecture

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

- Interactive diagram: https://gitdiagram.com/hsoj-dev/saypi-blog
- Repository: https://github.com/hsoj-dev/saypi-blog

## Overview

Saypi-Blog is a blogging and social-networking platform for Pisay scholars. Its user-facing journey begins with school-email signup or login, then leads into campus-oriented spaces for sharing posts, discovering activity and people, and managing profiles and settings. The tree also shows dedicated modules for friends, privacy, notifications and upvotes. Sampled auth code verifies signup inputs, rate-limits attempts, delegates authentication to Supabase and creates a database user; the detailed wiring of the unsampled social and content modules cannot be confirmed from the available excerpts.

Main entry points: [`src/routes/(app)/+layout.svelte`](https://github.com/hsoj-dev/saypi-blog/blob/main/src/routes/(app)/%2Blayout.svelte) (App shell), [`src/lib/remote/auth.remote.ts`](https://github.com/hsoj-dev/saypi-blog/blob/main/src/lib/remote/auth.remote.ts) (Authentication actions), [`src/routes/(auth)/auth/signup/+page.svelte`](https://github.com/hsoj-dev/saypi-blog/blob/main/src/routes/(auth)/auth/signup/%2Bpage.svelte) (Signup and login), [`src/routes/(auth)/auth/confirm/+page.server.ts`](https://github.com/hsoj-dev/saypi-blog/blob/main/src/routes/(auth)/auth/confirm/%2Bpage.server.ts) (Email confirmation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_public["Public pages<br/>[+layout.svelte]"]
  node_app["App shell<br/>[+layout.svelte]"]
end

subgraph group_identity["Identity and access"]
  node_signup["Signup and login<br/>[+page.svelte]"]
  node_auth["Authentication actions<br/>[auth.remote.ts]"]
  node_confirmation["Email confirmation<br/>[+page.server.ts]"]
  node_settings["Account settings<br/>[+page.svelte]"]
  node_user_ops["User operations<br/>[users.remote.ts]"]
  node_user_creation["User creation<br/>[userCreation.ts]"]
end

subgraph group_social["Social features"]
  node_board["Campus board<br/>[+page.svelte]"]
  node_commons["Commons<br/>[+page.svelte]"]
  node_tutors["Tutor discovery<br/>[+page.svelte]"]
  node_profile["Profile pages<br/>[+page.svelte]"]
  node_profile_edit["Profile editing<br/>[+page.svelte]"]
  node_blog_editor["Blog editor<br/>[BlogEditor.svelte]"]
  node_blog_renderer["Blog renderer"]
  node_profiles["Profile operations<br/>[profiles.remote.ts]"]
  node_friends["Friend operations<br/>[friends.remote.ts]"]
  node_upvotes["Upvote operations<br/>[upvotes.remote.ts]"]
  node_notifications["Notifications"]
  node_privacy["Privacy controls"]
end

subgraph group_data["Data and services"]
  node_rate_limit["Rate limiting<br/>[rateLimit.ts]"]
  node_db[("Application database<br/>[db.ts]")]
  node_db_schema["Database schema<br/>[schema.ts]"]
end

node_scholar(("Pisay scholar"))
node_supabase{{"Supabase auth"}}

node_scholar -->|"visits"| node_public
node_scholar -->|"registers or logs in"| node_signup
node_signup -->|"submits credentials"| node_auth
node_auth -->|"checks attempts"| node_rate_limit
node_auth -->|"authenticates"| node_supabase
node_auth -->|"creates account"| node_user_creation
node_auth -->|"redirects to verification"| node_confirmation
node_confirmation -->|"verifies token"| node_supabase
node_scholar -->|"enters authenticated app"| node_app
node_app -->|"navigates to"| node_board
node_app -->|"navigates to"| node_commons
node_app -->|"navigates to"| node_tutors
node_app -->|"opens profile"| node_profile
node_app -->|"opens settings"| node_settings
node_profile -->|"edits profile"| node_profile_edit
node_auth -->|"creates user record"| node_db

click node_public "https://github.com/hsoj-dev/saypi-blog/blob/main/src/routes/(public)/%2Blayout.svelte"
click node_signup "https://github.com/hsoj-dev/saypi-blog/blob/main/src/routes/(auth)/auth/signup/%2Bpage.svelte"
click node_auth "https://github.com/hsoj-dev/saypi-blog/blob/main/src/lib/remote/auth.remote.ts"
click node_confirmation "https://github.com/hsoj-dev/saypi-blog/blob/main/src/routes/(auth)/auth/confirm/%2Bpage.server.ts"
click node_app "https://github.com/hsoj-dev/saypi-blog/blob/main/src/routes/(app)/%2Blayout.svelte"
click node_board "https://github.com/hsoj-dev/saypi-blog/blob/main/src/routes/(app)/board/%2Bpage.svelte"
click node_commons "https://github.com/hsoj-dev/saypi-blog/blob/main/src/routes/(app)/commons/%2Bpage.svelte"
click node_tutors "https://github.com/hsoj-dev/saypi-blog/blob/main/src/routes/(app)/tutors/%2Bpage.svelte"
click node_profile "https://github.com/hsoj-dev/saypi-blog/blob/main/src/routes/(app)/%5Bhandle%5D/%2Bpage.svelte"
click node_profile_edit "https://github.com/hsoj-dev/saypi-blog/blob/main/src/routes/(app)/%5Bhandle%5D/edit/%2Bpage.svelte"
click node_settings "https://github.com/hsoj-dev/saypi-blog/blob/main/src/routes/(app)/settings/%2Bpage.svelte"
click node_blog_editor "https://github.com/hsoj-dev/saypi-blog/blob/main/src/lib/components/BlogEditor.svelte"
click node_blog_renderer "https://github.com/hsoj-dev/saypi-blog/blob/main/src/lib/components/BlogRenderer.svelte"
click node_profiles "https://github.com/hsoj-dev/saypi-blog/blob/main/src/lib/remote/profiles.remote.ts"
click node_friends "https://github.com/hsoj-dev/saypi-blog/blob/main/src/lib/remote/friends.remote.ts"
click node_upvotes "https://github.com/hsoj-dev/saypi-blog/blob/main/src/lib/remote/upvotes.remote.ts"
click node_notifications "https://github.com/hsoj-dev/saypi-blog/blob/main/src/lib/remote/notifications.remote.ts"
click node_privacy "https://github.com/hsoj-dev/saypi-blog/blob/main/src/lib/remote/infoPrivacy.remote.ts"
click node_user_ops "https://github.com/hsoj-dev/saypi-blog/blob/main/src/lib/remote/users.remote.ts"
click node_rate_limit "https://github.com/hsoj-dev/saypi-blog/blob/main/src/lib/server/services/rateLimit.ts"
click node_user_creation "https://github.com/hsoj-dev/saypi-blog/blob/main/src/lib/helpers/userCreation.ts"
click node_db "https://github.com/hsoj-dev/saypi-blog/blob/main/src/lib/server/db/db.ts"
click node_db_schema "https://github.com/hsoj-dev/saypi-blog/blob/main/src/lib/server/db/schema.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_public,node_app toneBlue
class node_signup,node_auth,node_confirmation,node_settings,node_user_ops,node_user_creation toneAmber
class node_board,node_commons,node_tutors,node_profile,node_profile_edit,node_blog_editor,node_blog_renderer,node_profiles,node_friends,node_upvotes,node_notifications,node_privacy toneMint
class node_rate_limit,node_db,node_db_schema toneRose
class node_scholar,node_supabase toneIndigo
```

## Components

### User experience

- [Public pages](https://github.com/hsoj-dev/saypi-blog/blob/main/src/routes/(public)/%2Blayout.svelte): `src/routes/(public)/+layout.svelte`
- [App shell](https://github.com/hsoj-dev/saypi-blog/blob/main/src/routes/(app)/%2Blayout.svelte): `src/routes/(app)/+layout.svelte`

### Identity and access

- [Signup and login](https://github.com/hsoj-dev/saypi-blog/blob/main/src/routes/(auth)/auth/signup/%2Bpage.svelte): `src/routes/(auth)/auth/signup/+page.svelte`
- [Authentication actions](https://github.com/hsoj-dev/saypi-blog/blob/main/src/lib/remote/auth.remote.ts): `src/lib/remote/auth.remote.ts`
- [Email confirmation](https://github.com/hsoj-dev/saypi-blog/blob/main/src/routes/(auth)/auth/confirm/%2Bpage.server.ts): `src/routes/(auth)/auth/confirm/+page.server.ts`
- [Account settings](https://github.com/hsoj-dev/saypi-blog/blob/main/src/routes/(app)/settings/%2Bpage.svelte): `src/routes/(app)/settings/+page.svelte`
- [User operations](https://github.com/hsoj-dev/saypi-blog/blob/main/src/lib/remote/users.remote.ts): `src/lib/remote/users.remote.ts`
- [User creation](https://github.com/hsoj-dev/saypi-blog/blob/main/src/lib/helpers/userCreation.ts): `src/lib/helpers/userCreation.ts`

### Social features

- [Campus board](https://github.com/hsoj-dev/saypi-blog/blob/main/src/routes/(app)/board/%2Bpage.svelte): `src/routes/(app)/board/+page.svelte`
- [Commons](https://github.com/hsoj-dev/saypi-blog/blob/main/src/routes/(app)/commons/%2Bpage.svelte): `src/routes/(app)/commons/+page.svelte`
- [Tutor discovery](https://github.com/hsoj-dev/saypi-blog/blob/main/src/routes/(app)/tutors/%2Bpage.svelte): `src/routes/(app)/tutors/+page.svelte`
- [Profile pages](https://github.com/hsoj-dev/saypi-blog/blob/main/src/routes/(app)/%5Bhandle%5D/%2Bpage.svelte): `src/routes/(app)/[handle]/+page.svelte`
- [Profile editing](https://github.com/hsoj-dev/saypi-blog/blob/main/src/routes/(app)/%5Bhandle%5D/edit/%2Bpage.svelte): `src/routes/(app)/[handle]/edit/+page.svelte`
- [Blog editor](https://github.com/hsoj-dev/saypi-blog/blob/main/src/lib/components/BlogEditor.svelte): `src/lib/components/BlogEditor.svelte`
- [Blog renderer](https://github.com/hsoj-dev/saypi-blog/blob/main/src/lib/components/BlogRenderer.svelte): `src/lib/components/BlogRenderer.svelte`
- [Profile operations](https://github.com/hsoj-dev/saypi-blog/blob/main/src/lib/remote/profiles.remote.ts): `src/lib/remote/profiles.remote.ts`
- [Friend operations](https://github.com/hsoj-dev/saypi-blog/blob/main/src/lib/remote/friends.remote.ts): `src/lib/remote/friends.remote.ts`
- [Upvote operations](https://github.com/hsoj-dev/saypi-blog/blob/main/src/lib/remote/upvotes.remote.ts): `src/lib/remote/upvotes.remote.ts`
- [Notifications](https://github.com/hsoj-dev/saypi-blog/blob/main/src/lib/remote/notifications.remote.ts): `src/lib/remote/notifications.remote.ts`
- [Privacy controls](https://github.com/hsoj-dev/saypi-blog/blob/main/src/lib/remote/infoPrivacy.remote.ts): `src/lib/remote/infoPrivacy.remote.ts`

### Data and services

- [Rate limiting](https://github.com/hsoj-dev/saypi-blog/blob/main/src/lib/server/services/rateLimit.ts): `src/lib/server/services/rateLimit.ts`
- [Application database](https://github.com/hsoj-dev/saypi-blog/blob/main/src/lib/server/db/db.ts): `src/lib/server/db/db.ts`
- [Database schema](https://github.com/hsoj-dev/saypi-blog/blob/main/src/lib/server/db/schema.ts): `src/lib/server/db/schema.ts`

### Other components

- **Pisay scholar**
- **Supabase auth**

## Connections

- Pisay scholar → Public pages: visits
- Pisay scholar → Signup and login: registers or logs in
- Signup and login → Authentication actions: submits credentials
- Authentication actions → Rate limiting: checks attempts
- Authentication actions → Supabase auth: authenticates
- Authentication actions → User creation: creates account
- Authentication actions → Email confirmation: redirects to verification
- Email confirmation → Supabase auth: verifies token
- Pisay scholar → App shell: enters authenticated app
- App shell → Campus board: navigates to
- App shell → Commons: navigates to
- App shell → Tutor discovery: navigates to
- App shell → Profile pages: opens profile
- App shell → Account settings: opens settings
- Profile pages → Profile editing: edits profile
- Authentication actions → Application database: creates user record
