# Time Management Mac App

Native macOS WebKit wrapper for the Time Management portal.

## What it does

- Opens the live server first: `https://nitin.sbs/tim/`
- If the server is offline, opens the bundled local portal from the app.
- Keeps local browser storage, so you can continue working offline.
- When the server is online again, the portal uses the configured API base: `https://nitin.sbs/tim`

## Run on Mac

1. Install Xcode from the Mac App Store.
2. Open `Package.swift` in Xcode.
3. Select the `TimeManagementMac` scheme.
4. Press Run.

You can also try from Terminal:

```bash
cd macos/TimeManagementMac
swift run TimeManagementMac
```

## Important

The current sync model is whole-state sync. That means if you edit the same customer data on two devices while both are offline, the last device that saves after reconnect may overwrite the other. For a commercial multi-device product, the next upgrade should be record-level sync with conflict handling.
