# haimgoldest/baby-log architecture

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

- Interactive diagram: https://gitdiagram.com/haimgoldest/baby-log
- Repository: https://github.com/haimgoldest/baby-log

## Overview

Baby-Log is a shared baby-record web app for tracking events and growth and sharing updates with family. The main workflow is sign-in, select or create a baby, then record events or measurements; Firebase-backed services persist baby data. Preferences customize event favorites, while baby information supports profile and image management. The graph follows documented routes and sampled service/store calls; some feature-page-to-service links are unverified because those page sources were not sampled.

Main entry points: [`src/app/core/stores/session/session.store.ts`](https://github.com/haimgoldest/baby-log/blob/main/src/app/core/stores/session/session.store.ts) (Session store), [`src/app/app.routes.ts`](https://github.com/haimgoldest/baby-log/blob/main/src/app/app.routes.ts) (Routes and guard), [`src/app/app.component.ts`](https://github.com/haimgoldest/baby-log/blob/main/src/app/app.component.ts) (App shell), [`src/app/core/stores/babies/babies.store.ts`](https://github.com/haimgoldest/baby-log/blob/main/src/app/core/stores/babies/babies.store.ts) (Selected baby state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App shell"]
  node_shell["App shell<br/>[app.component.ts]"]
  node_routing["Routes and guard<br/>[app.routes.ts]"]
  node_navbar["Navigation bar"]
end

subgraph group_identity["Identity and state"]
  node_login["Sign-in page<br/>[login.page.ts]"]
  node_session["Session store<br/>[session.store.ts]"]
  node_auth["Authentication<br/>[auth.service.ts]"]
  node_userdata["User profile data<br/>[user.service.ts]"]
end

subgraph group_baby["Baby records"]
  node_babystore["Selected baby state<br/>[babies.store.ts]"]
  node_babyservice["Baby records service<br/>[babies.service.ts]"]
  node_babyinfo["Baby profile<br/>[baby-info.page.ts]"]
  node_addbaby["Add or link baby<br/>[add-baby.page.ts]"]
end

subgraph group_tracking["Tracking features"]
  node_events["Baby event log"]
  node_eventservice["Event operations"]
  node_preferences["Event preferences"]
  node_growth["Growth tracking"]
  node_measurements["Measurement operations"]
end

subgraph group_platform["Persistence and feedback"]
  node_firestore["Firestore adapter"]
  node_firestoredb[("Cloud Firestore")]
  node_storage[("Firebase Storage")]
  node_notifications["Notifications"]
  node_notificationhost["Notification display"]
end

node_family(("Family user"))

node_family -->|"uses"| node_shell
node_shell -->|"observes"| node_session
node_shell -->|"renders"| node_navbar
node_shell -->|"renders"| node_notificationhost
node_shell -->|"navigates via"| node_routing
node_routing -->|"routes to"| node_login
node_routing -->|"routes to"| node_events
node_routing -->|"routes to"| node_preferences
node_routing -->|"routes to"| node_growth
node_routing -->|"routes to"| node_addbaby
node_routing -->|"routes to"| node_babyinfo
node_login -->|"signs in via"| node_session
node_session -->|"authenticates with"| node_auth
node_session -->|"loads and saves"| node_userdata
node_session -->|"selects or clears"| node_babystore
node_session -.->|"persists user data through"| node_firestore
node_navbar -->|"reads state"| node_session
node_babystore -->|"loads and updates"| node_babyservice
node_babyservice -->|"reads and writes"| node_firestore
node_babyservice -->|"manages baby images"| node_storage
node_addbaby -->|"creates or links baby through"| node_session
node_babyinfo -->|"reads and updates"| node_babystore
node_events -.->|"uses"| node_eventservice
node_eventservice -->|"persists events through"| node_firestore
node_eventservice -->|"uses baby state"| node_babystore
node_preferences -->|"saves favorites through"| node_session
node_preferences -->|"reports outcomes via"| node_notifications
node_growth -.->|"uses"| node_measurements
node_measurements -->|"writes measurements through"| node_firestore
node_measurements -->|"reads selected baby"| node_babystore
node_firestore -->|"reads and writes"| node_firestoredb
node_notificationhost -->|"renders messages from"| node_notifications

click node_shell "https://github.com/haimgoldest/baby-log/blob/main/src/app/app.component.ts"
click node_routing "https://github.com/haimgoldest/baby-log/blob/main/src/app/app.routes.ts"
click node_navbar "https://github.com/haimgoldest/baby-log/blob/main/src/app/features/navbar/navbar.component.ts"
click node_login "https://github.com/haimgoldest/baby-log/blob/main/src/app/features/login/login.page.ts"
click node_session "https://github.com/haimgoldest/baby-log/blob/main/src/app/core/stores/session/session.store.ts"
click node_auth "https://github.com/haimgoldest/baby-log/blob/main/src/app/core/services/auth.service.ts"
click node_userdata "https://github.com/haimgoldest/baby-log/blob/main/src/app/core/services/user.service.ts"
click node_babystore "https://github.com/haimgoldest/baby-log/blob/main/src/app/core/stores/babies/babies.store.ts"
click node_babyservice "https://github.com/haimgoldest/baby-log/blob/main/src/app/core/services/babies.service.ts"
click node_babyinfo "https://github.com/haimgoldest/baby-log/blob/main/src/app/features/baby-info/baby-info.page.ts"
click node_addbaby "https://github.com/haimgoldest/baby-log/blob/main/src/app/features/add-baby/add-baby.page.ts"
click node_events "https://github.com/haimgoldest/baby-log/blob/main/src/app/features/baby-events/pages/baby-events.page.ts"
click node_eventservice "https://github.com/haimgoldest/baby-log/blob/main/src/app/features/baby-events/services/baby-events.service.ts"
click node_preferences "https://github.com/haimgoldest/baby-log/blob/main/src/app/features/baby-events/pages/baby-event-preferences.page.ts"
click node_growth "https://github.com/haimgoldest/baby-log/blob/main/src/app/features/growth-tracking/pages/growth-tracking.page.ts"
click node_measurements "https://github.com/haimgoldest/baby-log/blob/main/src/app/features/growth-tracking/services/baby-measurements.service.ts"
click node_firestore "https://github.com/haimgoldest/baby-log/blob/main/src/app/core/firebase/fire-store-helper.service.ts"
click node_notifications "https://github.com/haimgoldest/baby-log/blob/main/src/app/core/services/notification.service.ts"
click node_notificationhost "https://github.com/haimgoldest/baby-log/blob/main/src/app/shared/components/notification-host/notification-host.component.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_shell,node_routing,node_navbar,node_family toneBlue
class node_login,node_session,node_auth,node_userdata toneAmber
class node_babystore,node_babyservice,node_babyinfo,node_addbaby toneMint
class node_events,node_eventservice,node_preferences,node_growth,node_measurements toneRose
class node_firestore,node_firestoredb,node_storage,node_notifications,node_notificationhost toneIndigo
```

## Components

### App shell

- [App shell](https://github.com/haimgoldest/baby-log/blob/main/src/app/app.component.ts): `src/app/app.component.ts`
- [Routes and guard](https://github.com/haimgoldest/baby-log/blob/main/src/app/app.routes.ts): `src/app/app.routes.ts`
- [Navigation bar](https://github.com/haimgoldest/baby-log/blob/main/src/app/features/navbar/navbar.component.ts): `src/app/features/navbar/navbar.component.ts`

### Identity and state

- [Sign-in page](https://github.com/haimgoldest/baby-log/blob/main/src/app/features/login/login.page.ts): `src/app/features/login/login.page.ts`
- [Session store](https://github.com/haimgoldest/baby-log/blob/main/src/app/core/stores/session/session.store.ts): `src/app/core/stores/session/session.store.ts`
- [Authentication](https://github.com/haimgoldest/baby-log/blob/main/src/app/core/services/auth.service.ts): `src/app/core/services/auth.service.ts`
- [User profile data](https://github.com/haimgoldest/baby-log/blob/main/src/app/core/services/user.service.ts): `src/app/core/services/user.service.ts`

### Baby records

- [Selected baby state](https://github.com/haimgoldest/baby-log/blob/main/src/app/core/stores/babies/babies.store.ts): `src/app/core/stores/babies/babies.store.ts`
- [Baby records service](https://github.com/haimgoldest/baby-log/blob/main/src/app/core/services/babies.service.ts): `src/app/core/services/babies.service.ts`
- [Baby profile](https://github.com/haimgoldest/baby-log/blob/main/src/app/features/baby-info/baby-info.page.ts): `src/app/features/baby-info/baby-info.page.ts`
- [Add or link baby](https://github.com/haimgoldest/baby-log/blob/main/src/app/features/add-baby/add-baby.page.ts): `src/app/features/add-baby/add-baby.page.ts`

### Tracking features

- [Baby event log](https://github.com/haimgoldest/baby-log/blob/main/src/app/features/baby-events/pages/baby-events.page.ts): `src/app/features/baby-events/pages/baby-events.page.ts`
- [Event operations](https://github.com/haimgoldest/baby-log/blob/main/src/app/features/baby-events/services/baby-events.service.ts): `src/app/features/baby-events/services/baby-events.service.ts`
- [Event preferences](https://github.com/haimgoldest/baby-log/blob/main/src/app/features/baby-events/pages/baby-event-preferences.page.ts): `src/app/features/baby-events/pages/baby-event-preferences.page.ts`
- [Growth tracking](https://github.com/haimgoldest/baby-log/blob/main/src/app/features/growth-tracking/pages/growth-tracking.page.ts): `src/app/features/growth-tracking/pages/growth-tracking.page.ts`
- [Measurement operations](https://github.com/haimgoldest/baby-log/blob/main/src/app/features/growth-tracking/services/baby-measurements.service.ts): `src/app/features/growth-tracking/services/baby-measurements.service.ts`

### Persistence and feedback

- [Firestore adapter](https://github.com/haimgoldest/baby-log/blob/main/src/app/core/firebase/fire-store-helper.service.ts): `src/app/core/firebase/fire-store-helper.service.ts`
- **Cloud Firestore**
- **Firebase Storage**
- [Notifications](https://github.com/haimgoldest/baby-log/blob/main/src/app/core/services/notification.service.ts): `src/app/core/services/notification.service.ts`
- [Notification display](https://github.com/haimgoldest/baby-log/blob/main/src/app/shared/components/notification-host/notification-host.component.ts): `src/app/shared/components/notification-host/notification-host.component.ts`

### Other components

- **Family user**

## Connections

- Family user → App shell: uses (evidence: `README.md`)
- App shell → Session store: observes (evidence: `src/app/app.component.ts`)
- App shell → Navigation bar: renders (evidence: `src/app/app.component.ts`)
- App shell → Notification display: renders (evidence: `src/app/app.component.ts`)
- App shell → Routes and guard: navigates via (evidence: `src/app/app.component.ts`)
- Routes and guard → Sign-in page: routes to (evidence: `src/app/app.routes.ts`)
- Routes and guard → Baby event log: routes to (evidence: `src/app/app.routes.ts`)
- Routes and guard → Event preferences: routes to (evidence: `src/app/app.routes.ts`)
- Routes and guard → Growth tracking: routes to (evidence: `src/app/app.routes.ts`)
- Routes and guard → Add or link baby: routes to (evidence: `src/app/app.routes.ts`)
- Routes and guard → Baby profile: routes to (evidence: `src/app/app.routes.ts`)
- Sign-in page → Session store: signs in via (evidence: `src/app/features/login/login.page.ts`)
- Session store → Authentication: authenticates with (evidence: `src/app/core/stores/session/session.store.ts`)
- Session store → User profile data: loads and saves (evidence: `src/app/core/stores/session/session.store.ts`)
- Session store → Selected baby state: selects or clears (evidence: `src/app/core/stores/session/session.store.ts`)
- Session store → Firestore adapter: persists user data through
- Navigation bar → Session store: reads state (evidence: `src/app/features/navbar/navbar.component.ts`)
- Selected baby state → Baby records service: loads and updates (evidence: `src/app/core/stores/babies/babies.store.ts`)
- Baby records service → Firestore adapter: reads and writes (evidence: `src/app/core/services/babies.service.ts`)
- Baby records service → Firebase Storage: manages baby images (evidence: `src/app/core/services/babies.service.ts`)
- Add or link baby → Session store: creates or links baby through (evidence: `src/app/features/add-baby/add-baby.page.ts`)
- Baby profile → Selected baby state: reads and updates (evidence: `src/app/features/baby-info/baby-info.page.ts`)
- Baby event log → Event operations: uses
- Event operations → Firestore adapter: persists events through (evidence: `src/app/features/baby-events/services/baby-events.service.ts`)
- Event operations → Selected baby state: uses baby state (evidence: `src/app/features/baby-events/services/baby-events.service.ts`)
- Event preferences → Session store: saves favorites through (evidence: `src/app/features/baby-events/pages/baby-event-preferences.page.ts`)
- Event preferences → Notifications: reports outcomes via (evidence: `src/app/features/baby-events/pages/baby-event-preferences.page.ts`)
- Growth tracking → Measurement operations: uses (evidence: `src/app/features/growth-tracking/pages/growth-tracking.page.ts`)
- Measurement operations → Firestore adapter: writes measurements through (evidence: `src/app/features/growth-tracking/services/baby-measurements.service.ts`)
- Measurement operations → Selected baby state: reads selected baby (evidence: `src/app/features/growth-tracking/services/baby-measurements.service.ts`)
- Firestore adapter → Cloud Firestore: reads and writes (evidence: `src/app/core/firebase/fire-store-helper.service.ts`)
- Notification display → Notifications: renders messages from (evidence: `src/app/core/services/notification.service.ts`)
