# aitullalimon/workinghoursapp architecture

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

- Interactive diagram: https://gitdiagram.com/aitullalimon/workinghoursapp
- Repository: https://github.com/aitullalimon/workinghoursapp

## Overview

WorkingHoursApp is an iOS time-and-earnings tracker. Users manage companies and their billing rates, record or edit company-specific work entries, then review cross-company time lists, billing-cycle or custom-range invoice totals, and monthly summaries. Invoice summaries can create due or withdrawn payment records, which appear in the Payments tab. The shared DataStore connects the SwiftUI screens and is documented as persisting through UserDefaults. Models.swift was not sampled, so its detailed implementation and persistence wiring are represented only at the level supported by the README and view references.

Main entry points: [`Models.swift`](https://github.com/aitullalimon/workinghoursapp/blob/main/Models.swift) (Shared data store), [`ContentView.swift`](https://github.com/aitullalimon/workinghoursapp/blob/main/ContentView.swift) (Tab navigation), [`CompanyListView.swift`](https://github.com/aitullalimon/workinghoursapp/blob/main/CompanyListView.swift) (Company list), [`CompanyDetailView.swift`](https://github.com/aitullalimon/workinghoursapp/blob/main/CompanyDetailView.swift) (Company detail)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["App navigation"]
  node_app["App entry"]
  node_tabs["Tab navigation<br/>[ContentView.swift]"]
end

subgraph group_companies["Company management"]
  node_company_list["Company list"]
  node_add_company["Add company"]
  node_company_detail["Company detail"]
end

subgraph group_time["Time tracking"]
  node_entry_list["Time entry list"]
  node_add_entry["Add time entry"]
  node_edit_entry["Edit time entry"]
  node_models["Domain models<br/>[Models.swift]"]
  node_store["Shared data store<br/>[Models.swift]"]
end

subgraph group_earnings["Earnings and payments"]
  node_invoice["Invoice filters<br/>[InvoiceView.swift]"]
  node_invoice_summary["Invoice totals"]
  node_monthly_summary["Monthly summary"]
  node_payment_view["Payment records<br/>[PaymentView.swift]"]
end

node_user(("App user"))
node_user_defaults[("UserDefaults")]

node_user -->|"launches"| node_app
node_app -->|"shows"| node_tabs
node_app -->|"creates and injects"| node_store
node_tabs -->|"shows tab"| node_company_list
node_tabs -->|"shows tab"| node_entry_list
node_tabs -->|"shows tab"| node_invoice
node_tabs -->|"shows tab"| node_monthly_summary
node_tabs -->|"shows tab"| node_payment_view
node_company_list -->|"opens"| node_add_company
node_company_list -->|"opens"| node_company_detail
node_company_list -->|"reads and deletes"| node_store
node_add_company -->|"adds company"| node_store
node_company_detail -->|"reads and deletes entries"| node_store
node_company_detail -->|"opens"| node_add_entry
node_company_detail -->|"opens"| node_edit_entry
node_add_entry -->|"adds entry"| node_store
node_edit_entry -->|"updates or deletes entry"| node_store
node_entry_list -->|"reads and deletes entries"| node_store
node_invoice -->|"reads companies"| node_store
node_invoice -->|"passes company and period"| node_invoice_summary
node_invoice_summary -->|"reads entries; adds payment record"| node_store
node_monthly_summary -->|"reads companies and entries"| node_store
node_payment_view -->|"reads and deletes records"| node_store
node_store -->|"uses domain types"| node_models
node_store -->|"persists data"| node_user_defaults

click node_app "https://github.com/aitullalimon/workinghoursapp/blob/main/WorkingHoursAppApp.swift"
click node_tabs "https://github.com/aitullalimon/workinghoursapp/blob/main/ContentView.swift"
click node_company_list "https://github.com/aitullalimon/workinghoursapp/blob/main/CompanyListView.swift"
click node_add_company "https://github.com/aitullalimon/workinghoursapp/blob/main/AddCompanyView.swift"
click node_company_detail "https://github.com/aitullalimon/workinghoursapp/blob/main/CompanyDetailView.swift"
click node_entry_list "https://github.com/aitullalimon/workinghoursapp/blob/main/TimeEntryListView.swift"
click node_add_entry "https://github.com/aitullalimon/workinghoursapp/blob/main/AddTimeEntryView.swift"
click node_edit_entry "https://github.com/aitullalimon/workinghoursapp/blob/main/EditTimeEntryView.swift"
click node_invoice "https://github.com/aitullalimon/workinghoursapp/blob/main/InvoiceView.swift"
click node_invoice_summary "https://github.com/aitullalimon/workinghoursapp/blob/main/InvoiceSummaryView.swift"
click node_monthly_summary "https://github.com/aitullalimon/workinghoursapp/blob/main/MonthlySummaryView.swift"
click node_payment_view "https://github.com/aitullalimon/workinghoursapp/blob/main/PaymentView.swift"
click node_models "https://github.com/aitullalimon/workinghoursapp/blob/main/Models.swift"
click node_store "https://github.com/aitullalimon/workinghoursapp/blob/main/Models.swift"

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_tabs,node_user toneBlue
class node_company_list,node_add_company,node_company_detail,node_user_defaults toneAmber
class node_entry_list,node_add_entry,node_edit_entry,node_models,node_store toneMint
class node_invoice,node_invoice_summary,node_monthly_summary,node_payment_view toneRose
```

## Components

### App navigation

- [App entry](https://github.com/aitullalimon/workinghoursapp/blob/main/WorkingHoursAppApp.swift): `WorkingHoursAppApp.swift`
- [Tab navigation](https://github.com/aitullalimon/workinghoursapp/blob/main/ContentView.swift): `ContentView.swift`

### Company management

- [Company list](https://github.com/aitullalimon/workinghoursapp/blob/main/CompanyListView.swift): `CompanyListView.swift`
- [Add company](https://github.com/aitullalimon/workinghoursapp/blob/main/AddCompanyView.swift): `AddCompanyView.swift`
- [Company detail](https://github.com/aitullalimon/workinghoursapp/blob/main/CompanyDetailView.swift): `CompanyDetailView.swift`

### Time tracking

- [Time entry list](https://github.com/aitullalimon/workinghoursapp/blob/main/TimeEntryListView.swift): `TimeEntryListView.swift`
- [Add time entry](https://github.com/aitullalimon/workinghoursapp/blob/main/AddTimeEntryView.swift): `AddTimeEntryView.swift`
- [Edit time entry](https://github.com/aitullalimon/workinghoursapp/blob/main/EditTimeEntryView.swift): `EditTimeEntryView.swift`
- [Domain models](https://github.com/aitullalimon/workinghoursapp/blob/main/Models.swift): `Models.swift`
- [Shared data store](https://github.com/aitullalimon/workinghoursapp/blob/main/Models.swift): `Models.swift`

### Earnings and payments

- [Invoice filters](https://github.com/aitullalimon/workinghoursapp/blob/main/InvoiceView.swift): `InvoiceView.swift`
- [Invoice totals](https://github.com/aitullalimon/workinghoursapp/blob/main/InvoiceSummaryView.swift): `InvoiceSummaryView.swift`
- [Monthly summary](https://github.com/aitullalimon/workinghoursapp/blob/main/MonthlySummaryView.swift): `MonthlySummaryView.swift`
- [Payment records](https://github.com/aitullalimon/workinghoursapp/blob/main/PaymentView.swift): `PaymentView.swift`

### Other components

- **App user**
- **UserDefaults**

## Connections

- App user → App entry: launches
- App entry → Tab navigation: shows
- App entry → Shared data store: creates and injects
- Tab navigation → Company list: shows tab
- Tab navigation → Time entry list: shows tab
- Tab navigation → Invoice filters: shows tab
- Tab navigation → Monthly summary: shows tab
- Tab navigation → Payment records: shows tab
- Company list → Add company: opens
- Company list → Company detail: opens
- Company list → Shared data store: reads and deletes
- Add company → Shared data store: adds company
- Company detail → Shared data store: reads and deletes entries
- Company detail → Add time entry: opens
- Company detail → Edit time entry: opens
- Add time entry → Shared data store: adds entry
- Edit time entry → Shared data store: updates or deletes entry
- Time entry list → Shared data store: reads and deletes entries
- Invoice filters → Shared data store: reads companies
- Invoice filters → Invoice totals: passes company and period
- Invoice totals → Shared data store: reads entries; adds payment record
- Monthly summary → Shared data store: reads companies and entries
- Payment records → Shared data store: reads and deletes records
- Shared data store → Domain models: uses domain types
- Shared data store → UserDefaults: persists data
