# jiaquan81516/is216_project architecture

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

- Interactive diagram: https://gitdiagram.com/jiaquan81516/is216_project
- Repository: https://github.com/jiaquan81516/is216_project

## Overview

NurtureTrack is a shared newborn-care web app for parents and caregivers, with administrator tools. Users enter through role-aware sign-in and onboarding, then use household, care-tracking, scheduling, wellbeing, and support features; administrators also manage community rooms and content. The Vue client uses Firebase, with Vercel serverless endpoints for selected operations and optional Google Calendar and push integrations. The graph preserves documented feature areas, but unsampled page and API internals limit evidence for their individual call paths.

Main entry points: [`src/app/composables/useAuth.js`](https://github.com/jiaquan81516/is216_project/blob/main/src/app/composables/useAuth.js) (Sign-in onboarding), [`src/router/appRoutes.js`](https://github.com/jiaquan81516/is216_project/blob/main/src/router/appRoutes.js) (Routes and guards), [`src/app/pages/home/index.vue`](https://github.com/jiaquan81516/is216_project/blob/main/src/app/pages/home/index.vue) (Care home), [`src/app/composables/useGoogleCalendarClient.js`](https://github.com/jiaquan81516/is216_project/blob/main/src/app/composables/useGoogleCalendarClient.js) (Calendar sync state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["App and access"]
  node_router["Routes and guards<br/>[appRoutes.js]"]
  node_authflow["Sign-in onboarding<br/>[useAuth.js]"]
  node_shell["App shell<br/>[AppShell.vue]"]
end

subgraph group_care["Care workflows"]
  node_household["Household setup<br/>[index.vue]"]
  node_home["Care home<br/>[index.vue]"]
  node_carelog["Care logs<br/>[index.vue]"]
  node_checklist["Care checklist<br/>[index.vue]"]
  node_calendar["Calendar scheduling<br/>[index.vue]"]
  node_rota["Shared rota<br/>[index.vue]"]
  node_wellness["Wellbeing<br/>[index.vue]"]
  node_carebrief["Care brief<br/>[index.vue]"]
  node_taskstore["Task state<br/>[tasks.js]"]
  node_googlestate["Calendar sync state"]
end

subgraph group_community["Support and rooms"]
  node_support["Support guides<br/>[index.vue]"]
  node_rooms["Pumping rooms<br/>[index.vue]"]
  node_roomadmin["Room administration<br/>[RoomManager.vue]"]
end

subgraph group_services["Data and integrations"]
  node_firebaseauth["Firebase auth<br/>[firebase.js]"]
  node_profiles["User profiles<br/>[profile.js]"]
  node_firestore[("Cloud Firestore<br/>[db.js]")]
  node_tasksapi["Task data access<br/>[tasks.js]"]
  node_googleclient["Browser Calendar sync"]
  node_serverapi["Serverless API<br/>[sync.js]"]
  node_serverauth["Request authentication<br/>[auth.js]"]
  node_adminsdk[("Firebase Admin<br/>[admin.js]")]
  node_push["Web push<br/>[push.js]"]
end

node_user(("Parent or caregiver"))
node_admin(("Administrator"))

node_user -->|"opens app"| node_router
node_router -->|"checks identity"| node_authflow
node_router -->|"routes pages"| node_shell
node_authflow -->|"signs in"| node_firebaseauth
node_authflow -->|"loads profile"| node_profiles
node_authflow -->|"continues setup"| node_household
node_user -->|"uses care tools"| node_home
node_home -.->|"records care"| node_carelog
node_home -.->|"tracks tasks"| node_checklist
node_user -->|"plans care"| node_calendar
node_user -->|"shares schedules"| node_rota
node_user -->|"checks wellbeing"| node_wellness
node_user -->|"views care brief"| node_carebrief
node_user -->|"finds guidance"| node_support
node_user -->|"finds rooms"| node_rooms
node_admin -->|"manages rooms"| node_roomadmin
node_roomadmin -->|"saves feedback"| node_firestore
node_taskstore -->|"loads tasks"| node_tasksapi
node_tasksapi -->|"reads data"| node_firestore
node_googlestate -->|"connects account"| node_googleclient
node_googlestate -->|"runs sync"| node_serverapi
node_serverapi -->|"verifies caller"| node_serverauth
node_serverauth -->|"verifies token"| node_adminsdk
node_user -->|"receives alerts"| node_push
node_user -->|"opts into sync"| node_googlestate

click node_router "https://github.com/jiaquan81516/is216_project/blob/main/src/router/appRoutes.js"
click node_authflow "https://github.com/jiaquan81516/is216_project/blob/main/src/app/composables/useAuth.js"
click node_firebaseauth "https://github.com/jiaquan81516/is216_project/blob/main/src/api/firebase.js"
click node_profiles "https://github.com/jiaquan81516/is216_project/blob/main/src/api/profile.js"
click node_shell "https://github.com/jiaquan81516/is216_project/blob/main/src/app/layouts/AppShell.vue"
click node_household "https://github.com/jiaquan81516/is216_project/blob/main/src/app/pages/household/index.vue"
click node_home "https://github.com/jiaquan81516/is216_project/blob/main/src/app/pages/home/index.vue"
click node_carelog "https://github.com/jiaquan81516/is216_project/blob/main/src/app/pages/care-log/index.vue"
click node_checklist "https://github.com/jiaquan81516/is216_project/blob/main/src/app/pages/checklist/index.vue"
click node_calendar "https://github.com/jiaquan81516/is216_project/blob/main/src/app/pages/calendar/index.vue"
click node_rota "https://github.com/jiaquan81516/is216_project/blob/main/src/app/pages/rota/index.vue"
click node_wellness "https://github.com/jiaquan81516/is216_project/blob/main/src/app/pages/wellness/index.vue"
click node_carebrief "https://github.com/jiaquan81516/is216_project/blob/main/src/app/pages/care-brief/index.vue"
click node_support "https://github.com/jiaquan81516/is216_project/blob/main/src/app/pages/support/index.vue"
click node_rooms "https://github.com/jiaquan81516/is216_project/blob/main/src/app/pages/pumping-rooms/index.vue"
click node_roomadmin "https://github.com/jiaquan81516/is216_project/blob/main/src/app/components/RoomManager.vue"
click node_firestore "https://github.com/jiaquan81516/is216_project/blob/main/src/api/db.js"
click node_tasksapi "https://github.com/jiaquan81516/is216_project/blob/main/src/api/tasks.js"
click node_taskstore "https://github.com/jiaquan81516/is216_project/blob/main/src/app/stores/tasks.js"
click node_googleclient "https://github.com/jiaquan81516/is216_project/blob/main/src/api/googleCalendarClient.js"
click node_googlestate "https://github.com/jiaquan81516/is216_project/blob/main/src/app/composables/useGoogleCalendarClient.js"
click node_serverapi "https://github.com/jiaquan81516/is216_project/blob/main/api/google/sync.js"
click node_serverauth "https://github.com/jiaquan81516/is216_project/blob/main/api/_lib/auth.js"
click node_adminsdk "https://github.com/jiaquan81516/is216_project/blob/main/api/_lib/admin.js"
click node_push "https://github.com/jiaquan81516/is216_project/blob/main/src/api/push.js"

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_router,node_authflow,node_shell toneBlue
class node_household,node_home,node_carelog,node_checklist,node_calendar,node_rota,node_wellness,node_carebrief,node_taskstore,node_googlestate toneAmber
class node_support,node_rooms,node_roomadmin toneMint
class node_firebaseauth,node_profiles,node_firestore,node_tasksapi,node_googleclient,node_serverapi,node_serverauth,node_adminsdk,node_push toneRose
class node_user,node_admin toneIndigo
```

## Components

### App and access

- [Routes and guards](https://github.com/jiaquan81516/is216_project/blob/main/src/router/appRoutes.js): `src/router/appRoutes.js`
- [Sign-in onboarding](https://github.com/jiaquan81516/is216_project/blob/main/src/app/composables/useAuth.js): `src/app/composables/useAuth.js`
- [App shell](https://github.com/jiaquan81516/is216_project/blob/main/src/app/layouts/AppShell.vue): `src/app/layouts/AppShell.vue`

### Care workflows

- [Household setup](https://github.com/jiaquan81516/is216_project/blob/main/src/app/pages/household/index.vue): `src/app/pages/household/index.vue`
- [Care home](https://github.com/jiaquan81516/is216_project/blob/main/src/app/pages/home/index.vue): `src/app/pages/home/index.vue`
- [Care logs](https://github.com/jiaquan81516/is216_project/blob/main/src/app/pages/care-log/index.vue): `src/app/pages/care-log/index.vue`
- [Care checklist](https://github.com/jiaquan81516/is216_project/blob/main/src/app/pages/checklist/index.vue): `src/app/pages/checklist/index.vue`
- [Calendar scheduling](https://github.com/jiaquan81516/is216_project/blob/main/src/app/pages/calendar/index.vue): `src/app/pages/calendar/index.vue`
- [Shared rota](https://github.com/jiaquan81516/is216_project/blob/main/src/app/pages/rota/index.vue): `src/app/pages/rota/index.vue`
- [Wellbeing](https://github.com/jiaquan81516/is216_project/blob/main/src/app/pages/wellness/index.vue): `src/app/pages/wellness/index.vue`
- [Care brief](https://github.com/jiaquan81516/is216_project/blob/main/src/app/pages/care-brief/index.vue): `src/app/pages/care-brief/index.vue`
- [Task state](https://github.com/jiaquan81516/is216_project/blob/main/src/app/stores/tasks.js): `src/app/stores/tasks.js`
- [Calendar sync state](https://github.com/jiaquan81516/is216_project/blob/main/src/app/composables/useGoogleCalendarClient.js): `src/app/composables/useGoogleCalendarClient.js`

### Support and rooms

- [Support guides](https://github.com/jiaquan81516/is216_project/blob/main/src/app/pages/support/index.vue): `src/app/pages/support/index.vue`
- [Pumping rooms](https://github.com/jiaquan81516/is216_project/blob/main/src/app/pages/pumping-rooms/index.vue): `src/app/pages/pumping-rooms/index.vue`
- [Room administration](https://github.com/jiaquan81516/is216_project/blob/main/src/app/components/RoomManager.vue): `src/app/components/RoomManager.vue`

### Data and integrations

- [Firebase auth](https://github.com/jiaquan81516/is216_project/blob/main/src/api/firebase.js): `src/api/firebase.js`
- [User profiles](https://github.com/jiaquan81516/is216_project/blob/main/src/api/profile.js): `src/api/profile.js`
- [Cloud Firestore](https://github.com/jiaquan81516/is216_project/blob/main/src/api/db.js): `src/api/db.js`
- [Task data access](https://github.com/jiaquan81516/is216_project/blob/main/src/api/tasks.js): `src/api/tasks.js`
- [Browser Calendar sync](https://github.com/jiaquan81516/is216_project/blob/main/src/api/googleCalendarClient.js): `src/api/googleCalendarClient.js`
- [Serverless API](https://github.com/jiaquan81516/is216_project/blob/main/api/google/sync.js): `api/google/sync.js`
- [Request authentication](https://github.com/jiaquan81516/is216_project/blob/main/api/_lib/auth.js): `api/_lib/auth.js`
- [Firebase Admin](https://github.com/jiaquan81516/is216_project/blob/main/api/_lib/admin.js): `api/_lib/admin.js`
- [Web push](https://github.com/jiaquan81516/is216_project/blob/main/src/api/push.js): `src/api/push.js`

### Other components

- **Parent or caregiver**
- **Administrator**

## Connections

- Parent or caregiver → Routes and guards: opens app (evidence: `README.md`)
- Routes and guards → Sign-in onboarding: checks identity (evidence: `src/router/appRoutes.js`)
- Routes and guards → App shell: routes pages (evidence: `src/router/appRoutes.js`)
- Sign-in onboarding → Firebase auth: signs in
- Sign-in onboarding → User profiles: loads profile (evidence: `src/app/composables/useAuth.js`)
- Sign-in onboarding → Household setup: continues setup
- Parent or caregiver → Care home: uses care tools (evidence: `README.md`)
- Care home → Care logs: records care
- Care home → Care checklist: tracks tasks
- Parent or caregiver → Calendar scheduling: plans care (evidence: `README.md`)
- Parent or caregiver → Shared rota: shares schedules (evidence: `README.md`)
- Parent or caregiver → Wellbeing: checks wellbeing (evidence: `README.md`)
- Parent or caregiver → Care brief: views care brief (evidence: `README.md`)
- Parent or caregiver → Support guides: finds guidance (evidence: `README.md`)
- Parent or caregiver → Pumping rooms: finds rooms (evidence: `README.md`)
- Administrator → Room administration: manages rooms (evidence: `README.md`)
- Room administration → Cloud Firestore: saves feedback
- Task state → Task data access: loads tasks (evidence: `src/app/stores/tasks.js`)
- Task data access → Cloud Firestore: reads data (evidence: `src/api/tasks.js`)
- Calendar sync state → Browser Calendar sync: connects account (evidence: `src/app/composables/useGoogleCalendarClient.js`)
- Calendar sync state → Serverless API: runs sync (evidence: `src/app/composables/useGoogleCalendarClient.js`)
- Serverless API → Request authentication: verifies caller (evidence: `api/google/sync.js`)
- Request authentication → Firebase Admin: verifies token (evidence: `api/_lib/auth.js`)
- Parent or caregiver → Web push: receives alerts (evidence: `README.md`)
- Parent or caregiver → Calendar sync state: opts into sync (evidence: `README.md`)
