# thequietbeatle/nurserylink architecture

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

- Interactive diagram: https://gitdiagram.com/thequietbeatle/nurserylink
- Repository: https://github.com/thequietbeatle/nurserylink

## Overview

NurseryLink is a full-stack nursery-management app. Teachers use a class roster to record attendance and care events; parents sign in to review their children’s histories and notifications; administrators manage accounts, classes, teacher assignments, and parent-child links. The React portals call a JWT-aware API helper, while Express routes dispatch to controllers that query PostgreSQL and support notification and email delivery. Domain endpoints are grouped where their individual implementations were not sampled; those links are shown only where the README or source index supports them.

Main entry points: [`NurseryLinkFront/src/App.tsx`](https://github.com/thequietbeatle/nurserylink/blob/main/NurseryLinkFront/src/App.tsx) (SPA routes), [`NurseryLinkFront/src/lib/api.ts`](https://github.com/thequietbeatle/nurserylink/blob/main/NurseryLinkFront/src/lib/api.ts) (API client), [`NurseryLinkFront/src/components/teacher/TeacherDashboard.tsx`](https://github.com/thequietbeatle/nurserylink/blob/main/NurseryLinkFront/src/components/teacher/TeacherDashboard.tsx) (Teacher roster), [`NurseryLinkFront/src/components/admin/Administrator.tsx`](https://github.com/thequietbeatle/nurserylink/blob/main/NurseryLinkFront/src/components/admin/Administrator.tsx) (Admin portal)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_app["SPA routes<br/>[App.tsx]"]
  node_signin["Sign-in<br/>[signing.tsx]"]
  node_apihelper["API client<br/>[api.ts]"]
end

subgraph group_care["Care records"]
  node_parentdash["Parent dashboard"]
  node_childhistory["Child history"]
  node_inbox["Notification inbox<br/>[Events.tsx]"]
  node_teacherdash["Teacher roster"]
  node_rostercard["Roster card<br/>[RosterCard.tsx]"]
  node_logging["Care logging"]
end

subgraph group_admin["Nursery administration"]
  node_adminportal["Admin portal<br/>[Administrator.tsx]"]
  node_classadmin["Class management"]
  node_teacheradmin["Teacher management"]
  node_parentlink["Parent linkage<br/>[parentLinkage.tsx]"]
end

subgraph group_backend["API and security"]
  node_routes["API routes<br/>[app.ts]"]
  node_auth["Token and privilege checks<br/>[verifyToken.ts]"]
  node_controllers["Domain controllers"]
end

subgraph group_infrastructure["Persistence and alerts"]
  node_dbpool["PostgreSQL pool<br/>[DB.ts]"]
  node_postgres[("PostgreSQL")]
  node_notify["In-app notifications<br/>[notify.ts]"]
  node_mailer["Email delivery<br/>[mailer.ts]"]
end

node_visitor(("Visitor or user"))
node_resend["Resend"]

node_visitor -->|"uses"| node_app
node_app -->|"routes to"| node_signin
node_app -->|"routes to"| node_parentdash
node_app -->|"routes to"| node_childhistory
node_app -->|"routes to"| node_inbox
node_app -->|"routes to"| node_teacherdash
node_app -->|"routes to"| node_adminportal
node_signin -->|"authenticates via"| node_apihelper
node_parentdash -.->|"fetches data via"| node_apihelper
node_childhistory -.->|"fetches data via"| node_apihelper
node_inbox -->|"fetches data via"| node_apihelper
node_teacherdash -->|"loads roster via"| node_apihelper
node_teacherdash -->|"renders"| node_rostercard
node_teacherdash -->|"opens forms"| node_logging
node_adminportal -->|"provides management"| node_classadmin
node_adminportal -->|"provides management"| node_teacheradmin
node_adminportal -->|"provides management"| node_parentlink
node_apihelper -->|"fetches JSON"| node_routes
node_routes -->|"dispatches"| node_controllers
node_routes -->|"guards data routes"| node_auth
node_controllers -->|"queries through"| node_dbpool
node_dbpool -->|"reads and writes"| node_postgres
node_controllers -->|"creates notifications"| node_notify
node_controllers -->|"sends email"| node_mailer
node_mailer -->|"delivers through"| node_resend

click node_app "https://github.com/thequietbeatle/nurserylink/blob/main/NurseryLinkFront/src/App.tsx"
click node_signin "https://github.com/thequietbeatle/nurserylink/blob/main/NurseryLinkFront/src/components/signpage/signing.tsx"
click node_apihelper "https://github.com/thequietbeatle/nurserylink/blob/main/NurseryLinkFront/src/lib/api.ts"
click node_parentdash "https://github.com/thequietbeatle/nurserylink/blob/main/NurseryLinkFront/src/components/parents/ParentDashboard.tsx"
click node_childhistory "https://github.com/thequietbeatle/nurserylink/blob/main/NurseryLinkFront/src/components/parents/child/child_dashboard.tsx"
click node_inbox "https://github.com/thequietbeatle/nurserylink/blob/main/NurseryLinkFront/src/components/parents/Events.tsx"
click node_teacherdash "https://github.com/thequietbeatle/nurserylink/blob/main/NurseryLinkFront/src/components/teacher/TeacherDashboard.tsx"
click node_rostercard "https://github.com/thequietbeatle/nurserylink/blob/main/NurseryLinkFront/src/components/teacher/RosterCard.tsx"
click node_logging "https://github.com/thequietbeatle/nurserylink/tree/main/NurseryLinkFront/src/components/teacher"
click node_adminportal "https://github.com/thequietbeatle/nurserylink/blob/main/NurseryLinkFront/src/components/admin/Administrator.tsx"
click node_classadmin "https://github.com/thequietbeatle/nurserylink/blob/main/NurseryLinkFront/src/components/admin/ClassesAndStudents.tsx"
click node_teacheradmin "https://github.com/thequietbeatle/nurserylink/blob/main/NurseryLinkFront/src/components/admin/teacherManagement.tsx"
click node_parentlink "https://github.com/thequietbeatle/nurserylink/blob/main/NurseryLinkFront/src/components/admin/parentLinkage.tsx"
click node_routes "https://github.com/thequietbeatle/nurserylink/blob/main/backend/src/app.ts"
click node_auth "https://github.com/thequietbeatle/nurserylink/blob/main/backend/src/middlewares/verifyToken.ts"
click node_controllers "https://github.com/thequietbeatle/nurserylink/tree/main/backend/src/controllers"
click node_dbpool "https://github.com/thequietbeatle/nurserylink/blob/main/backend/src/config/DB.ts"
click node_notify "https://github.com/thequietbeatle/nurserylink/blob/main/backend/src/services/notify.ts"
click node_mailer "https://github.com/thequietbeatle/nurserylink/blob/main/backend/src/services/mailer.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_signin,node_apihelper,node_visitor toneBlue
class node_parentdash,node_childhistory,node_inbox,node_teacherdash,node_rostercard,node_logging toneAmber
class node_adminportal,node_classadmin,node_teacheradmin,node_parentlink toneMint
class node_routes,node_auth,node_controllers toneRose
class node_dbpool,node_postgres,node_notify,node_mailer,node_resend toneIndigo
```

## Components

### Web experience

- [SPA routes](https://github.com/thequietbeatle/nurserylink/blob/main/NurseryLinkFront/src/App.tsx): `NurseryLinkFront/src/App.tsx`
- [Sign-in](https://github.com/thequietbeatle/nurserylink/blob/main/NurseryLinkFront/src/components/signpage/signing.tsx): `NurseryLinkFront/src/components/signpage/signing.tsx`
- [API client](https://github.com/thequietbeatle/nurserylink/blob/main/NurseryLinkFront/src/lib/api.ts): `NurseryLinkFront/src/lib/api.ts`

### Care records

- [Parent dashboard](https://github.com/thequietbeatle/nurserylink/blob/main/NurseryLinkFront/src/components/parents/ParentDashboard.tsx): `NurseryLinkFront/src/components/parents/ParentDashboard.tsx`
- [Child history](https://github.com/thequietbeatle/nurserylink/blob/main/NurseryLinkFront/src/components/parents/child/child_dashboard.tsx): `NurseryLinkFront/src/components/parents/child/child_dashboard.tsx`
- [Notification inbox](https://github.com/thequietbeatle/nurserylink/blob/main/NurseryLinkFront/src/components/parents/Events.tsx): `NurseryLinkFront/src/components/parents/Events.tsx`
- [Teacher roster](https://github.com/thequietbeatle/nurserylink/blob/main/NurseryLinkFront/src/components/teacher/TeacherDashboard.tsx): `NurseryLinkFront/src/components/teacher/TeacherDashboard.tsx`
- [Roster card](https://github.com/thequietbeatle/nurserylink/blob/main/NurseryLinkFront/src/components/teacher/RosterCard.tsx): `NurseryLinkFront/src/components/teacher/RosterCard.tsx`
- [Care logging](https://github.com/thequietbeatle/nurserylink/tree/main/NurseryLinkFront/src/components/teacher): `NurseryLinkFront/src/components/teacher`

### Nursery administration

- [Admin portal](https://github.com/thequietbeatle/nurserylink/blob/main/NurseryLinkFront/src/components/admin/Administrator.tsx): `NurseryLinkFront/src/components/admin/Administrator.tsx`
- [Class management](https://github.com/thequietbeatle/nurserylink/blob/main/NurseryLinkFront/src/components/admin/ClassesAndStudents.tsx): `NurseryLinkFront/src/components/admin/ClassesAndStudents.tsx`
- [Teacher management](https://github.com/thequietbeatle/nurserylink/blob/main/NurseryLinkFront/src/components/admin/teacherManagement.tsx): `NurseryLinkFront/src/components/admin/teacherManagement.tsx`
- [Parent linkage](https://github.com/thequietbeatle/nurserylink/blob/main/NurseryLinkFront/src/components/admin/parentLinkage.tsx): `NurseryLinkFront/src/components/admin/parentLinkage.tsx`

### API and security

- [API routes](https://github.com/thequietbeatle/nurserylink/blob/main/backend/src/app.ts): `backend/src/app.ts`
- [Token and privilege checks](https://github.com/thequietbeatle/nurserylink/blob/main/backend/src/middlewares/verifyToken.ts): `backend/src/middlewares/verifyToken.ts`
- [Domain controllers](https://github.com/thequietbeatle/nurserylink/tree/main/backend/src/controllers): `backend/src/controllers`

### Persistence and alerts

- [PostgreSQL pool](https://github.com/thequietbeatle/nurserylink/blob/main/backend/src/config/DB.ts): `backend/src/config/DB.ts`
- **PostgreSQL**
- [In-app notifications](https://github.com/thequietbeatle/nurserylink/blob/main/backend/src/services/notify.ts): `backend/src/services/notify.ts`
- [Email delivery](https://github.com/thequietbeatle/nurserylink/blob/main/backend/src/services/mailer.ts): `backend/src/services/mailer.ts`

### Other components

- **Visitor or user**
- **Resend**

## Connections

- Visitor or user → SPA routes: uses
- SPA routes → Sign-in: routes to (evidence: `NurseryLinkFront/src/App.tsx`)
- SPA routes → Parent dashboard: routes to (evidence: `NurseryLinkFront/src/App.tsx`)
- SPA routes → Child history: routes to (evidence: `NurseryLinkFront/src/App.tsx`)
- SPA routes → Notification inbox: routes to (evidence: `NurseryLinkFront/src/App.tsx`)
- SPA routes → Teacher roster: routes to (evidence: `NurseryLinkFront/src/App.tsx`)
- SPA routes → Admin portal: routes to (evidence: `NurseryLinkFront/src/App.tsx`)
- Sign-in → API client: authenticates via (evidence: `NurseryLinkFront/src/components/signpage/signing.tsx`)
- Parent dashboard → API client: fetches data via
- Child history → API client: fetches data via
- Notification inbox → API client: fetches data via (evidence: `NurseryLinkFront/src/components/parents/Events.tsx`)
- Teacher roster → API client: loads roster via (evidence: `NurseryLinkFront/src/components/teacher/TeacherDashboard.tsx`)
- Teacher roster → Roster card: renders (evidence: `NurseryLinkFront/src/components/teacher/TeacherDashboard.tsx`)
- Teacher roster → Care logging: opens forms (evidence: `NurseryLinkFront/src/components/teacher/TeacherDashboard.tsx`)
- Admin portal → Class management: provides management (evidence: `NurseryLinkFront/src/App.tsx`)
- Admin portal → Teacher management: provides management (evidence: `NurseryLinkFront/src/App.tsx`)
- Admin portal → Parent linkage: provides management (evidence: `NurseryLinkFront/src/App.tsx`)
- API client → API routes: fetches JSON
- API routes → Domain controllers: dispatches (evidence: `backend/src/app.ts`)
- API routes → Token and privilege checks: guards data routes
- Domain controllers → PostgreSQL pool: queries through (evidence: `backend/src/controllers/accountController.ts`)
- PostgreSQL pool → PostgreSQL: reads and writes
- Domain controllers → In-app notifications: creates notifications (evidence: `backend/src/controllers/notificationController.ts`)
- Domain controllers → Email delivery: sends email (evidence: `backend/src/controllers/notificationController.ts`)
- Email delivery → Resend: delivers through
