# pranay-44/thane-explorer-hub architecture

> Architecture diagram of the GitHub repository pranay-44/thane-explorer-hub, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pranay-44/thane-explorer-hub
- Repository: https://github.com/pranay-44/thane-explorer-hub

## Overview

Thane Explorer Hub is a student-curated guide to discovering places and community posts around Thane. Visitors browse featured and explore listings, open post details, and can sign in to create or manage contributions; admin routes provide a separate management stage. The graph also shows routing, the post-data layer, and Supabase services. README documents map/list exploration, but the sampled files do not establish its exact implementation or data flow, so those links are omitted.

Main entry points: [`src/integrations/supabase/client.ts`](https://github.com/pranay-44/thane-explorer-hub/blob/main/src/integrations/supabase/client.ts) (Supabase client), [`src/lib/posts.functions.ts`](https://github.com/pranay-44/thane-explorer-hub/blob/main/src/lib/posts.functions.ts) (Post data functions), [`src/routes/index.tsx`](https://github.com/pranay-44/thane-explorer-hub/blob/main/src/routes/index.tsx) (Home and featured posts), [`src/routes/auth.tsx`](https://github.com/pranay-44/thane-explorer-hub/blob/main/src/routes/auth.tsx) (Sign in)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Discovery experience"]
  node_home["Home and featured posts<br/>[index.tsx]"]
  node_explore["Explore listings<br/>[explore.tsx]"]
  node_postdetail["Post details<br/>[posts.$id.tsx]"]
  node_postcard["Post card<br/>[PostCard.tsx]"]
end

subgraph group_identity["Identity and access"]
  node_authpage["Sign in<br/>[auth.tsx]"]
  node_authguard["Protected route guard<br/>[route.tsx]"]
  node_authstate["Session and profile<br/>[use-auth.ts]"]
  node_supaauth{{"Supabase Auth"}}
end

subgraph group_publishing["Community publishing"]
  node_createpost["Create post<br/>[create.tsx]"]
  node_editpost["Edit post<br/>[posts.$id.edit.tsx]"]
  node_postform["Post form and image validation<br/>[PostForm.tsx]"]
  node_dashboard["Student dashboard<br/>[dashboard.tsx]"]
  node_admin["Admin management<br/>[admin.tsx]"]
  node_postfunctions["Post data functions<br/>[posts.functions.ts]"]
  node_adminfunctions["Admin data functions<br/>[admin.functions.ts]"]
  node_imageapi["Public post-image endpoint<br/>[$.ts]"]
end

subgraph group_platform["Application platform"]
  node_router["Router and query context<br/>[router.tsx]"]
  node_supaclient["Supabase client<br/>[client.ts]"]
end

node_visitor(("Visitor or student"))
node_database[("Supabase database")]

node_visitor -->|"opens"| node_home
node_visitor -->|"browses"| node_explore
node_visitor -->|"opens"| node_postdetail
node_visitor -->|"signs in"| node_authpage
node_visitor -->|"creates"| node_createpost
node_visitor -->|"manages posts"| node_dashboard
node_home -->|"loads featured"| node_postfunctions
node_home -->|"renders"| node_postcard
node_postdetail -->|"loads post"| node_postfunctions
node_authpage -->|"uses"| node_supaclient
node_supaclient -->|"authenticates"| node_supaauth
node_authpage -->|"reads session"| node_authstate
node_authguard -->|"checks user"| node_supaclient
node_authguard -->|"redirects unauthenticated"| node_authpage
node_authstate -->|"reads session and profile"| node_supaclient
node_authstate -->|"queries profile and roles"| node_database
node_createpost -->|"renders"| node_postform
node_editpost -->|"renders"| node_postform
node_postform -->|"submits post"| node_postfunctions
node_dashboard -->|"loads and manages"| node_postfunctions
node_admin -->|"requests administration"| node_adminfunctions
node_postfunctions -->|"uses"| node_supaclient
node_adminfunctions -->|"uses"| node_supaclient
node_supaclient -->|"queries and mutates"| node_database
node_router -->|"routes"| node_home
node_router -->|"routes"| node_explore
node_router -->|"routes"| node_authguard
node_imageapi -->|"uses"| node_supaclient

click node_home "https://github.com/pranay-44/thane-explorer-hub/blob/main/src/routes/index.tsx"
click node_explore "https://github.com/pranay-44/thane-explorer-hub/blob/main/src/routes/explore.tsx"
click node_postdetail "https://github.com/pranay-44/thane-explorer-hub/blob/main/src/routes/posts.%24id.tsx"
click node_postcard "https://github.com/pranay-44/thane-explorer-hub/blob/main/src/components/PostCard.tsx"
click node_authpage "https://github.com/pranay-44/thane-explorer-hub/blob/main/src/routes/auth.tsx"
click node_authguard "https://github.com/pranay-44/thane-explorer-hub/blob/main/src/routes/_authenticated/route.tsx"
click node_authstate "https://github.com/pranay-44/thane-explorer-hub/blob/main/src/lib/use-auth.ts"
click node_createpost "https://github.com/pranay-44/thane-explorer-hub/blob/main/src/routes/_authenticated/create.tsx"
click node_editpost "https://github.com/pranay-44/thane-explorer-hub/blob/main/src/routes/_authenticated/posts.%24id.edit.tsx"
click node_postform "https://github.com/pranay-44/thane-explorer-hub/blob/main/src/components/PostForm.tsx"
click node_dashboard "https://github.com/pranay-44/thane-explorer-hub/blob/main/src/routes/_authenticated/dashboard.tsx"
click node_admin "https://github.com/pranay-44/thane-explorer-hub/blob/main/src/routes/_authenticated/admin.tsx"
click node_postfunctions "https://github.com/pranay-44/thane-explorer-hub/blob/main/src/lib/posts.functions.ts"
click node_adminfunctions "https://github.com/pranay-44/thane-explorer-hub/blob/main/src/lib/admin.functions.ts"
click node_imageapi "https://github.com/pranay-44/thane-explorer-hub/blob/main/src/routes/api/public/post-image/%24.ts"
click node_router "https://github.com/pranay-44/thane-explorer-hub/blob/main/src/router.tsx"
click node_supaclient "https://github.com/pranay-44/thane-explorer-hub/blob/main/src/integrations/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_home,node_explore,node_postdetail,node_postcard toneBlue
class node_authpage,node_authguard,node_authstate,node_supaauth,node_database toneAmber
class node_createpost,node_editpost,node_postform,node_dashboard,node_admin,node_postfunctions,node_adminfunctions,node_imageapi toneMint
class node_router,node_supaclient toneRose
class node_visitor toneIndigo
```

## Components

### Discovery experience

- [Home and featured posts](https://github.com/pranay-44/thane-explorer-hub/blob/main/src/routes/index.tsx): `src/routes/index.tsx`
- [Explore listings](https://github.com/pranay-44/thane-explorer-hub/blob/main/src/routes/explore.tsx): `src/routes/explore.tsx`
- [Post details](https://github.com/pranay-44/thane-explorer-hub/blob/main/src/routes/posts.%24id.tsx): `src/routes/posts.$id.tsx`
- [Post card](https://github.com/pranay-44/thane-explorer-hub/blob/main/src/components/PostCard.tsx): `src/components/PostCard.tsx`

### Identity and access

- [Sign in](https://github.com/pranay-44/thane-explorer-hub/blob/main/src/routes/auth.tsx): `src/routes/auth.tsx`
- [Protected route guard](https://github.com/pranay-44/thane-explorer-hub/blob/main/src/routes/_authenticated/route.tsx): `src/routes/_authenticated/route.tsx`
- [Session and profile](https://github.com/pranay-44/thane-explorer-hub/blob/main/src/lib/use-auth.ts): `src/lib/use-auth.ts`
- **Supabase Auth**

### Community publishing

- [Create post](https://github.com/pranay-44/thane-explorer-hub/blob/main/src/routes/_authenticated/create.tsx): `src/routes/_authenticated/create.tsx`
- [Edit post](https://github.com/pranay-44/thane-explorer-hub/blob/main/src/routes/_authenticated/posts.%24id.edit.tsx): `src/routes/_authenticated/posts.$id.edit.tsx`
- [Post form and image validation](https://github.com/pranay-44/thane-explorer-hub/blob/main/src/components/PostForm.tsx): `src/components/PostForm.tsx`
- [Student dashboard](https://github.com/pranay-44/thane-explorer-hub/blob/main/src/routes/_authenticated/dashboard.tsx): `src/routes/_authenticated/dashboard.tsx`
- [Admin management](https://github.com/pranay-44/thane-explorer-hub/blob/main/src/routes/_authenticated/admin.tsx): `src/routes/_authenticated/admin.tsx`
- [Post data functions](https://github.com/pranay-44/thane-explorer-hub/blob/main/src/lib/posts.functions.ts): `src/lib/posts.functions.ts`
- [Admin data functions](https://github.com/pranay-44/thane-explorer-hub/blob/main/src/lib/admin.functions.ts): `src/lib/admin.functions.ts`
- [Public post-image endpoint](https://github.com/pranay-44/thane-explorer-hub/blob/main/src/routes/api/public/post-image/%24.ts): `src/routes/api/public/post-image/$.ts`

### Application platform

- [Router and query context](https://github.com/pranay-44/thane-explorer-hub/blob/main/src/router.tsx): `src/router.tsx`
- [Supabase client](https://github.com/pranay-44/thane-explorer-hub/blob/main/src/integrations/supabase/client.ts): `src/integrations/supabase/client.ts`

### Other components

- **Visitor or student**
- **Supabase database**

## Connections

- Visitor or student → Home and featured posts: opens
- Visitor or student → Explore listings: browses
- Visitor or student → Post details: opens
- Visitor or student → Sign in: signs in
- Visitor or student → Create post: creates
- Visitor or student → Student dashboard: manages posts
- Home and featured posts → Post data functions: loads featured
- Home and featured posts → Post card: renders
- Post details → Post data functions: loads post
- Sign in → Supabase client: uses
- Supabase client → Supabase Auth: authenticates
- Sign in → Session and profile: reads session
- Protected route guard → Supabase client: checks user
- Protected route guard → Sign in: redirects unauthenticated
- Session and profile → Supabase client: reads session and profile
- Session and profile → Supabase database: queries profile and roles
- Create post → Post form and image validation: renders
- Edit post → Post form and image validation: renders
- Post form and image validation → Post data functions: submits post
- Student dashboard → Post data functions: loads and manages
- Admin management → Admin data functions: requests administration
- Post data functions → Supabase client: uses
- Admin data functions → Supabase client: uses
- Supabase client → Supabase database: queries and mutates
- Router and query context → Home and featured posts: routes
- Router and query context → Explore listings: routes
- Router and query context → Protected route guard: routes
- Public post-image endpoint → Supabase client: uses
