# mohit-0411/sahityik architecture

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

- Interactive diagram: https://gitdiagram.com/mohit-0411/sahityik
- Repository: https://github.com/mohit-0411/sahityik

## Overview

Sahityik is a Next.js literary-events and community site backed by Sanity, with event and speaker browsing, event registration, a forum, contact submissions, and an embedded CMS. Visitors browse content and can register, contact organizers, or participate in discussions; administrators manage content through Sanity Studio. The graph groups routes by domain and shows the sampled Sanity read/write and Redis forum interactions. Some subsystems are represented from the file tree and README; their internal wiring was not sampled.

Main entry points: [`sanity/lib/client.ts`](https://github.com/mohit-0411/sahityik/blob/master/sanity/lib/client.ts) (Sanity read client), [`app/events/[slug]/page.tsx`](https://github.com/mohit-0411/sahityik/blob/master/app/events/%5Bslug%5D/page.tsx) (Event details), [`sanity/lib/writeClient.ts`](https://github.com/mohit-0411/sahityik/blob/master/sanity/lib/writeClient.ts) (Sanity write client), [`app/events/page.tsx`](https://github.com/mohit-0411/sahityik/blob/master/app/events/page.tsx) (Event listings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Site experience"]
  node_layout["Shared layout<br/>[layout.tsx]"]
  node_home["Home page<br/>[page.tsx]"]
  node_contact["Contact page<br/>[page.tsx]"]
  node_contactform["Contact form<br/>[ContactForm.tsx]"]
  node_contactapi["Contact endpoint<br/>[route.ts]"]
end

subgraph group_events["Events and speakers"]
  node_eventlist["Event listings<br/>[page.tsx]"]
  node_eventdetail["Event details<br/>[page.tsx]"]
  node_registration["Registration flow<br/>[page.tsx]"]
  node_registerform["Registration form<br/>[RegisterForm.tsx]"]
  node_registeraction["Registration action<br/>[register.ts]"]
  node_adminregistrations["Registration admin<br/>[page.tsx]"]
  node_speakerlist["Speaker listings<br/>[page.tsx]"]
  node_speakerdetail["Speaker profile<br/>[page.tsx]"]
  node_speakercard["Speaker card<br/>[SpeakerCard.tsx]"]
end

subgraph group_community["Community interactions"]
  node_forumlist["Forum listings<br/>[page.tsx]"]
  node_forumdetail["Forum discussion<br/>[page.tsx]"]
  node_newpost["New post page<br/>[page.tsx]"]
  node_postaction["Create post action<br/>[createForumPost.ts]"]
  node_forumaction["Forum actions<br/>[forum.ts]"]
  node_forumui["Forum interactions"]
  node_postsapi["Posts endpoint<br/>[route.ts]"]
end

subgraph group_content["Content and services"]
  node_ratelimit["Rate limiting<br/>[ratelimit.ts]"]
  node_testlimit["Limit test endpoint<br/>[route.ts]"]
  node_eventapi["Events endpoint<br/>[route.ts]"]
  node_sanityclient["Sanity read client<br/>[client.ts]"]
  node_writeclient["Sanity write client<br/>[writeClient.ts]"]
  node_sanityenv["Sanity configuration<br/>[env.ts]"]
  node_sanityimages["Image URL builder<br/>[image.ts]"]
  node_sanityschemas["Content schemas"]
  node_studio["Sanity Studio<br/>[page.tsx]"]
  node_redis[("Redis<br/>[redis.ts]")]
  node_sanity[("Sanity CMS")]
end

node_visitor(("Visitor"))

node_visitor -->|"browses"| node_home
node_visitor -->|"browses"| node_eventlist
node_visitor -->|"browses"| node_speakerlist
node_visitor -.->|"opens"| node_contact
node_contact -->|"renders"| node_contactform
node_contactform -.->|"submits"| node_contactapi
node_visitor -.->|"registers"| node_registration
node_eventlist -->|"links to"| node_eventdetail
node_eventdetail -.->|"links to"| node_registration
node_registration -->|"renders"| node_registerform
node_registerform -->|"calls"| node_registeraction
node_registeraction -->|"writes via"| node_writeclient
node_adminregistrations -->|"reads via"| node_sanityclient
node_speakerlist -->|"links to"| node_speakerdetail
node_eventdetail -->|"renders"| node_speakercard
node_home -->|"fetches content"| node_sanityclient
node_eventlist -->|"fetches events"| node_sanityclient
node_speakerlist -->|"fetches speakers"| node_sanityclient
node_eventdetail -->|"builds image URLs"| node_sanityimages
node_speakercard -->|"builds image URLs"| node_sanityimages
node_forumlist -->|"fetches posts"| node_sanityclient
node_newpost -->|"submits to"| node_postaction
node_postaction -->|"writes via"| node_writeclient
node_forumdetail -->|"loads interactions"| node_forumaction
node_forumdetail -->|"renders"| node_forumui
node_forumui -->|"calls"| node_forumaction
node_forumaction -->|"reads and writes"| node_redis
node_postsapi -->|"checks limit"| node_ratelimit
node_testlimit -->|"checks limit"| node_ratelimit
node_sanityclient -->|"uses settings"| node_sanityenv
node_writeclient -->|"uses settings"| node_sanityenv
node_sanityimages -->|"uses settings"| node_sanityenv
node_sanityclient -.->|"queries"| node_sanity
node_writeclient -.->|"mutates"| node_sanity
node_studio -->|"provides CMS"| node_sanity
node_sanity -.->|"uses schemas"| node_sanityschemas
node_layout -.->|"serves experience"| node_visitor

click node_layout "https://github.com/mohit-0411/sahityik/blob/master/app/layout.tsx"
click node_home "https://github.com/mohit-0411/sahityik/blob/master/app/page.tsx"
click node_contact "https://github.com/mohit-0411/sahityik/blob/master/app/contact/page.tsx"
click node_contactform "https://github.com/mohit-0411/sahityik/blob/master/components/ContactForm.tsx"
click node_contactapi "https://github.com/mohit-0411/sahityik/blob/master/app/api/contact/route.ts"
click node_eventlist "https://github.com/mohit-0411/sahityik/blob/master/app/events/page.tsx"
click node_eventdetail "https://github.com/mohit-0411/sahityik/blob/master/app/events/%5Bslug%5D/page.tsx"
click node_registration "https://github.com/mohit-0411/sahityik/blob/master/app/events/%5Bslug%5D/register/page.tsx"
click node_registerform "https://github.com/mohit-0411/sahityik/blob/master/components/RegisterForm.tsx"
click node_registeraction "https://github.com/mohit-0411/sahityik/blob/master/app/actions/register.ts"
click node_adminregistrations "https://github.com/mohit-0411/sahityik/blob/master/app/admin/registrations/page.tsx"
click node_speakerlist "https://github.com/mohit-0411/sahityik/blob/master/app/speakers/page.tsx"
click node_speakerdetail "https://github.com/mohit-0411/sahityik/blob/master/app/speakers/%5Bslug%5D/page.tsx"
click node_speakercard "https://github.com/mohit-0411/sahityik/blob/master/components/SpeakerCard.tsx"
click node_forumlist "https://github.com/mohit-0411/sahityik/blob/master/app/forum/page.tsx"
click node_forumdetail "https://github.com/mohit-0411/sahityik/blob/master/app/forum/%5Bslug%5D/page.tsx"
click node_newpost "https://github.com/mohit-0411/sahityik/blob/master/app/forum/new/page.tsx"
click node_postaction "https://github.com/mohit-0411/sahityik/blob/master/app/actions/createForumPost.ts"
click node_forumaction "https://github.com/mohit-0411/sahityik/blob/master/app/actions/forum.ts"
click node_forumui "https://github.com/mohit-0411/sahityik/blob/master/components/ForumInteractivity.tsx"
click node_postsapi "https://github.com/mohit-0411/sahityik/blob/master/app/api/posts/route.ts"
click node_ratelimit "https://github.com/mohit-0411/sahityik/blob/master/lib/ratelimit.ts"
click node_testlimit "https://github.com/mohit-0411/sahityik/blob/master/app/api/test-limit/route.ts"
click node_eventapi "https://github.com/mohit-0411/sahityik/blob/master/app/api/events/route.ts"
click node_sanityclient "https://github.com/mohit-0411/sahityik/blob/master/sanity/lib/client.ts"
click node_writeclient "https://github.com/mohit-0411/sahityik/blob/master/sanity/lib/writeClient.ts"
click node_sanityenv "https://github.com/mohit-0411/sahityik/blob/master/sanity/env.ts"
click node_sanityimages "https://github.com/mohit-0411/sahityik/blob/master/sanity/lib/image.ts"
click node_sanityschemas "https://github.com/mohit-0411/sahityik/tree/master/sanity/schemaTypes"
click node_studio "https://github.com/mohit-0411/sahityik/blob/master/app/studio/%5B%5B...tool%5D%5D/page.tsx"
click node_redis "https://github.com/mohit-0411/sahityik/blob/master/lib/redis.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_layout,node_home,node_contact,node_contactform,node_contactapi toneBlue
class node_eventlist,node_eventdetail,node_registration,node_registerform,node_registeraction,node_adminregistrations,node_speakerlist,node_speakerdetail,node_speakercard toneAmber
class node_forumlist,node_forumdetail,node_newpost,node_postaction,node_forumaction,node_forumui,node_postsapi toneMint
class node_ratelimit,node_testlimit,node_eventapi,node_sanityclient,node_writeclient,node_sanityenv,node_sanityimages,node_sanityschemas,node_studio,node_redis,node_sanity toneRose
class node_visitor toneIndigo
```

## Components

### Site experience

- [Shared layout](https://github.com/mohit-0411/sahityik/blob/master/app/layout.tsx): `app/layout.tsx`
- [Home page](https://github.com/mohit-0411/sahityik/blob/master/app/page.tsx): `app/page.tsx`
- [Contact page](https://github.com/mohit-0411/sahityik/blob/master/app/contact/page.tsx): `app/contact/page.tsx`
- [Contact form](https://github.com/mohit-0411/sahityik/blob/master/components/ContactForm.tsx): `components/ContactForm.tsx`
- [Contact endpoint](https://github.com/mohit-0411/sahityik/blob/master/app/api/contact/route.ts): `app/api/contact/route.ts`

### Events and speakers

- [Event listings](https://github.com/mohit-0411/sahityik/blob/master/app/events/page.tsx): `app/events/page.tsx`
- [Event details](https://github.com/mohit-0411/sahityik/blob/master/app/events/%5Bslug%5D/page.tsx): `app/events/[slug]/page.tsx`
- [Registration flow](https://github.com/mohit-0411/sahityik/blob/master/app/events/%5Bslug%5D/register/page.tsx): `app/events/[slug]/register/page.tsx`
- [Registration form](https://github.com/mohit-0411/sahityik/blob/master/components/RegisterForm.tsx): `components/RegisterForm.tsx`
- [Registration action](https://github.com/mohit-0411/sahityik/blob/master/app/actions/register.ts): `app/actions/register.ts`
- [Registration admin](https://github.com/mohit-0411/sahityik/blob/master/app/admin/registrations/page.tsx): `app/admin/registrations/page.tsx`
- [Speaker listings](https://github.com/mohit-0411/sahityik/blob/master/app/speakers/page.tsx): `app/speakers/page.tsx`
- [Speaker profile](https://github.com/mohit-0411/sahityik/blob/master/app/speakers/%5Bslug%5D/page.tsx): `app/speakers/[slug]/page.tsx`
- [Speaker card](https://github.com/mohit-0411/sahityik/blob/master/components/SpeakerCard.tsx): `components/SpeakerCard.tsx`

### Community interactions

- [Forum listings](https://github.com/mohit-0411/sahityik/blob/master/app/forum/page.tsx): `app/forum/page.tsx`
- [Forum discussion](https://github.com/mohit-0411/sahityik/blob/master/app/forum/%5Bslug%5D/page.tsx): `app/forum/[slug]/page.tsx`
- [New post page](https://github.com/mohit-0411/sahityik/blob/master/app/forum/new/page.tsx): `app/forum/new/page.tsx`
- [Create post action](https://github.com/mohit-0411/sahityik/blob/master/app/actions/createForumPost.ts): `app/actions/createForumPost.ts`
- [Forum actions](https://github.com/mohit-0411/sahityik/blob/master/app/actions/forum.ts): `app/actions/forum.ts`
- [Forum interactions](https://github.com/mohit-0411/sahityik/blob/master/components/ForumInteractivity.tsx): `components/ForumInteractivity.tsx`
- [Posts endpoint](https://github.com/mohit-0411/sahityik/blob/master/app/api/posts/route.ts): `app/api/posts/route.ts`

### Content and services

- [Rate limiting](https://github.com/mohit-0411/sahityik/blob/master/lib/ratelimit.ts): `lib/ratelimit.ts`
- [Limit test endpoint](https://github.com/mohit-0411/sahityik/blob/master/app/api/test-limit/route.ts): `app/api/test-limit/route.ts`
- [Events endpoint](https://github.com/mohit-0411/sahityik/blob/master/app/api/events/route.ts): `app/api/events/route.ts`
- [Sanity read client](https://github.com/mohit-0411/sahityik/blob/master/sanity/lib/client.ts): `sanity/lib/client.ts`
- [Sanity write client](https://github.com/mohit-0411/sahityik/blob/master/sanity/lib/writeClient.ts): `sanity/lib/writeClient.ts`
- [Sanity configuration](https://github.com/mohit-0411/sahityik/blob/master/sanity/env.ts): `sanity/env.ts`
- [Image URL builder](https://github.com/mohit-0411/sahityik/blob/master/sanity/lib/image.ts): `sanity/lib/image.ts`
- [Content schemas](https://github.com/mohit-0411/sahityik/tree/master/sanity/schemaTypes): `sanity/schemaTypes`
- [Sanity Studio](https://github.com/mohit-0411/sahityik/blob/master/app/studio/%5B%5B...tool%5D%5D/page.tsx): `app/studio/[[...tool]]/page.tsx`
- [Redis](https://github.com/mohit-0411/sahityik/blob/master/lib/redis.ts): `lib/redis.ts`
- **Sanity CMS**

### Other components

- **Visitor**

## Connections

- Visitor → Home page: browses (evidence: `app/page.tsx`)
- Visitor → Event listings: browses (evidence: `app/events/page.tsx`)
- Visitor → Speaker listings: browses (evidence: `app/speakers/page.tsx`)
- Visitor → Contact page: opens
- Contact page → Contact form: renders (evidence: `app/contact/page.tsx`)
- Contact form → Contact endpoint: submits
- Visitor → Registration flow: registers
- Event listings → Event details: links to (evidence: `app/events/page.tsx`)
- Event details → Registration flow: links to
- Registration flow → Registration form: renders (evidence: `app/events/[slug]/register/page.tsx`)
- Registration form → Registration action: calls (evidence: `components/RegisterForm.tsx`)
- Registration action → Sanity write client: writes via (evidence: `app/actions/register.ts`)
- Registration admin → Sanity read client: reads via (evidence: `app/admin/registrations/page.tsx`)
- Speaker listings → Speaker profile: links to (evidence: `app/speakers/page.tsx`)
- Event details → Speaker card: renders (evidence: `app/events/[slug]/page.tsx`)
- Home page → Sanity read client: fetches content (evidence: `app/page.tsx`)
- Event listings → Sanity read client: fetches events (evidence: `app/events/page.tsx`)
- Speaker listings → Sanity read client: fetches speakers (evidence: `app/speakers/page.tsx`)
- Event details → Image URL builder: builds image URLs (evidence: `app/events/[slug]/page.tsx`)
- Speaker card → Image URL builder: builds image URLs (evidence: `components/SpeakerCard.tsx`)
- Forum listings → Sanity read client: fetches posts (evidence: `app/forum/page.tsx`)
- New post page → Create post action: submits to (evidence: `app/forum/new/page.tsx`)
- Create post action → Sanity write client: writes via (evidence: `app/actions/createForumPost.ts`)
- Forum discussion → Forum actions: loads interactions (evidence: `app/forum/[slug]/page.tsx`)
- Forum discussion → Forum interactions: renders (evidence: `app/forum/[slug]/page.tsx`)
- Forum interactions → Forum actions: calls (evidence: `components/ForumInteractivity.tsx`)
- Forum actions → Redis: reads and writes (evidence: `app/actions/forum.ts`)
- Posts endpoint → Rate limiting: checks limit (evidence: `app/api/posts/route.ts`)
- Limit test endpoint → Rate limiting: checks limit (evidence: `app/api/test-limit/route.ts`)
- Sanity read client → Sanity configuration: uses settings (evidence: `sanity/lib/client.ts`)
- Sanity write client → Sanity configuration: uses settings (evidence: `sanity/lib/writeClient.ts`)
- Image URL builder → Sanity configuration: uses settings (evidence: `sanity/lib/image.ts`)
- Sanity read client → Sanity CMS: queries
- Sanity write client → Sanity CMS: mutates
- Sanity Studio → Sanity CMS: provides CMS (evidence: `README.md`)
- Sanity CMS → Content schemas: uses schemas
- Shared layout → Visitor: serves experience
