# iordjn/club-website architecture

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

- Interactive diagram: https://gitdiagram.com/iordjn/club-website
- Repository: https://github.com/iordjn/club-website

## Overview

CS Club Website is a monorepo for public club engagement and officer administration. Visitors browse events, announcements, and officer profiles and can RSVP; officers sign in to manage those records and track registrations. Both Next.js apps use a Django REST API backed by domain models. The graph distinguishes public presentation, authenticated management, API/business logic, and persisted data. Some connections are documented capabilities or inferred HTTP boundaries rather than sampled call sites, and are marked dashed where evidence is unavailable.

Main entry points: [`apps/officers-hub/lib/api.ts`](https://github.com/iordjn/club-website/blob/main/apps/officers-hub/lib/api.ts) (Authenticated API setup), [`apps/officers-hub/hooks`](https://github.com/iordjn/club-website/tree/main/apps/officers-hub/hooks) (Management hooks), [`apps/officers-hub/components/views`](https://github.com/iordjn/club-website/tree/main/apps/officers-hub/components/views) (Management views), [`apps/officers-hub/components/events/EventPreviewWrapper.tsx`](https://github.com/iordjn/club-website/blob/main/apps/officers-hub/components/events/EventPreviewWrapper.tsx) (Event preview)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public website"]
  node_public_pages["Public pages"]
  node_public_data["Public data hooks"]
  node_public_api["Public API adapter<br/>[api.ts]"]
end

subgraph group_hub["Officers hub"]
  node_hub_entry["Dashboard entry<br/>[page.tsx]"]
  node_hub_views["Management views"]
  node_hub_editors["Content editors"]
  node_hub_events["Event preview"]
  node_hub_hooks["Management hooks"]
  node_hub_adapters["UI adapters<br/>[adapters.ts]"]
  node_hub_api["Authenticated API setup<br/>[api.ts]"]
end

subgraph group_api["API and domain"]
  node_api_routes["API routes"]
  node_api_views["API views"]
  node_api_auth["Clerk verification<br/>[clerk_auth.py]"]
  node_api_services["Business services"]
  node_domain_models["Domain models"]
end

subgraph group_shared["Shared client and UI"]
  node_api_client["API client"]
  node_shared_ui["Shared UI components"]
  node_contracts["API contracts"]
  node_domain_types["Domain types"]
end

node_visitor(("Site visitor"))
node_officer(("Club officer"))
node_clerk{{"Clerk authentication"}}
node_database[("PostgreSQL database")]

node_visitor -->|"browses"| node_public_pages
node_public_pages -.->|"loads content"| node_public_data
node_public_data -.->|"requests data"| node_public_api
node_public_api -.->|"calls REST API"| node_api_routes
node_officer -->|"manages club"| node_hub_entry
node_hub_entry -->|"selects views"| node_hub_views
node_hub_views -.->|"opens editors"| node_hub_editors
node_hub_views -->|"opens preview"| node_hub_events
node_hub_editors -.->|"edits records"| node_hub_hooks
node_hub_hooks -->|"calls client"| node_hub_api
node_hub_hooks -->|"converts requests"| node_hub_adapters
node_hub_events -->|"loads event"| node_hub_hooks
node_hub_events -->|"renders preview"| node_shared_ui
node_hub_api -->|"gets token"| node_clerk
node_hub_api -->|"creates client"| node_api_client
node_api_client -.->|"calls REST API"| node_api_routes
node_api_routes -.->|"routes requests"| node_api_views
node_api_views -.->|"verifies officers"| node_api_auth
node_api_views -.->|"delegates logic"| node_api_services
node_api_services -->|"reads and writes"| node_domain_models
node_domain_models -.->|"persists records"| node_database
node_hub_adapters -->|"maps types"| node_domain_types
node_hub_api -->|"exports request types"| node_contracts

click node_public_pages "https://github.com/iordjn/club-website/tree/main/apps/public-website/app"
click node_public_data "https://github.com/iordjn/club-website/tree/main/apps/public-website/hooks"
click node_public_api "https://github.com/iordjn/club-website/blob/main/apps/public-website/lib/api.ts"
click node_hub_entry "https://github.com/iordjn/club-website/blob/main/apps/officers-hub/app/page.tsx"
click node_hub_views "https://github.com/iordjn/club-website/tree/main/apps/officers-hub/components/views"
click node_hub_editors "https://github.com/iordjn/club-website/tree/main/apps/officers-hub/components/editors"
click node_hub_events "https://github.com/iordjn/club-website/blob/main/apps/officers-hub/components/events/EventPreviewWrapper.tsx"
click node_hub_hooks "https://github.com/iordjn/club-website/tree/main/apps/officers-hub/hooks"
click node_hub_adapters "https://github.com/iordjn/club-website/blob/main/apps/officers-hub/lib/adapters.ts"
click node_hub_api "https://github.com/iordjn/club-website/blob/main/apps/officers-hub/lib/api.ts"
click node_api_client "https://github.com/iordjn/club-website/tree/main/packages/api-client/src"
click node_shared_ui "https://github.com/iordjn/club-website/tree/main/packages/ui/src/components"
click node_api_routes "https://github.com/iordjn/club-website/tree/main/apps/api/api/urls"
click node_api_views "https://github.com/iordjn/club-website/tree/main/apps/api/api/views"
click node_api_auth "https://github.com/iordjn/club-website/blob/main/apps/api/api/middleware/clerk_auth.py"
click node_api_services "https://github.com/iordjn/club-website/tree/main/apps/api/api/services"
click node_domain_models "https://github.com/iordjn/club-website/tree/main/apps/api/api/models"
click node_contracts "https://github.com/iordjn/club-website/tree/main/packages/api-contracts/src"
click node_domain_types "https://github.com/iordjn/club-website/tree/main/packages/domain-types/src"

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_pages,node_public_data,node_public_api toneBlue
class node_hub_entry,node_hub_views,node_hub_editors,node_hub_events,node_hub_hooks,node_hub_adapters,node_hub_api,node_database toneAmber
class node_api_routes,node_api_views,node_api_auth,node_api_services,node_domain_models toneMint
class node_api_client,node_shared_ui,node_contracts,node_domain_types toneRose
class node_visitor,node_officer,node_clerk toneIndigo
```

## Components

### Public website

- [Public pages](https://github.com/iordjn/club-website/tree/main/apps/public-website/app): `apps/public-website/app`
- [Public data hooks](https://github.com/iordjn/club-website/tree/main/apps/public-website/hooks): `apps/public-website/hooks`
- [Public API adapter](https://github.com/iordjn/club-website/blob/main/apps/public-website/lib/api.ts): `apps/public-website/lib/api.ts`

### Officers hub

- [Dashboard entry](https://github.com/iordjn/club-website/blob/main/apps/officers-hub/app/page.tsx): `apps/officers-hub/app/page.tsx`
- [Management views](https://github.com/iordjn/club-website/tree/main/apps/officers-hub/components/views): `apps/officers-hub/components/views`
- [Content editors](https://github.com/iordjn/club-website/tree/main/apps/officers-hub/components/editors): `apps/officers-hub/components/editors`
- [Event preview](https://github.com/iordjn/club-website/blob/main/apps/officers-hub/components/events/EventPreviewWrapper.tsx): `apps/officers-hub/components/events/EventPreviewWrapper.tsx`
- [Management hooks](https://github.com/iordjn/club-website/tree/main/apps/officers-hub/hooks): `apps/officers-hub/hooks`
- [UI adapters](https://github.com/iordjn/club-website/blob/main/apps/officers-hub/lib/adapters.ts): `apps/officers-hub/lib/adapters.ts`
- [Authenticated API setup](https://github.com/iordjn/club-website/blob/main/apps/officers-hub/lib/api.ts): `apps/officers-hub/lib/api.ts`

### API and domain

- [API routes](https://github.com/iordjn/club-website/tree/main/apps/api/api/urls): `apps/api/api/urls`
- [API views](https://github.com/iordjn/club-website/tree/main/apps/api/api/views): `apps/api/api/views`
- [Clerk verification](https://github.com/iordjn/club-website/blob/main/apps/api/api/middleware/clerk_auth.py): `apps/api/api/middleware/clerk_auth.py`
- [Business services](https://github.com/iordjn/club-website/tree/main/apps/api/api/services): `apps/api/api/services`
- [Domain models](https://github.com/iordjn/club-website/tree/main/apps/api/api/models): `apps/api/api/models`

### Shared client and UI

- [API client](https://github.com/iordjn/club-website/tree/main/packages/api-client/src): `packages/api-client/src`
- [Shared UI components](https://github.com/iordjn/club-website/tree/main/packages/ui/src/components): `packages/ui/src/components`
- [API contracts](https://github.com/iordjn/club-website/tree/main/packages/api-contracts/src): `packages/api-contracts/src`
- [Domain types](https://github.com/iordjn/club-website/tree/main/packages/domain-types/src): `packages/domain-types/src`

### Other components

- **Site visitor**
- **Club officer**
- **Clerk authentication**
- **PostgreSQL database**

## Connections

- Site visitor → Public pages: browses
- Public pages → Public data hooks: loads content
- Public data hooks → Public API adapter: requests data
- Public API adapter → API routes: calls REST API
- Club officer → Dashboard entry: manages club
- Dashboard entry → Management views: selects views (evidence: `apps/officers-hub/app/page.tsx`)
- Management views → Content editors: opens editors
- Management views → Event preview: opens preview
- Content editors → Management hooks: edits records
- Management hooks → Authenticated API setup: calls client (evidence: `apps/officers-hub/hooks/useEvents.ts`)
- Management hooks → UI adapters: converts requests (evidence: `apps/officers-hub/hooks/useEvents.ts`)
- Event preview → Management hooks: loads event (evidence: `apps/officers-hub/components/events/EventPreviewWrapper.tsx`)
- Event preview → Shared UI components: renders preview (evidence: `apps/officers-hub/components/events/EventPreviewWrapper.tsx`)
- Authenticated API setup → Clerk authentication: gets token (evidence: `apps/officers-hub/lib/api.ts`)
- Authenticated API setup → API client: creates client (evidence: `apps/officers-hub/lib/api.ts`)
- API client → API routes: calls REST API
- API routes → API views: routes requests
- API views → Clerk verification: verifies officers
- API views → Business services: delegates logic
- Business services → Domain models: reads and writes (evidence: `apps/api/api/services/event_service.py`)
- Domain models → PostgreSQL database: persists records
- UI adapters → Domain types: maps types (evidence: `apps/officers-hub/lib/adapters.ts`)
- Authenticated API setup → API contracts: exports request types (evidence: `apps/officers-hub/lib/api.ts`)
