Skip to content

About

Cadenza: iOS app + SwiftUI widget that tracks worked hours from your calendar. Expo, React Native.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Cadenza: Work-hours tracker

An iOS app that works out how many hours you've worked in a monthly period by reading your calendar, so you don't have to keep a timesheet.

Built with React Native, Expo and TypeScript, plus a native SwiftUI home-screen widget.

How it works

A day counts as worked when your calendar has an event whose title contains a word you choose (for example "Shift"). Each worked day is worth a set number of hours (8 by default). The dashboard then shows:

  • Worked: matching days up to today, in hours and days
  • Projected: all matching days in the current period, including ones already scheduled
  • A month calendar that colours past worked days and upcoming work days differently

Features

  • Reads the iOS system calendar through expo-calendar, so iCloud, Google and any other synced calendar works
  • Case-insensitive title matching, counted at most once per day
  • Configurable hours per day, and a pay period that can start on any day of the month
  • Choose which calendars to include
  • Home-screen widget (WidgetKit/SwiftUI) that reads the calendar live using the app's settings, which are shared through an App Group
  • Onboarding flow, plus light, dark and system themes
  • Unit tests for the period and aggregation logic

Tech stack

Area Choice
App Expo SDK 56, React Native 0.85, TypeScript
Routing expo-router
Calendar expo-calendar, react-native-calendars
Widget SwiftUI + WidgetKit via @bacons/apple-targets
Persistence AsyncStorage + App Group shared storage
Testing Jest (jest-expo)

Project structure

src/
├── app/                    # screens: dashboard, onboarding, settings
├── components/             # headline, work calendar, calendar picker, cards
├── hooks/use-work-data.ts  # fetches events and aggregates totals
└── lib/
    ├── period.ts           # pay-period boundaries (pure logic)
    ├── workdays.ts         # worked/projected aggregation (pure logic)
    ├── calendar.ts         # calendar access
    ├── settings.tsx        # user settings
    ├── widget-sync.ts      # mirrors settings to the widget's App Group
    └── __tests__/
targets/widget/             # native SwiftUI widget extension

Running locally

Calendar access and the widget need a development build, so Expo Go won't work:

npm install
npx expo run:ios   # build and launch on the iOS simulator or a device
npm test           # unit tests

Set the event title to match, hours per day, period start day and calendars on the in-app Settings screen.

About

Cadenza: iOS app + SwiftUI widget that tracks worked hours from your calendar. Expo, React Native.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages