# chandrakantamandal/campuslink architecture

> Architecture diagram of the GitHub repository chandrakantamandal/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/chandrakantamandal/campuslink
- Repository: https://github.com/chandrakantamandal/campuslink

## Overview

HireBridge is a web application with account access, a session-gated dashboard, and an AI chat interface, backed by an Express server and shared Better Auth/Prisma packages. The visible chat submits prompts to the configured server URL; server setup and shared service wiring are visible, but the server’s route implementation is not. The README also documents PostgreSQL and PWA support. Some route and PWA wiring is therefore shown as unverified rather than assumed.

Main entry points: [`apps/server/src/services.ts`](https://github.com/chandrakantamandal/campuslink/blob/main/apps/server/src/services.ts) (Service initialization), [`packages/db/src/index.ts`](https://github.com/chandrakantamandal/campuslink/blob/main/packages/db/src/index.ts) (Prisma client), [`apps/web/src/app/page.tsx`](https://github.com/chandrakantamandal/campuslink/blob/main/apps/web/src/app/page.tsx) (Web application), [`apps/web/src/lib/auth-client.ts`](https://github.com/chandrakantamandal/campuslink/blob/main/apps/web/src/lib/auth-client.ts) (Auth client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_webapp["Web application<br/>[page.tsx]"]
  node_signup["Sign-up form<br/>[sign-up-form.tsx]"]
  node_signin["Sign-in form<br/>[sign-in-form.tsx]"]
  node_dashboard["Dashboard gate<br/>[page.tsx]"]
  node_aichat["AI chat<br/>[page.tsx]"]
  node_uikit["Shared UI primitives"]
end

subgraph group_auth["Authentication"]
  node_authclient["Auth client<br/>[auth-client.ts]"]
  node_authservice["Auth configuration<br/>[index.ts]"]
end

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

subgraph group_data["Persistence"]
  node_dbclient["Prisma client<br/>[index.ts]"]
  node_dbconfig["Database configuration<br/>[config.ts]"]
end

subgraph group_pwa["PWA support"]
  node_manifest["App manifest<br/>[manifest.ts]"]
  node_sw["Service worker<br/>[sw.js]"]
  node_pwaconfig["PWA configuration<br/>[pwa.config.ts]"]
  node_pwareg["PWA registration"]
end

node_visitor(("Visitor"))
node_postgres[("PostgreSQL")]

node_visitor -->|"visits"| node_webapp
node_visitor -->|"registers"| node_signup
node_visitor -->|"signs in"| node_signin
node_signup -->|"calls"| node_authclient
node_signin -->|"uses"| node_authclient
node_dashboard -->|"checks session"| node_authclient
node_dashboard -->|"redirects unauthenticated"| node_visitor
node_aichat -->|"renders with"| node_uikit
node_aichat -.->|"posts chat request"| node_serverapp
node_serverapp -->|"imports"| node_services
node_services -->|"reads configuration"| node_env
node_services -->|"creates auth"| node_authservice
node_services -->|"creates client"| node_dbclient
node_authservice -->|"uses Prisma adapter"| node_dbclient
node_dbclient -->|"imports config"| node_dbconfig
node_dbclient -.->|"persists data"| node_postgres
node_webapp -.->|"exposes"| node_manifest
node_webapp -.->|"registers worker"| node_pwareg
node_pwareg -.->|"registers"| node_sw
node_pwaconfig -.->|"sets headers"| node_sw

click node_webapp "https://github.com/chandrakantamandal/campuslink/blob/main/apps/web/src/app/page.tsx"
click node_signup "https://github.com/chandrakantamandal/campuslink/blob/main/apps/web/src/components/sign-up-form.tsx"
click node_signin "https://github.com/chandrakantamandal/campuslink/blob/main/apps/web/src/components/sign-in-form.tsx"
click node_dashboard "https://github.com/chandrakantamandal/campuslink/blob/main/apps/web/src/app/dashboard/page.tsx"
click node_aichat "https://github.com/chandrakantamandal/campuslink/blob/main/apps/web/src/app/ai/page.tsx"
click node_uikit "https://github.com/chandrakantamandal/campuslink/tree/main/packages/ui/src/components"
click node_authclient "https://github.com/chandrakantamandal/campuslink/blob/main/apps/web/src/lib/auth-client.ts"
click node_authservice "https://github.com/chandrakantamandal/campuslink/blob/main/packages/auth/src/index.ts"
click node_serverapp "https://github.com/chandrakantamandal/campuslink/blob/main/apps/server/src/index.ts"
click node_services "https://github.com/chandrakantamandal/campuslink/blob/main/apps/server/src/services.ts"
click node_env "https://github.com/chandrakantamandal/campuslink/blob/main/apps/server/src/env.server.ts"
click node_dbclient "https://github.com/chandrakantamandal/campuslink/blob/main/packages/db/src/index.ts"
click node_dbconfig "https://github.com/chandrakantamandal/campuslink/blob/main/packages/db/src/config.ts"
click node_manifest "https://github.com/chandrakantamandal/campuslink/blob/main/apps/web/src/app/manifest.ts"
click node_sw "https://github.com/chandrakantamandal/campuslink/blob/main/apps/web/public/sw.js"
click node_pwaconfig "https://github.com/chandrakantamandal/campuslink/blob/main/apps/web/pwa.config.ts"
click node_pwareg "https://github.com/chandrakantamandal/campuslink/blob/main/apps/web/src/components/pwa-registration.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_webapp,node_signup,node_signin,node_dashboard,node_aichat,node_uikit toneBlue
class node_authclient,node_authservice,node_postgres toneAmber
class node_serverapp,node_services,node_env toneMint
class node_dbclient,node_dbconfig toneRose
class node_manifest,node_sw,node_pwaconfig,node_pwareg,node_visitor toneIndigo
```

## Components

### Web experience

- [Web application](https://github.com/chandrakantamandal/campuslink/blob/main/apps/web/src/app/page.tsx): `apps/web/src/app/page.tsx`
- [Sign-up form](https://github.com/chandrakantamandal/campuslink/blob/main/apps/web/src/components/sign-up-form.tsx): `apps/web/src/components/sign-up-form.tsx`
- [Sign-in form](https://github.com/chandrakantamandal/campuslink/blob/main/apps/web/src/components/sign-in-form.tsx): `apps/web/src/components/sign-in-form.tsx`
- [Dashboard gate](https://github.com/chandrakantamandal/campuslink/blob/main/apps/web/src/app/dashboard/page.tsx): `apps/web/src/app/dashboard/page.tsx`
- [AI chat](https://github.com/chandrakantamandal/campuslink/blob/main/apps/web/src/app/ai/page.tsx): `apps/web/src/app/ai/page.tsx`
- [Shared UI primitives](https://github.com/chandrakantamandal/campuslink/tree/main/packages/ui/src/components): `packages/ui/src/components`

### Authentication

- [Auth client](https://github.com/chandrakantamandal/campuslink/blob/main/apps/web/src/lib/auth-client.ts): `apps/web/src/lib/auth-client.ts`
- [Auth configuration](https://github.com/chandrakantamandal/campuslink/blob/main/packages/auth/src/index.ts): `packages/auth/src/index.ts`

### Server services

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

### Persistence

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

### PWA support

- [App manifest](https://github.com/chandrakantamandal/campuslink/blob/main/apps/web/src/app/manifest.ts): `apps/web/src/app/manifest.ts`
- [Service worker](https://github.com/chandrakantamandal/campuslink/blob/main/apps/web/public/sw.js): `apps/web/public/sw.js`
- [PWA configuration](https://github.com/chandrakantamandal/campuslink/blob/main/apps/web/pwa.config.ts): `apps/web/pwa.config.ts`
- [PWA registration](https://github.com/chandrakantamandal/campuslink/blob/main/apps/web/src/components/pwa-registration.tsx): `apps/web/src/components/pwa-registration.tsx`

### Other components

- **Visitor**
- **PostgreSQL**

## Connections

- Visitor → Web application: visits (evidence: `apps/web/src/app/page.tsx`)
- Visitor → Sign-up form: registers (evidence: `apps/web/src/components/sign-up-form.tsx`)
- Visitor → Sign-in form: signs in (evidence: `apps/web/src/components/sign-in-form.tsx`)
- Sign-up form → Auth client: calls (evidence: `apps/web/src/components/sign-up-form.tsx`)
- Sign-in form → Auth client: uses (evidence: `apps/web/src/components/sign-in-form.tsx`)
- Dashboard gate → Auth client: checks session (evidence: `apps/web/src/app/dashboard/page.tsx`)
- Dashboard gate → Visitor: redirects unauthenticated (evidence: `apps/web/src/app/dashboard/page.tsx`)
- AI chat → Shared UI primitives: renders with (evidence: `apps/web/src/app/ai/page.tsx`)
- AI chat → Express API: posts chat request (evidence: `apps/web/src/app/ai/page.tsx`)
- Express API → Service initialization: imports (evidence: `apps/server/src/index.ts`)
- Service initialization → Server environment: reads configuration (evidence: `apps/server/src/services.ts`)
- Service initialization → Auth configuration: creates auth (evidence: `apps/server/src/services.ts`)
- Service initialization → Prisma client: creates client (evidence: `apps/server/src/services.ts`)
- Auth configuration → Prisma client: uses Prisma adapter (evidence: `packages/auth/src/index.ts`)
- Prisma client → Database configuration: imports config (evidence: `packages/db/src/index.ts`)
- Prisma client → PostgreSQL: persists data (evidence: `README.md`)
- Web application → App manifest: exposes (evidence: `README.md`)
- Web application → PWA registration: registers worker
- PWA registration → Service worker: registers
- PWA configuration → Service worker: sets headers (evidence: `apps/web/pwa.config.ts`)
