# himanshukumarrout/campuslink architecture

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

- Interactive diagram: https://gitdiagram.com/himanshukumarrout/campuslink
- Repository: https://github.com/himanshukumarrout/campuslink

## Overview

HireBridge is a web application with account authentication, a dashboard, and an AI chat interface, backed by an Express API and PostgreSQL. The user-facing flow includes account creation or sign-in, session-gated dashboard access, and chat prompts sent to the configured server URL. The README also documents PWA support. Some server routing and PWA registration details are unsampled, so those connections are left unverified rather than inferred.

Main entry points: [`apps/web/src/app/ai/page.tsx`](https://github.com/himanshukumarrout/campuslink/blob/main/apps/web/src/app/ai/page.tsx) (AI chat), [`apps/web/src/components/sign-up-form.tsx`](https://github.com/himanshukumarrout/campuslink/blob/main/apps/web/src/components/sign-up-form.tsx) (Sign-in and sign-up), [`apps/server/src/services.ts`](https://github.com/himanshukumarrout/campuslink/blob/main/apps/server/src/services.ts) (Server services), [`packages/db/src/index.ts`](https://github.com/himanshukumarrout/campuslink/blob/main/packages/db/src/index.ts) (Prisma client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_site["Web app pages<br/>[page.tsx]"]
  node_authforms["Sign-in and sign-up<br/>[sign-up-form.tsx]"]
  node_authclient["Browser auth client<br/>[auth-client.ts]"]
  node_dashboard["Session dashboard<br/>[page.tsx]"]
  node_chat["AI chat<br/>[page.tsx]"]
  node_pwa["PWA support<br/>[pwa.config.ts]"]
  node_sw["Service worker<br/>[sw.js]"]
end

subgraph group_server["API and services"]
  node_serverapi["Express API<br/>[index.ts]"]
  node_services["Server services<br/>[services.ts]"]
  node_env["Server environment<br/>[env.server.ts]"]
end

subgraph group_data["Auth and database"]
  node_auth["Better Auth<br/>[index.ts]"]
  node_dbclient["Prisma client<br/>[index.ts]"]
  node_dbconfig["Database config<br/>[config.ts]"]
end

subgraph group_ui["Shared interface"]
  node_sharedui["Shared UI primitives<br/>[dropdown-menu.tsx]"]
  node_chatcontrols["Chat input controls<br/>[input-group.tsx]"]
  node_chatmessages["Chat message display"]
  node_attachments["Attachment components<br/>[attachment.tsx]"]
end

node_user(("User"))
node_postgres[("PostgreSQL")]

node_user -->|"opens"| node_site
node_user -->|"creates account"| node_authforms
node_authforms -->|"submits credentials"| node_authclient
node_authclient -.->|"auth requests"| node_auth
node_authforms -->|"routes on success"| node_dashboard
node_dashboard -->|"loads session"| node_authclient
node_user -->|"sends prompt"| node_chat
node_chat -.->|"posts to configured URL"| node_serverapi
node_serverapi -->|"imports services"| node_services
node_services -->|"reads configuration"| node_env
node_services -->|"creates auth"| node_auth
node_services -->|"creates client"| node_dbclient
node_auth -->|"uses Prisma adapter"| node_dbclient
node_dbclient -->|"uses config"| node_dbconfig
node_dbclient -->|"persists data"| node_postgres
node_user -.->|"uses installed app"| node_pwa
node_pwa -.->|"serves worker"| node_sw
node_chat -->|"renders input"| node_chatcontrols
node_chat -->|"renders messages"| node_chatmessages
node_chat -->|"renders controls"| node_sharedui
node_authforms -->|"renders controls"| node_sharedui
node_chatcontrols -->|"wraps button"| node_sharedui

click node_site "https://github.com/himanshukumarrout/campuslink/blob/main/apps/web/src/app/page.tsx"
click node_authforms "https://github.com/himanshukumarrout/campuslink/blob/main/apps/web/src/components/sign-up-form.tsx"
click node_authclient "https://github.com/himanshukumarrout/campuslink/blob/main/apps/web/src/lib/auth-client.ts"
click node_dashboard "https://github.com/himanshukumarrout/campuslink/blob/main/apps/web/src/app/dashboard/page.tsx"
click node_chat "https://github.com/himanshukumarrout/campuslink/blob/main/apps/web/src/app/ai/page.tsx"
click node_pwa "https://github.com/himanshukumarrout/campuslink/blob/main/apps/web/pwa.config.ts"
click node_sw "https://github.com/himanshukumarrout/campuslink/blob/main/apps/web/public/sw.js"
click node_serverapi "https://github.com/himanshukumarrout/campuslink/blob/main/apps/server/src/index.ts"
click node_services "https://github.com/himanshukumarrout/campuslink/blob/main/apps/server/src/services.ts"
click node_env "https://github.com/himanshukumarrout/campuslink/blob/main/apps/server/src/env.server.ts"
click node_auth "https://github.com/himanshukumarrout/campuslink/blob/main/packages/auth/src/index.ts"
click node_dbclient "https://github.com/himanshukumarrout/campuslink/blob/main/packages/db/src/index.ts"
click node_dbconfig "https://github.com/himanshukumarrout/campuslink/blob/main/packages/db/src/config.ts"
click node_sharedui "https://github.com/himanshukumarrout/campuslink/blob/main/packages/ui/src/components/dropdown-menu.tsx"
click node_chatcontrols "https://github.com/himanshukumarrout/campuslink/blob/main/packages/ui/src/components/input-group.tsx"
click node_chatmessages "https://github.com/himanshukumarrout/campuslink/blob/main/packages/ui/src/components/message-scroller.tsx"
click node_attachments "https://github.com/himanshukumarrout/campuslink/blob/main/packages/ui/src/components/attachment.tsx"

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_site,node_authforms,node_authclient,node_dashboard,node_chat,node_pwa,node_sw,node_user toneBlue
class node_serverapi,node_services,node_env,node_postgres toneAmber
class node_auth,node_dbclient,node_dbconfig toneMint
class node_sharedui,node_chatcontrols,node_chatmessages,node_attachments toneRose
```

## Components

### Web application

- [Web app pages](https://github.com/himanshukumarrout/campuslink/blob/main/apps/web/src/app/page.tsx): `apps/web/src/app/page.tsx`
- [Sign-in and sign-up](https://github.com/himanshukumarrout/campuslink/blob/main/apps/web/src/components/sign-up-form.tsx): `apps/web/src/components/sign-up-form.tsx`
- [Browser auth client](https://github.com/himanshukumarrout/campuslink/blob/main/apps/web/src/lib/auth-client.ts): `apps/web/src/lib/auth-client.ts`
- [Session dashboard](https://github.com/himanshukumarrout/campuslink/blob/main/apps/web/src/app/dashboard/page.tsx): `apps/web/src/app/dashboard/page.tsx`
- [AI chat](https://github.com/himanshukumarrout/campuslink/blob/main/apps/web/src/app/ai/page.tsx): `apps/web/src/app/ai/page.tsx`
- [PWA support](https://github.com/himanshukumarrout/campuslink/blob/main/apps/web/pwa.config.ts): `apps/web/pwa.config.ts`
- [Service worker](https://github.com/himanshukumarrout/campuslink/blob/main/apps/web/public/sw.js): `apps/web/public/sw.js`

### API and services

- [Express API](https://github.com/himanshukumarrout/campuslink/blob/main/apps/server/src/index.ts): `apps/server/src/index.ts`
- [Server services](https://github.com/himanshukumarrout/campuslink/blob/main/apps/server/src/services.ts): `apps/server/src/services.ts`
- [Server environment](https://github.com/himanshukumarrout/campuslink/blob/main/apps/server/src/env.server.ts): `apps/server/src/env.server.ts`

### Auth and database

- [Better Auth](https://github.com/himanshukumarrout/campuslink/blob/main/packages/auth/src/index.ts): `packages/auth/src/index.ts`
- [Prisma client](https://github.com/himanshukumarrout/campuslink/blob/main/packages/db/src/index.ts): `packages/db/src/index.ts`
- [Database config](https://github.com/himanshukumarrout/campuslink/blob/main/packages/db/src/config.ts): `packages/db/src/config.ts`

### Shared interface

- [Shared UI primitives](https://github.com/himanshukumarrout/campuslink/blob/main/packages/ui/src/components/dropdown-menu.tsx): `packages/ui/src/components/dropdown-menu.tsx`
- [Chat input controls](https://github.com/himanshukumarrout/campuslink/blob/main/packages/ui/src/components/input-group.tsx): `packages/ui/src/components/input-group.tsx`
- [Chat message display](https://github.com/himanshukumarrout/campuslink/blob/main/packages/ui/src/components/message-scroller.tsx): `packages/ui/src/components/message-scroller.tsx`
- [Attachment components](https://github.com/himanshukumarrout/campuslink/blob/main/packages/ui/src/components/attachment.tsx): `packages/ui/src/components/attachment.tsx`

### Other components

- **User**
- **PostgreSQL**

## Connections

- User → Web app pages: opens (evidence: `README.md`)
- User → Sign-in and sign-up: creates account (evidence: `apps/web/src/components/sign-up-form.tsx`)
- Sign-in and sign-up → Browser auth client: submits credentials (evidence: `apps/web/src/components/sign-up-form.tsx`)
- Browser auth client → Better Auth: auth requests
- Sign-in and sign-up → Session dashboard: routes on success (evidence: `apps/web/src/components/sign-up-form.tsx`)
- Session dashboard → Browser auth client: loads session (evidence: `apps/web/src/app/dashboard/page.tsx`)
- User → AI chat: sends prompt (evidence: `apps/web/src/app/ai/page.tsx`)
- AI chat → Express API: posts to configured URL
- Express API → Server services: imports services (evidence: `apps/server/src/index.ts`)
- Server services → Server environment: reads configuration (evidence: `apps/server/src/services.ts`)
- Server services → Better Auth: creates auth (evidence: `apps/server/src/services.ts`)
- Server services → Prisma client: creates client (evidence: `apps/server/src/services.ts`)
- Better Auth → Prisma client: uses Prisma adapter (evidence: `packages/auth/src/index.ts`)
- Prisma client → Database config: uses config (evidence: `packages/db/src/index.ts`)
- Prisma client → PostgreSQL: persists data (evidence: `README.md`)
- User → PWA support: uses installed app
- PWA support → Service worker: serves worker
- AI chat → Chat input controls: renders input (evidence: `apps/web/src/app/ai/page.tsx`)
- AI chat → Chat message display: renders messages (evidence: `apps/web/src/app/ai/page.tsx`)
- AI chat → Shared UI primitives: renders controls (evidence: `apps/web/src/app/ai/page.tsx`)
- Sign-in and sign-up → Shared UI primitives: renders controls (evidence: `apps/web/src/components/sign-up-form.tsx`)
- Chat input controls → Shared UI primitives: wraps button (evidence: `packages/ui/src/components/input-group.tsx`)
