# rachel-huthwaite/petty_university architecture

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

- Interactive diagram: https://gitdiagram.com/rachel-huthwaite/petty_university
- Repository: https://github.com/rachel-huthwaite/petty_university

## Overview

pettyUniversity is a Flutter venting-and-reflection app. A user creates a case by writing freely, decides whether to unpack it, names the underlying need, and may take an optional mindfulness pause; the case is then closed and retained alongside the need. The README documents the app’s navigation, local case persistence, and screen flow. Authentication components are visible in the tree, but their runtime wiring was not sampled, so those relationships are left unverified.

Main entry points: [`lib/providers/case_provider.dart`](https://github.com/rachel-huthwaite/petty_university/blob/main/lib/providers/case_provider.dart) (Case state and persistence), [`lib/main.dart`](https://github.com/rachel-huthwaite/petty_university/blob/main/lib/main.dart) (App entry and routing), [`lib/screens/home_screen.dart`](https://github.com/rachel-huthwaite/petty_university/blob/main/lib/screens/home_screen.dart) (Home screen), [`lib/screens/add_entry_screen.dart`](https://github.com/rachel-huthwaite/petty_university/blob/main/lib/screens/add_entry_screen.dart) (Vent and view case)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and access"]
  node_main["App entry and routing<br/>[main.dart]"]
  node_authgate["Auth gate<br/>[auth_gate.dart]"]
  node_login["Login screen<br/>[login_screen.dart]"]
  node_authservice["Authentication service<br/>[auth_service.dart]"]
end

subgraph group_cases["Case management"]
  node_home["Home screen<br/>[home_screen.dart]"]
  node_addentry["Vent and view case"]
  node_caseslist["Case archive and filters<br/>[cases_screen.dart]"]
  node_caseprovider["Case state and persistence<br/>[case_provider.dart]"]
  node_caseentry["Case entry model<br/>[case_entry.dart]"]
end

subgraph group_reflection["Unpack reflection"]
  node_unpackprompt["Unpack decision"]
  node_nameneed["Name the need"]
  node_selectneeds["Select or write need"]
  node_mindprompt["Mindfulness choice"]
  node_mindtimer["Mindfulness timer"]
end

subgraph group_support["Shared services"]
  node_prefs[("Local preferences")]
  node_theme["Theme and constants<br/>[app_theme.dart]"]
  node_constants["App constants<br/>[app_constants.dart]"]
  node_glass["Glass container"]
  node_pill["Pill button<br/>[pill_button.dart]"]
end

node_user(("User"))
node_firebaseauth{{"Firebase Authentication"}}

node_user -->|"opens app"| node_main
node_main -->|"routes to"| node_home
node_home -->|"starts entry"| node_addentry
node_home -->|"opens archive"| node_caseslist
node_addentry -->|"saves case"| node_caseprovider
node_caseprovider -->|"manages"| node_caseentry
node_caseprovider -->|"persists locally"| node_prefs
node_caseslist -->|"reads cases"| node_caseprovider
node_addentry -->|"offers unpacking"| node_unpackprompt
node_unpackprompt -->|"continues reflection"| node_nameneed
node_nameneed -->|"opens selection"| node_selectneeds
node_selectneeds -->|"closes case"| node_caseprovider
node_selectneeds -->|"offers pause"| node_mindprompt
node_mindprompt -->|"starts timer"| node_mindtimer
node_main -.->|"configures access"| node_authgate
node_authgate -.->|"routes to"| node_login
node_authservice -.->|"uses authentication"| node_firebaseauth

click node_main "https://github.com/rachel-huthwaite/petty_university/blob/main/lib/main.dart"
click node_authgate "https://github.com/rachel-huthwaite/petty_university/blob/main/lib/widgets/auth_gate.dart"
click node_login "https://github.com/rachel-huthwaite/petty_university/blob/main/lib/screens/login_screen.dart"
click node_authservice "https://github.com/rachel-huthwaite/petty_university/blob/main/lib/services/auth_service.dart"
click node_home "https://github.com/rachel-huthwaite/petty_university/blob/main/lib/screens/home_screen.dart"
click node_addentry "https://github.com/rachel-huthwaite/petty_university/blob/main/lib/screens/add_entry_screen.dart"
click node_caseslist "https://github.com/rachel-huthwaite/petty_university/blob/main/lib/screens/cases_screen.dart"
click node_caseprovider "https://github.com/rachel-huthwaite/petty_university/blob/main/lib/providers/case_provider.dart"
click node_caseentry "https://github.com/rachel-huthwaite/petty_university/blob/main/lib/models/case_entry.dart"
click node_unpackprompt "https://github.com/rachel-huthwaite/petty_university/blob/main/lib/screens/unpack/unpack_prompt_screen.dart"
click node_nameneed "https://github.com/rachel-huthwaite/petty_university/blob/main/lib/screens/unpack/name_need_screen.dart"
click node_selectneeds "https://github.com/rachel-huthwaite/petty_university/blob/main/lib/screens/unpack/select_needs_screen.dart"
click node_mindprompt "https://github.com/rachel-huthwaite/petty_university/blob/main/lib/screens/unpack/mindfulness_prompt_screen.dart"
click node_mindtimer "https://github.com/rachel-huthwaite/petty_university/blob/main/lib/screens/unpack/mindfulness_timer_screen.dart"
click node_theme "https://github.com/rachel-huthwaite/petty_university/blob/main/lib/theme/app_theme.dart"
click node_constants "https://github.com/rachel-huthwaite/petty_university/blob/main/lib/theme/app_constants.dart"
click node_glass "https://github.com/rachel-huthwaite/petty_university/blob/main/lib/widgets/glass_container.dart"
click node_pill "https://github.com/rachel-huthwaite/petty_university/blob/main/lib/widgets/pill_button.dart"

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_main,node_authgate,node_login,node_authservice,node_user toneBlue
class node_home,node_addentry,node_caseslist,node_caseprovider,node_caseentry toneAmber
class node_unpackprompt,node_nameneed,node_selectneeds,node_mindprompt,node_mindtimer toneMint
class node_prefs,node_theme,node_constants,node_glass,node_pill toneRose
class node_firebaseauth toneIndigo
```

## Components

### App and access

- [App entry and routing](https://github.com/rachel-huthwaite/petty_university/blob/main/lib/main.dart): `lib/main.dart`
- [Auth gate](https://github.com/rachel-huthwaite/petty_university/blob/main/lib/widgets/auth_gate.dart): `lib/widgets/auth_gate.dart`
- [Login screen](https://github.com/rachel-huthwaite/petty_university/blob/main/lib/screens/login_screen.dart): `lib/screens/login_screen.dart`
- [Authentication service](https://github.com/rachel-huthwaite/petty_university/blob/main/lib/services/auth_service.dart): `lib/services/auth_service.dart`

### Case management

- [Home screen](https://github.com/rachel-huthwaite/petty_university/blob/main/lib/screens/home_screen.dart): `lib/screens/home_screen.dart`
- [Vent and view case](https://github.com/rachel-huthwaite/petty_university/blob/main/lib/screens/add_entry_screen.dart): `lib/screens/add_entry_screen.dart`
- [Case archive and filters](https://github.com/rachel-huthwaite/petty_university/blob/main/lib/screens/cases_screen.dart): `lib/screens/cases_screen.dart`
- [Case state and persistence](https://github.com/rachel-huthwaite/petty_university/blob/main/lib/providers/case_provider.dart): `lib/providers/case_provider.dart`
- [Case entry model](https://github.com/rachel-huthwaite/petty_university/blob/main/lib/models/case_entry.dart): `lib/models/case_entry.dart`

### Unpack reflection

- [Unpack decision](https://github.com/rachel-huthwaite/petty_university/blob/main/lib/screens/unpack/unpack_prompt_screen.dart): `lib/screens/unpack/unpack_prompt_screen.dart`
- [Name the need](https://github.com/rachel-huthwaite/petty_university/blob/main/lib/screens/unpack/name_need_screen.dart): `lib/screens/unpack/name_need_screen.dart`
- [Select or write need](https://github.com/rachel-huthwaite/petty_university/blob/main/lib/screens/unpack/select_needs_screen.dart): `lib/screens/unpack/select_needs_screen.dart`
- [Mindfulness choice](https://github.com/rachel-huthwaite/petty_university/blob/main/lib/screens/unpack/mindfulness_prompt_screen.dart): `lib/screens/unpack/mindfulness_prompt_screen.dart`
- [Mindfulness timer](https://github.com/rachel-huthwaite/petty_university/blob/main/lib/screens/unpack/mindfulness_timer_screen.dart): `lib/screens/unpack/mindfulness_timer_screen.dart`

### Shared services

- **Local preferences**
- [Theme and constants](https://github.com/rachel-huthwaite/petty_university/blob/main/lib/theme/app_theme.dart): `lib/theme/app_theme.dart`
- [App constants](https://github.com/rachel-huthwaite/petty_university/blob/main/lib/theme/app_constants.dart): `lib/theme/app_constants.dart`
- [Glass container](https://github.com/rachel-huthwaite/petty_university/blob/main/lib/widgets/glass_container.dart): `lib/widgets/glass_container.dart`
- [Pill button](https://github.com/rachel-huthwaite/petty_university/blob/main/lib/widgets/pill_button.dart): `lib/widgets/pill_button.dart`

### Other components

- **User**
- **Firebase Authentication**

## Connections

- User → App entry and routing: opens app (evidence: `README.md`)
- App entry and routing → Home screen: routes to (evidence: `README.md`)
- Home screen → Vent and view case: starts entry (evidence: `README.md`)
- Home screen → Case archive and filters: opens archive (evidence: `README.md`)
- Vent and view case → Case state and persistence: saves case (evidence: `README.md`)
- Case state and persistence → Case entry model: manages (evidence: `README.md`)
- Case state and persistence → Local preferences: persists locally (evidence: `README.md`)
- Case archive and filters → Case state and persistence: reads cases (evidence: `README.md`)
- Vent and view case → Unpack decision: offers unpacking (evidence: `README.md`)
- Unpack decision → Name the need: continues reflection (evidence: `README.md`)
- Name the need → Select or write need: opens selection (evidence: `README.md`)
- Select or write need → Case state and persistence: closes case (evidence: `README.md`)
- Select or write need → Mindfulness choice: offers pause (evidence: `README.md`)
- Mindfulness choice → Mindfulness timer: starts timer (evidence: `README.md`)
- App entry and routing → Auth gate: configures access
- Auth gate → Login screen: routes to
- Authentication service → Firebase Authentication: uses authentication
