# saikrishn181/student-voice architecture

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

- Interactive diagram: https://gitdiagram.com/saikrishn181/student-voice
- Repository: https://github.com/saikrishn181/student-voice

## Overview

Krantind is a student community and support platform. Its main workflow is account creation and profile setup, followed by browsing a personalized campus feed, publishing posts with optional media, and engaging through support, comments, follows, and messaging. Separate areas provide search, notifications, profile/settings management, and administration of verification and moderation. The source index shows the principal page-to-store and store-to-Supabase links; several feature-page implementations were not sampled, so their internal call relationships are omitted.

Main entry points: [`lib/store/usePostStore.ts`](https://github.com/saikrishn181/student-voice/blob/main/lib/store/usePostStore.ts) (Posts and comments), [`lib/store/useAuthStore.ts`](https://github.com/saikrishn181/student-voice/blob/main/lib/store/useAuthStore.ts) (Authentication state), [`app/feed/page.tsx`](https://github.com/saikrishn181/student-voice/blob/main/app/feed/page.tsx) (Campus feed), [`lib/store/useUserStore.ts`](https://github.com/saikrishn181/student-voice/blob/main/lib/store/useUserStore.ts) (Profile cache)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Community experience"]
  node_feed["Campus feed<br/>[page.tsx]"]
  node_publisher["Post composer<br/>[page.tsx]"]
  node_postdetail["Post detail<br/>[page.tsx]"]
  node_search["Search and explore<br/>[page.tsx]"]
end

subgraph group_identity["Accounts and profiles"]
  node_authpages["Login and signup<br/>[page.tsx]"]
  node_profilepages["Profiles<br/>[page.tsx]"]
  node_accountsettings["Account settings<br/>[page.tsx]"]
  node_authstore["Authentication state<br/>[useAuthStore.ts]"]
  node_userstore["Profile cache<br/>[useUserStore.ts]"]
end

subgraph group_engagement["Engagement features"]
  node_chatpages["Direct and group chat<br/>[page.tsx]"]
  node_notifications["Notifications<br/>[page.tsx]"]
  node_verification["Admin verification<br/>[page.tsx]"]
  node_postfeatures["Post interactions<br/>[PostCard.tsx]"]
  node_mediaupload["Media uploader<br/>[MediaUploader.tsx]"]
  node_poststore["Posts and comments<br/>[usePostStore.ts]"]
  node_chatstore["Chat state<br/>[useChatStore.ts]"]
  node_notifystore["Notification state"]
  node_searchstore["Search state<br/>[useSearchStore.ts]"]
end

subgraph group_platform["Data and moderation"]
  node_recommendation["Feed ranking<br/>[recommendation.ts]"]
  node_moderation["Content moderation<br/>[moderation.ts]"]
  node_mapper["Row mapping<br/>[mappers.ts]"]
  node_storagehelper["Media storage helper<br/>[storage.ts]"]
  node_supabaseclient["Supabase client<br/>[client.ts]"]
end

node_student(("Student"))
node_supabase[("Supabase data services")]
node_mediaobjectstore[("Supabase media bucket")]

node_student -->|"creates account"| node_authpages
node_student -->|"browses posts"| node_feed
node_student -->|"creates post"| node_publisher
node_feed -->|"loads posts"| node_poststore
node_feed -->|"reads session"| node_authstore
node_feed -->|"loads profiles"| node_userstore
node_feed -->|"ranks feed"| node_recommendation
node_feed -->|"renders cards"| node_postfeatures
node_publisher -->|"submits post"| node_poststore
node_publisher -->|"selects media"| node_mediaupload
node_publisher -->|"uploads media"| node_storagehelper
node_publisher -->|"checks content"| node_moderation
node_search -->|"uses search state"| node_searchstore
node_search -->|"loads results"| node_poststore
node_search -->|"reads session"| node_authstore
node_authpages -->|"authenticates"| node_authstore
node_profilepages -->|"reads session"| node_authstore
node_profilepages -->|"loads posts"| node_poststore
node_accountsettings -->|"manages account"| node_authstore
node_accountsettings -->|"manages posts"| node_poststore
node_accountsettings -->|"manages alerts"| node_notifystore
node_chatpages -->|"loads conversations"| node_chatstore
node_chatpages -->|"loads profiles"| node_userstore
node_notifications -.->|"loads alerts"| node_notifystore
node_verification -->|"checks session"| node_authstore
node_verification -->|"reviews users"| node_moderation
node_poststore -->|"queries data"| node_supabaseclient
node_poststore -->|"checks violations"| node_moderation
node_poststore -->|"uses media storage"| node_storagehelper
node_poststore -->|"seeds profiles"| node_userstore
node_authstore -->|"uses auth"| node_supabaseclient
node_authstore -->|"updates profile cache"| node_userstore
node_chatstore -->|"queries chat"| node_supabaseclient
node_userstore -->|"queries profiles"| node_supabaseclient
node_userstore -->|"maps profile rows"| node_mapper
node_supabaseclient -->|"connects to"| node_supabase
node_storagehelper -->|"creates client"| node_supabaseclient
node_storagehelper -->|"uploads objects"| node_mediaobjectstore

click node_feed "https://github.com/saikrishn181/student-voice/blob/main/app/feed/page.tsx"
click node_publisher "https://github.com/saikrishn181/student-voice/blob/main/app/post/create/page.tsx"
click node_postdetail "https://github.com/saikrishn181/student-voice/blob/main/app/post/%5Bid%5D/page.tsx"
click node_search "https://github.com/saikrishn181/student-voice/blob/main/app/search/page.tsx"
click node_authpages "https://github.com/saikrishn181/student-voice/blob/main/app/signup/page.tsx"
click node_profilepages "https://github.com/saikrishn181/student-voice/blob/main/app/profile/%5Bid%5D/page.tsx"
click node_accountsettings "https://github.com/saikrishn181/student-voice/blob/main/app/settings/page.tsx"
click node_chatpages "https://github.com/saikrishn181/student-voice/blob/main/app/messages/%5Bid%5D/page.tsx"
click node_notifications "https://github.com/saikrishn181/student-voice/blob/main/app/notifications/page.tsx"
click node_verification "https://github.com/saikrishn181/student-voice/blob/main/app/admin/verifications/page.tsx"
click node_postfeatures "https://github.com/saikrishn181/student-voice/blob/main/components/feature/PostCard.tsx"
click node_mediaupload "https://github.com/saikrishn181/student-voice/blob/main/components/feature/MediaUploader.tsx"
click node_authstore "https://github.com/saikrishn181/student-voice/blob/main/lib/store/useAuthStore.ts"
click node_userstore "https://github.com/saikrishn181/student-voice/blob/main/lib/store/useUserStore.ts"
click node_poststore "https://github.com/saikrishn181/student-voice/blob/main/lib/store/usePostStore.ts"
click node_chatstore "https://github.com/saikrishn181/student-voice/blob/main/lib/store/useChatStore.ts"
click node_notifystore "https://github.com/saikrishn181/student-voice/blob/main/lib/store/useNotificationStore.ts"
click node_searchstore "https://github.com/saikrishn181/student-voice/blob/main/lib/store/useSearchStore.ts"
click node_recommendation "https://github.com/saikrishn181/student-voice/blob/main/lib/recommendation.ts"
click node_moderation "https://github.com/saikrishn181/student-voice/blob/main/lib/moderation.ts"
click node_mapper "https://github.com/saikrishn181/student-voice/blob/main/lib/mappers.ts"
click node_storagehelper "https://github.com/saikrishn181/student-voice/blob/main/lib/supabase/storage.ts"
click node_supabaseclient "https://github.com/saikrishn181/student-voice/blob/main/lib/supabase/client.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_feed,node_publisher,node_postdetail,node_search toneBlue
class node_authpages,node_profilepages,node_accountsettings,node_authstore,node_userstore,node_supabase,node_mediaobjectstore toneAmber
class node_chatpages,node_notifications,node_verification,node_postfeatures,node_mediaupload,node_poststore,node_chatstore,node_notifystore,node_searchstore toneMint
class node_recommendation,node_moderation,node_mapper,node_storagehelper,node_supabaseclient toneRose
class node_student toneIndigo
```

## Components

### Community experience

- [Campus feed](https://github.com/saikrishn181/student-voice/blob/main/app/feed/page.tsx): `app/feed/page.tsx`
- [Post composer](https://github.com/saikrishn181/student-voice/blob/main/app/post/create/page.tsx): `app/post/create/page.tsx`
- [Post detail](https://github.com/saikrishn181/student-voice/blob/main/app/post/%5Bid%5D/page.tsx): `app/post/[id]/page.tsx`
- [Search and explore](https://github.com/saikrishn181/student-voice/blob/main/app/search/page.tsx): `app/search/page.tsx`

### Accounts and profiles

- [Login and signup](https://github.com/saikrishn181/student-voice/blob/main/app/signup/page.tsx): `app/signup/page.tsx`
- [Profiles](https://github.com/saikrishn181/student-voice/blob/main/app/profile/%5Bid%5D/page.tsx): `app/profile/[id]/page.tsx`
- [Account settings](https://github.com/saikrishn181/student-voice/blob/main/app/settings/page.tsx): `app/settings/page.tsx`
- [Authentication state](https://github.com/saikrishn181/student-voice/blob/main/lib/store/useAuthStore.ts): `lib/store/useAuthStore.ts`
- [Profile cache](https://github.com/saikrishn181/student-voice/blob/main/lib/store/useUserStore.ts): `lib/store/useUserStore.ts`

### Engagement features

- [Direct and group chat](https://github.com/saikrishn181/student-voice/blob/main/app/messages/%5Bid%5D/page.tsx): `app/messages/[id]/page.tsx`
- [Notifications](https://github.com/saikrishn181/student-voice/blob/main/app/notifications/page.tsx): `app/notifications/page.tsx`
- [Admin verification](https://github.com/saikrishn181/student-voice/blob/main/app/admin/verifications/page.tsx): `app/admin/verifications/page.tsx`
- [Post interactions](https://github.com/saikrishn181/student-voice/blob/main/components/feature/PostCard.tsx): `components/feature/PostCard.tsx`
- [Media uploader](https://github.com/saikrishn181/student-voice/blob/main/components/feature/MediaUploader.tsx): `components/feature/MediaUploader.tsx`
- [Posts and comments](https://github.com/saikrishn181/student-voice/blob/main/lib/store/usePostStore.ts): `lib/store/usePostStore.ts`
- [Chat state](https://github.com/saikrishn181/student-voice/blob/main/lib/store/useChatStore.ts): `lib/store/useChatStore.ts`
- [Notification state](https://github.com/saikrishn181/student-voice/blob/main/lib/store/useNotificationStore.ts): `lib/store/useNotificationStore.ts`
- [Search state](https://github.com/saikrishn181/student-voice/blob/main/lib/store/useSearchStore.ts): `lib/store/useSearchStore.ts`

### Data and moderation

- [Feed ranking](https://github.com/saikrishn181/student-voice/blob/main/lib/recommendation.ts): `lib/recommendation.ts`
- [Content moderation](https://github.com/saikrishn181/student-voice/blob/main/lib/moderation.ts): `lib/moderation.ts`
- [Row mapping](https://github.com/saikrishn181/student-voice/blob/main/lib/mappers.ts): `lib/mappers.ts`
- [Media storage helper](https://github.com/saikrishn181/student-voice/blob/main/lib/supabase/storage.ts): `lib/supabase/storage.ts`
- [Supabase client](https://github.com/saikrishn181/student-voice/blob/main/lib/supabase/client.ts): `lib/supabase/client.ts`

### Other components

- **Student**
- **Supabase data services**
- **Supabase media bucket**

## Connections

- Student → Login and signup: creates account (evidence: `app/signup/page.tsx`)
- Student → Campus feed: browses posts (evidence: `app/feed/page.tsx`)
- Student → Post composer: creates post (evidence: `app/post/create/page.tsx`)
- Campus feed → Posts and comments: loads posts (evidence: `app/feed/page.tsx`)
- Campus feed → Authentication state: reads session (evidence: `app/feed/page.tsx`)
- Campus feed → Profile cache: loads profiles (evidence: `app/feed/page.tsx`)
- Campus feed → Feed ranking: ranks feed (evidence: `app/feed/page.tsx`)
- Campus feed → Post interactions: renders cards (evidence: `app/feed/page.tsx`)
- Post composer → Posts and comments: submits post (evidence: `app/post/create/page.tsx`)
- Post composer → Media uploader: selects media (evidence: `app/post/create/page.tsx`)
- Post composer → Media storage helper: uploads media (evidence: `app/post/create/page.tsx`)
- Post composer → Content moderation: checks content (evidence: `app/post/create/page.tsx`)
- Search and explore → Search state: uses search state (evidence: `app/search/page.tsx`)
- Search and explore → Posts and comments: loads results (evidence: `app/search/page.tsx`)
- Search and explore → Authentication state: reads session (evidence: `app/search/page.tsx`)
- Login and signup → Authentication state: authenticates (evidence: `app/signup/page.tsx`)
- Profiles → Authentication state: reads session
- Profiles → Posts and comments: loads posts
- Account settings → Authentication state: manages account (evidence: `app/settings/page.tsx`)
- Account settings → Posts and comments: manages posts (evidence: `app/settings/page.tsx`)
- Account settings → Notification state: manages alerts (evidence: `app/settings/page.tsx`)
- Direct and group chat → Chat state: loads conversations (evidence: `app/messages/[id]/page.tsx`)
- Direct and group chat → Profile cache: loads profiles (evidence: `app/messages/[id]/page.tsx`)
- Notifications → Notification state: loads alerts
- Admin verification → Authentication state: checks session (evidence: `app/admin/verifications/page.tsx`)
- Admin verification → Content moderation: reviews users (evidence: `app/admin/verifications/page.tsx`)
- Posts and comments → Supabase client: queries data (evidence: `lib/store/usePostStore.ts`)
- Posts and comments → Content moderation: checks violations (evidence: `lib/store/usePostStore.ts`)
- Posts and comments → Media storage helper: uses media storage (evidence: `lib/store/usePostStore.ts`)
- Posts and comments → Profile cache: seeds profiles (evidence: `lib/store/usePostStore.ts`)
- Authentication state → Supabase client: uses auth (evidence: `lib/store/useAuthStore.ts`)
- Authentication state → Profile cache: updates profile cache (evidence: `lib/store/useAuthStore.ts`)
- Chat state → Supabase client: queries chat (evidence: `lib/store/useChatStore.ts`)
- Profile cache → Supabase client: queries profiles (evidence: `lib/store/useUserStore.ts`)
- Profile cache → Row mapping: maps profile rows (evidence: `lib/store/useUserStore.ts`)
- Supabase client → Supabase data services: connects to (evidence: `lib/supabase/client.ts`)
- Media storage helper → Supabase client: creates client (evidence: `lib/supabase/storage.ts`)
- Media storage helper → Supabase media bucket: uploads objects (evidence: `lib/supabase/storage.ts`)
