# harsha-2oo8/-clubhouse architecture

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

- Interactive diagram: https://gitdiagram.com/harsha-2oo8/-clubhouse
- Repository: https://github.com/harsha-2oo8/-clubhouse

## Overview

Clubhouse is a campus social-networking product for discovering colleges, clubs, events, projects, and people, with college roles and administration. The main visible flow is a student using the routed web app; the API server exposes domain routes, including project and object-storage operations, and persists domain data in PostgreSQL. The graph preserves those capabilities and the separate upload-storage backends. Source excerpts and the SOURCE INDEX support only some runtime links; unsampled route behavior and frontend-to-API calls are not asserted.

Main entry points: [`artifacts/api-server/src/routes/index.ts`](https://github.com/harsha-2oo8/-clubhouse/blob/main/artifacts/api-server/src/routes/index.ts) (API router), [`artifacts/api-server/src/routes/storage.ts`](https://github.com/harsha-2oo8/-clubhouse/blob/main/artifacts/api-server/src/routes/storage.ts) (Storage routes), [`artifacts/clubhouse/src/App.tsx`](https://github.com/harsha-2oo8/-clubhouse/blob/main/artifacts/clubhouse/src/App.tsx) (Web application), [`artifacts/api-server/src/routes/projects.ts`](https://github.com/harsha-2oo8/-clubhouse/blob/main/artifacts/api-server/src/routes/projects.ts) (Project routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Clubhouse web app"]
  node_webapp["Web application<br/>[App.tsx]"]
  node_webpages["Product pages"]
end

subgraph group_api["API and domain"]
  node_apiapp["HTTP application<br/>[app.ts]"]
  node_router["API router<br/>[index.ts]"]
  node_clubs["Club routes<br/>[clubs.ts]"]
  node_colleges["College routes<br/>[colleges.ts]"]
  node_roles["College role routes<br/>[collegeRoles.ts]"]
  node_events["Event routes<br/>[events.ts]"]
  node_projects["Project routes<br/>[projects.ts]"]
  node_admin["Admin routes<br/>[admin.ts]"]
  node_storage_route["Storage routes<br/>[storage.ts]"]
end

subgraph group_access["Access and services"]
  node_access_policy["Access policy<br/>[policy.ts]"]
  node_college_rbac["College permissions<br/>[collegeRbac.ts]"]
  node_server_config["Server configuration<br/>[config.ts]"]
end

subgraph group_data["Data and storage"]
  node_db_schema[("Domain schema<br/>[colleges.ts]")]
  node_object_acl["Object access rules<br/>[objectAcl.ts]"]
  node_object_storage["Object storage service<br/>[objectStorage.ts]"]
  node_gcs["Google storage<br/>[gcsStorage.ts]"]
  node_supabase["Supabase storage<br/>[supabaseStorage.ts]"]
end

node_student(("Student"))

node_student -->|"uses"| node_webapp
node_webapp -->|"routes to"| node_webpages
node_webapp -.->|"API connection"| node_apiapp
node_apiapp -->|"mounts"| node_router
node_router -->|"dispatches"| node_clubs
node_router -->|"dispatches"| node_colleges
node_router -->|"dispatches"| node_roles
node_router -->|"dispatches"| node_events
node_router -->|"dispatches"| node_projects
node_router -->|"dispatches"| node_admin
node_router -->|"dispatches"| node_storage_route
node_projects -->|"checks policy"| node_access_policy
node_projects -->|"checks permissions"| node_college_rbac
node_storage_route -->|"checks admin"| node_access_policy
node_storage_route -->|"checks access"| node_object_acl
node_storage_route -->|"uses backend"| node_gcs
node_storage_route -->|"uses backend"| node_supabase
node_object_storage -->|"reads and sets"| node_object_acl
node_gcs -->|"reads config"| node_server_config
node_supabase -->|"reads config"| node_server_config
node_supabase -->|"reuses path helpers"| node_gcs

click node_webapp "https://github.com/harsha-2oo8/-clubhouse/blob/main/artifacts/clubhouse/src/App.tsx"
click node_webpages "https://github.com/harsha-2oo8/-clubhouse/tree/main/artifacts/clubhouse/src/pages"
click node_apiapp "https://github.com/harsha-2oo8/-clubhouse/blob/main/artifacts/api-server/src/app.ts"
click node_router "https://github.com/harsha-2oo8/-clubhouse/blob/main/artifacts/api-server/src/routes/index.ts"
click node_clubs "https://github.com/harsha-2oo8/-clubhouse/blob/main/artifacts/api-server/src/routes/clubs.ts"
click node_colleges "https://github.com/harsha-2oo8/-clubhouse/blob/main/artifacts/api-server/src/routes/colleges.ts"
click node_roles "https://github.com/harsha-2oo8/-clubhouse/blob/main/artifacts/api-server/src/routes/collegeRoles.ts"
click node_events "https://github.com/harsha-2oo8/-clubhouse/blob/main/artifacts/api-server/src/routes/events.ts"
click node_projects "https://github.com/harsha-2oo8/-clubhouse/blob/main/artifacts/api-server/src/routes/projects.ts"
click node_admin "https://github.com/harsha-2oo8/-clubhouse/blob/main/artifacts/api-server/src/routes/admin.ts"
click node_storage_route "https://github.com/harsha-2oo8/-clubhouse/blob/main/artifacts/api-server/src/routes/storage.ts"
click node_access_policy "https://github.com/harsha-2oo8/-clubhouse/blob/main/artifacts/api-server/src/lib/policy.ts"
click node_college_rbac "https://github.com/harsha-2oo8/-clubhouse/blob/main/artifacts/api-server/src/lib/collegeRbac.ts"
click node_server_config "https://github.com/harsha-2oo8/-clubhouse/blob/main/artifacts/api-server/src/lib/config.ts"
click node_db_schema "https://github.com/harsha-2oo8/-clubhouse/blob/main/lib/db/src/schema/colleges.ts"
click node_object_acl "https://github.com/harsha-2oo8/-clubhouse/blob/main/artifacts/api-server/src/lib/objectAcl.ts"
click node_object_storage "https://github.com/harsha-2oo8/-clubhouse/blob/main/artifacts/api-server/src/lib/objectStorage.ts"
click node_gcs "https://github.com/harsha-2oo8/-clubhouse/blob/main/artifacts/api-server/src/lib/gcsStorage.ts"
click node_supabase "https://github.com/harsha-2oo8/-clubhouse/blob/main/artifacts/api-server/src/lib/supabaseStorage.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_webapp,node_webpages toneBlue
class node_apiapp,node_router,node_clubs,node_colleges,node_roles,node_events,node_projects,node_admin,node_storage_route toneAmber
class node_access_policy,node_college_rbac,node_server_config toneMint
class node_db_schema,node_object_acl,node_object_storage,node_gcs,node_supabase toneRose
class node_student toneIndigo
```

## Components

### Clubhouse web app

- [Web application](https://github.com/harsha-2oo8/-clubhouse/blob/main/artifacts/clubhouse/src/App.tsx): `artifacts/clubhouse/src/App.tsx`
- [Product pages](https://github.com/harsha-2oo8/-clubhouse/tree/main/artifacts/clubhouse/src/pages): `artifacts/clubhouse/src/pages`

### API and domain

- [HTTP application](https://github.com/harsha-2oo8/-clubhouse/blob/main/artifacts/api-server/src/app.ts): `artifacts/api-server/src/app.ts`
- [API router](https://github.com/harsha-2oo8/-clubhouse/blob/main/artifacts/api-server/src/routes/index.ts): `artifacts/api-server/src/routes/index.ts`
- [Club routes](https://github.com/harsha-2oo8/-clubhouse/blob/main/artifacts/api-server/src/routes/clubs.ts): `artifacts/api-server/src/routes/clubs.ts`
- [College routes](https://github.com/harsha-2oo8/-clubhouse/blob/main/artifacts/api-server/src/routes/colleges.ts): `artifacts/api-server/src/routes/colleges.ts`
- [College role routes](https://github.com/harsha-2oo8/-clubhouse/blob/main/artifacts/api-server/src/routes/collegeRoles.ts): `artifacts/api-server/src/routes/collegeRoles.ts`
- [Event routes](https://github.com/harsha-2oo8/-clubhouse/blob/main/artifacts/api-server/src/routes/events.ts): `artifacts/api-server/src/routes/events.ts`
- [Project routes](https://github.com/harsha-2oo8/-clubhouse/blob/main/artifacts/api-server/src/routes/projects.ts): `artifacts/api-server/src/routes/projects.ts`
- [Admin routes](https://github.com/harsha-2oo8/-clubhouse/blob/main/artifacts/api-server/src/routes/admin.ts): `artifacts/api-server/src/routes/admin.ts`
- [Storage routes](https://github.com/harsha-2oo8/-clubhouse/blob/main/artifacts/api-server/src/routes/storage.ts): `artifacts/api-server/src/routes/storage.ts`

### Access and services

- [Access policy](https://github.com/harsha-2oo8/-clubhouse/blob/main/artifacts/api-server/src/lib/policy.ts): `artifacts/api-server/src/lib/policy.ts`
- [College permissions](https://github.com/harsha-2oo8/-clubhouse/blob/main/artifacts/api-server/src/lib/collegeRbac.ts): `artifacts/api-server/src/lib/collegeRbac.ts`
- [Server configuration](https://github.com/harsha-2oo8/-clubhouse/blob/main/artifacts/api-server/src/lib/config.ts): `artifacts/api-server/src/lib/config.ts`

### Data and storage

- [Domain schema](https://github.com/harsha-2oo8/-clubhouse/blob/main/lib/db/src/schema/colleges.ts): `lib/db/src/schema/colleges.ts`
- [Object access rules](https://github.com/harsha-2oo8/-clubhouse/blob/main/artifacts/api-server/src/lib/objectAcl.ts): `artifacts/api-server/src/lib/objectAcl.ts`
- [Object storage service](https://github.com/harsha-2oo8/-clubhouse/blob/main/artifacts/api-server/src/lib/objectStorage.ts): `artifacts/api-server/src/lib/objectStorage.ts`
- [Google storage](https://github.com/harsha-2oo8/-clubhouse/blob/main/artifacts/api-server/src/lib/gcsStorage.ts): `artifacts/api-server/src/lib/gcsStorage.ts`
- [Supabase storage](https://github.com/harsha-2oo8/-clubhouse/blob/main/artifacts/api-server/src/lib/supabaseStorage.ts): `artifacts/api-server/src/lib/supabaseStorage.ts`

### Other components

- **Student**

## Connections

- Student → Web application: uses (evidence: `artifacts/clubhouse/src/App.tsx`)
- Web application → Product pages: routes to (evidence: `artifacts/clubhouse/src/App.tsx`)
- Web application → HTTP application: API connection
- HTTP application → API router: mounts (evidence: `artifacts/api-server/src/app.ts`)
- API router → Club routes: dispatches (evidence: `artifacts/api-server/src/routes/index.ts`)
- API router → College routes: dispatches (evidence: `artifacts/api-server/src/routes/index.ts`)
- API router → College role routes: dispatches (evidence: `artifacts/api-server/src/routes/index.ts`)
- API router → Event routes: dispatches (evidence: `artifacts/api-server/src/routes/index.ts`)
- API router → Project routes: dispatches (evidence: `artifacts/api-server/src/routes/index.ts`)
- API router → Admin routes: dispatches (evidence: `artifacts/api-server/src/routes/index.ts`)
- API router → Storage routes: dispatches (evidence: `artifacts/api-server/src/routes/index.ts`)
- Project routes → Access policy: checks policy (evidence: `artifacts/api-server/src/routes/projects.ts`)
- Project routes → College permissions: checks permissions (evidence: `artifacts/api-server/src/routes/projects.ts`)
- Storage routes → Access policy: checks admin (evidence: `artifacts/api-server/src/routes/storage.ts`)
- Storage routes → Object access rules: checks access (evidence: `artifacts/api-server/src/routes/storage.ts`)
- Storage routes → Google storage: uses backend (evidence: `artifacts/api-server/src/routes/storage.ts`)
- Storage routes → Supabase storage: uses backend (evidence: `artifacts/api-server/src/routes/storage.ts`)
- Object storage service → Object access rules: reads and sets (evidence: `artifacts/api-server/src/lib/objectStorage.ts`)
- Google storage → Server configuration: reads config (evidence: `artifacts/api-server/src/lib/gcsStorage.ts`)
- Supabase storage → Server configuration: reads config (evidence: `artifacts/api-server/src/lib/supabaseStorage.ts`)
- Supabase storage → Google storage: reuses path helpers (evidence: `artifacts/api-server/src/lib/supabaseStorage.ts`)
