# dyeecipokes/hpco-intranet architecture

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

- Interactive diagram: https://gitdiagram.com/dyeecipokes/hpco-intranet
- Repository: https://github.com/dyeecipokes/hpco-intranet

## Overview

HPCo Intranet is an employee portal for company workflows and communications. Employees enter through the authenticated app, then use feature pages to submit or review requests, communicate, find company information, and access operational tools. The README documents request filing through manager approval and calendar/balance updates, plus chat, announcements, and calendar capabilities. Feature switches also expose documents, season reporting, Mail, and external handoffs. The graph reflects documented workflows and indexed imports; unsampled modules are represented by their exact paths, and their internal behavior is not inferred.

Main entry points: [`src/lib/search.ts`](https://github.com/dyeecipokes/hpco-intranet/blob/main/src/lib/search.ts) (Unified search), [`src/lib/supabase/server.ts`](https://github.com/dyeecipokes/hpco-intranet/blob/main/src/lib/supabase/server.ts) (Supabase services), [`src/lib/mail/store.ts`](https://github.com/dyeecipokes/hpco-intranet/blob/main/src/lib/mail/store.ts) (Built-in Mail), [`src/lib/announcements/store.ts`](https://github.com/dyeecipokes/hpco-intranet/blob/main/src/lib/announcements/store.ts) (Announcements)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and shell"]
  node_app["App shell<br/>[layout.tsx]"]
  node_auth["Sign-in<br/>[page.tsx]"]
end

subgraph group_workflows["Requests and operations"]
  node_requests["Requests and approvals<br/>[store.ts]"]
  node_request_ui["Request screens<br/>[page.tsx]"]
  node_safety["Safety reports<br/>[store.ts]"]
  node_season["Season dashboard<br/>[store.ts]"]
  node_shifts["Shifts and swaps<br/>[store.ts]"]
  node_joborders["IT job orders<br/>[store.ts]"]
  node_leave_handoff["Leave form handoff<br/>[handoff.ts]"]
end

subgraph group_communications["Communication"]
  node_announcements["Announcements<br/>[store.ts]"]
  node_chat["Chat<br/>[chat-room.tsx]"]
  node_feed["Feed and kudos<br/>[store.ts]"]
  node_mail["Built-in Mail<br/>[store.ts]"]
end

subgraph group_information["Company information"]
  node_calendar["Calendar<br/>[store.ts]"]
  node_directory["People directory<br/>[store.ts]"]
  node_documents["Documents and policies<br/>[store.ts]"]
  node_search["Unified search<br/>[search.ts]"]
end

subgraph group_foundation["Shared services"]
  node_session["Identity and roles<br/>[session.ts]"]
  node_notifications["Notifications<br/>[store.ts]"]
  node_supabase[("Supabase services<br/>[server.ts]")]
end

node_employee(("Employee"))
node_mail_service["One.com mailbox"]
node_external_leave["Leave Form app"]
node_external_jobs["MIS Job Order system"]

node_employee -->|"signs in"| node_auth
node_employee -->|"uses portal"| node_app
node_auth -->|"verifies identity"| node_session
node_session -->|"loads profile"| node_supabase
node_app -->|"routes to"| node_request_ui
node_request_ui -->|"files and reviews"| node_requests
node_requests -->|"posts approved leave"| node_calendar
node_employee -->|"reads and confirms"| node_announcements
node_announcements -->|"creates notification"| node_notifications
node_employee -->|"messages colleagues"| node_chat
node_employee -->|"views schedules"| node_calendar
node_employee -->|"finds colleagues"| node_directory
node_employee -->|"reads policies"| node_documents
node_employee -->|"shares kudos"| node_feed
node_employee -->|"searches portal"| node_search
node_search -->|"queries"| node_announcements
node_search -->|"queries"| node_calendar
node_search -->|"queries"| node_documents
node_search -->|"queries"| node_feed
node_search -->|"queries"| node_safety
node_search -->|"queries"| node_directory
node_employee -->|"views mill figures"| node_season
node_employee -->|"views rosters"| node_shifts
node_employee -->|"reports incidents"| node_safety
node_employee -->|"opens job orders"| node_joborders
node_joborders -->|"hands off"| node_external_jobs
node_employee -->|"opens leave form"| node_leave_handoff
node_leave_handoff -->|"hands off"| node_external_leave
node_employee -->|"uses built-in mail"| node_mail
node_mail -.->|"reads mailbox"| node_mail_service
node_mail -->|"checks current user"| node_session
node_mail -->|"loads account"| node_supabase
node_announcements -->|"uses database"| node_supabase
node_calendar -->|"uses database"| node_supabase
node_documents -->|"uses database"| node_supabase
node_safety -->|"uses database"| node_supabase

click node_app "https://github.com/dyeecipokes/hpco-intranet/blob/main/src/app/(app)/layout.tsx"
click node_auth "https://github.com/dyeecipokes/hpco-intranet/blob/main/src/app/(auth)/login/page.tsx"
click node_session "https://github.com/dyeecipokes/hpco-intranet/blob/main/src/lib/session.ts"
click node_requests "https://github.com/dyeecipokes/hpco-intranet/blob/main/src/lib/requests/store.ts"
click node_request_ui "https://github.com/dyeecipokes/hpco-intranet/blob/main/src/app/(app)/requests/page.tsx"
click node_calendar "https://github.com/dyeecipokes/hpco-intranet/blob/main/src/lib/calendar/store.ts"
click node_announcements "https://github.com/dyeecipokes/hpco-intranet/blob/main/src/lib/announcements/store.ts"
click node_chat "https://github.com/dyeecipokes/hpco-intranet/blob/main/src/components/chat/chat-room.tsx"
click node_directory "https://github.com/dyeecipokes/hpco-intranet/blob/main/src/lib/staff/store.ts"
click node_documents "https://github.com/dyeecipokes/hpco-intranet/blob/main/src/lib/documents/store.ts"
click node_feed "https://github.com/dyeecipokes/hpco-intranet/blob/main/src/lib/feed/store.ts"
click node_search "https://github.com/dyeecipokes/hpco-intranet/blob/main/src/lib/search.ts"
click node_safety "https://github.com/dyeecipokes/hpco-intranet/blob/main/src/lib/safety/store.ts"
click node_season "https://github.com/dyeecipokes/hpco-intranet/blob/main/src/lib/season/store.ts"
click node_shifts "https://github.com/dyeecipokes/hpco-intranet/blob/main/src/lib/shifts/store.ts"
click node_joborders "https://github.com/dyeecipokes/hpco-intranet/blob/main/src/lib/joborders/store.ts"
click node_leave_handoff "https://github.com/dyeecipokes/hpco-intranet/blob/main/src/lib/leaveform/handoff.ts"
click node_mail "https://github.com/dyeecipokes/hpco-intranet/blob/main/src/lib/mail/store.ts"
click node_notifications "https://github.com/dyeecipokes/hpco-intranet/blob/main/src/lib/notifications/store.ts"
click node_supabase "https://github.com/dyeecipokes/hpco-intranet/blob/main/src/lib/supabase/server.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_app,node_auth toneBlue
class node_requests,node_request_ui,node_safety,node_season,node_shifts,node_joborders,node_leave_handoff toneAmber
class node_announcements,node_chat,node_feed,node_mail toneMint
class node_calendar,node_directory,node_documents,node_search toneRose
class node_session,node_notifications,node_supabase,node_employee,node_mail_service,node_external_leave,node_external_jobs toneIndigo
```

## Components

### Access and shell

- [App shell](https://github.com/dyeecipokes/hpco-intranet/blob/main/src/app/(app)/layout.tsx): `src/app/(app)/layout.tsx`
- [Sign-in](https://github.com/dyeecipokes/hpco-intranet/blob/main/src/app/(auth)/login/page.tsx): `src/app/(auth)/login/page.tsx`

### Requests and operations

- [Requests and approvals](https://github.com/dyeecipokes/hpco-intranet/blob/main/src/lib/requests/store.ts): `src/lib/requests/store.ts`
- [Request screens](https://github.com/dyeecipokes/hpco-intranet/blob/main/src/app/(app)/requests/page.tsx): `src/app/(app)/requests/page.tsx`
- [Safety reports](https://github.com/dyeecipokes/hpco-intranet/blob/main/src/lib/safety/store.ts): `src/lib/safety/store.ts`
- [Season dashboard](https://github.com/dyeecipokes/hpco-intranet/blob/main/src/lib/season/store.ts): `src/lib/season/store.ts`
- [Shifts and swaps](https://github.com/dyeecipokes/hpco-intranet/blob/main/src/lib/shifts/store.ts): `src/lib/shifts/store.ts`
- [IT job orders](https://github.com/dyeecipokes/hpco-intranet/blob/main/src/lib/joborders/store.ts): `src/lib/joborders/store.ts`
- [Leave form handoff](https://github.com/dyeecipokes/hpco-intranet/blob/main/src/lib/leaveform/handoff.ts): `src/lib/leaveform/handoff.ts`

### Communication

- [Announcements](https://github.com/dyeecipokes/hpco-intranet/blob/main/src/lib/announcements/store.ts): `src/lib/announcements/store.ts`
- [Chat](https://github.com/dyeecipokes/hpco-intranet/blob/main/src/components/chat/chat-room.tsx): `src/components/chat/chat-room.tsx`
- [Feed and kudos](https://github.com/dyeecipokes/hpco-intranet/blob/main/src/lib/feed/store.ts): `src/lib/feed/store.ts`
- [Built-in Mail](https://github.com/dyeecipokes/hpco-intranet/blob/main/src/lib/mail/store.ts): `src/lib/mail/store.ts`

### Company information

- [Calendar](https://github.com/dyeecipokes/hpco-intranet/blob/main/src/lib/calendar/store.ts): `src/lib/calendar/store.ts`
- [People directory](https://github.com/dyeecipokes/hpco-intranet/blob/main/src/lib/staff/store.ts): `src/lib/staff/store.ts`
- [Documents and policies](https://github.com/dyeecipokes/hpco-intranet/blob/main/src/lib/documents/store.ts): `src/lib/documents/store.ts`
- [Unified search](https://github.com/dyeecipokes/hpco-intranet/blob/main/src/lib/search.ts): `src/lib/search.ts`

### Shared services

- [Identity and roles](https://github.com/dyeecipokes/hpco-intranet/blob/main/src/lib/session.ts): `src/lib/session.ts`
- [Notifications](https://github.com/dyeecipokes/hpco-intranet/blob/main/src/lib/notifications/store.ts): `src/lib/notifications/store.ts`
- [Supabase services](https://github.com/dyeecipokes/hpco-intranet/blob/main/src/lib/supabase/server.ts): `src/lib/supabase/server.ts`

### Other components

- **Employee**
- **One.com mailbox**
- **Leave Form app**
- **MIS Job Order system**

## Connections

- Employee → Sign-in: signs in (evidence: `README.md`)
- Employee → App shell: uses portal (evidence: `README.md`)
- Sign-in → Identity and roles: verifies identity
- Identity and roles → Supabase services: loads profile (evidence: `src/lib/session.ts`)
- App shell → Request screens: routes to (evidence: `README.md`)
- Request screens → Requests and approvals: files and reviews (evidence: `README.md`)
- Requests and approvals → Calendar: posts approved leave (evidence: `README.md`)
- Employee → Announcements: reads and confirms (evidence: `README.md`)
- Announcements → Notifications: creates notification (evidence: `src/lib/announcements/store.ts`)
- Employee → Chat: messages colleagues (evidence: `README.md`)
- Employee → Calendar: views schedules (evidence: `README.md`)
- Employee → People directory: finds colleagues (evidence: `README.md`)
- Employee → Documents and policies: reads policies (evidence: `README.md`)
- Employee → Feed and kudos: shares kudos (evidence: `README.md`)
- Employee → Unified search: searches portal (evidence: `src/lib/search.ts`)
- Unified search → Announcements: queries (evidence: `src/lib/search.ts`)
- Unified search → Calendar: queries (evidence: `src/lib/search.ts`)
- Unified search → Documents and policies: queries (evidence: `src/lib/search.ts`)
- Unified search → Feed and kudos: queries (evidence: `src/lib/search.ts`)
- Unified search → Safety reports: queries (evidence: `src/lib/search.ts`)
- Unified search → People directory: queries (evidence: `src/lib/search.ts`)
- Employee → Season dashboard: views mill figures
- Employee → Shifts and swaps: views rosters
- Employee → Safety reports: reports incidents
- Employee → IT job orders: opens job orders
- IT job orders → MIS Job Order system: hands off
- Employee → Leave form handoff: opens leave form
- Leave form handoff → Leave Form app: hands off
- Employee → Built-in Mail: uses built-in mail
- Built-in Mail → One.com mailbox: reads mailbox
- Built-in Mail → Identity and roles: checks current user (evidence: `src/app/(app)/mail/events/route.ts`)
- Built-in Mail → Supabase services: loads account (evidence: `src/lib/mail/store.ts`)
- Announcements → Supabase services: uses database (evidence: `src/lib/announcements/store.ts`)
- Calendar → Supabase services: uses database (evidence: `src/lib/calendar/store.ts`)
- Documents and policies → Supabase services: uses database (evidence: `src/lib/documents/store.ts`)
- Safety reports → Supabase services: uses database (evidence: `src/lib/safety/store.ts`)
