[Time Safari](https://timesafari.org/) allows people to ease into collaboration: start with expressions of gratitude
and expand to crowd-fund with time & money, then record and see the impact of contributions.
## Database Migration Status
**Current Status**: The application is undergoing a migration from Dexie (IndexedDB) to SQLite using absurd-sql. This migration is in **Phase 2** with a well-defined migration fence in place.
### Migration Progress
- ✅ **SQLite Database Service**: Fully implemented with absurd-sql
- ✅ **Platform Service Layer**: Unified database interface across platforms
- ✅ **Settings Migration**: Core user settings transferred
- ✅ **Account Migration**: Identity and key management
- 🔄 **Contact Migration**: User contact data (via import interface)
- 📋 **Code Cleanup**: Remove unused Dexie imports
### Migration Fence
The migration is controlled by a **migration fence** that separates legacy Dexie code from the new SQLite implementation. See [Migration Fence Definition](doc/migration-fence-definition.md) for complete details.
**Key Points**:
- Legacy Dexie database is disabled by default (`USE_DEXIE_DB = false`)
- All database operations go through `PlatformService`
- Migration tools provide controlled access to both databases
- Clear separation between legacy and new code
### Migration Documentation
- [Migration Guide](doc/migration-to-wa-sqlite.md) - Complete migration process
- [Migration Fence Definition](doc/migration-fence-definition.md) - Fence boundaries and rules
See [project.task.yaml](project.task.yaml) for current priorities.
(Numbers at the beginning of lines are estimated hours. See [taskyaml.org](https://taskyaml.org/) for details.)
See [ClickUp](https://sharing.clickup.com/9014278710/l/h/8cmnyhp-174/10573fec74e2ba0) for current priorities.
## Setup & Building
Quick start:
* For setup, we recommend [pkgx](https://pkgx.dev), which installs what you need (either automatically or with the `dev` command). Core dependencies are typescript & npm; when building for other platforms, you'll need other things such as those in the pkgx.yaml & BUILDING.md files.
* For setup, we recommend [pkgx](https://pkgx.dev), which installs what you need (either automatically or with the `dev` command). Core dependencies are typescript & npm; when building for other platforms, you'll need other things such as those in the pkgx.yaml & doc/BUILDING.md files.
```bash
npm install
npm run dev
NODE_ENV=dev npm run start:web
```
See [BUILDING.md](BUILDING.md) for more details.
See [BUILDING.md](doc/BUILDING.md) for more details.
## Tests
@ -97,9 +70,6 @@ The application uses a platform-agnostic database layer:
**Development Guidelines**:
- Always use `PlatformService` for database operations
- Never import Dexie directly in application code
- Test with `USE_DEXIE_DB = false` for new features
- Use migration tools for data transfer between systems
@ -11,17 +11,6 @@ For a quick dev environment setup, use [pkgx](https://pkgx.dev).
- Git
- For desktop builds: Additional build tools based on your OS
## Forks
If you have forked this to make your own app, you'll want to customize the iOS & Android files. You can either edit existing ones, or you can remove the `ios` and `android` directories and regenerate them before the `npx cap sync` step in each setup.
```bash
npx cap add android
npx cap add ios
```
You'll also want to edit the deep link configuration (see below).
## Initial Setup
Install dependencies:
@ -33,7 +22,7 @@ Install dependencies:
## Web Dev Locally
```bash
npm run dev
NODE_ENV=dev npm run start:web
```
## Web Build for Server
@ -42,7 +31,7 @@ Install dependencies:
```bash
rm -rf dist
npm run build:web
NODE_ENV=prod npm run build:web
```
The built files will be in the `dist` directory.
@ -52,7 +41,7 @@ Install dependencies:
You'll likely want to use test locations for the Endorser & image & partner servers; see "DEFAULT_ENDORSER_API_SERVER" & "DEFAULT_IMAGE_API_SERVER" & "DEFAULT_PARTNER_API_SERVER" below.
```bash
npm run serve
NODE_ENV=dev npm run serve:web
```
### Compile and minify for test & production
@ -63,7 +52,7 @@ Install dependencies:
* Update the ClickUp tasks & CHANGELOG.md & the version in package.json, run `npm install`.
* Run a build to make sure package-lock version is updated, linting works, etc: `npm install && npm run build`
* Run a build to make sure package-lock version is updated, linting works, etc: `npm install && npm run build:web`
* Commit everything (since the commit hash is used the app).
@ -74,7 +63,7 @@ Install dependencies:
* For test, build the app (because test server is not yet set up to build):
3. The packaged applications will be in `dist-electron-packages/`:
@ -231,19 +220,19 @@ docker run -d \
1. Build the electron app in production mode:
```bash
npm run build:web
NODE_ENV=prod npm run build:web
npm run build:electron
npm run electron:build-mac
npm run build:electron-mac
```
2. Package the Electron app for macOS:
```bash
# For Intel Macs
npm run electron:build-mac
npm run build:electron-mac
# For Universal build (Intel + Apple Silicon)
npm run electron:build-mac-universal
npm run build:electron-mac-universal
```
3. The packaged applications will be in `dist-electron-packages/`:
@ -265,7 +254,7 @@ For public distribution on macOS, you need to code sign and notarize your app:
2. Build with signing:
```bash
npm run electron:build-mac
npm run build:electron-mac
```
### Running the Packaged App
@ -304,10 +293,10 @@ For testing the Electron build before packaging:
```bash
# Build and run in development mode (includes DevTools)
npm run electron:dev
npm run build:electron
# Build in production mode and test
npm run build:electron-prod && npm run electron:start
npm run build:electron-prod && npm run start:electron
```
## Mobile Builds (Capacitor)
@ -479,3 +468,12 @@ You must add the following intent filter to the `android/app/src/main/AndroidMan
```
... though when we tried that most recently it failed to 'build' the APK with: http(s) scheme and host attribute are missing, but are required for Android App Links [AppLinkUrlError]
## Forks
If you have forked this to make your own app, you'll want to customize the iOS & Android files. You can either edit existing ones, or you can remove the `ios` and `android` directories and regenerate them before the `npx cap sync` step in each setup.
@ -27,6 +27,32 @@ The Database Migration feature allows you to compare and migrate data between De
- Clear success and error messaging
- Export functionality for comparison data
## Database Migration Status
**Current Status**: The application is undergoing a migration from Dexie (IndexedDB) to SQLite using absurd-sql. This migration is in **Phase 2** with a well-defined migration fence in place.
### Migration Progress
- ✅ **SQLite Database Service**: Fully implemented with absurd-sql
- ✅ **Platform Service Layer**: Unified database interface across platforms
- ✅ **Settings Migration**: Core user settings transferred
- ✅ **Account Migration**: Identity and key management
- 🔄 **Contact Migration**: User contact data (via import interface)
- 📋 **Code Cleanup**: Remove unused Dexie imports
### Migration Fence
The migration is controlled by a **migration fence** that separates legacy Dexie code from the new SQLite implementation. See [Migration Fence Definition](doc/migration-fence-definition.md) for complete details.
**Key Points**:
- Legacy Dexie database is disabled by default (`USE_DEXIE_DB = false`)
- All database operations go through `PlatformService`
- Migration tools provide controlled access to both databases
- Clear separation between legacy and new code
### Migration Documentation
- [Migration Guide](doc/migration-to-wa-sqlite.md) - Complete migration process
- [Migration Fence Definition](doc/migration-fence-definition.md) - Fence boundaries and rules
*command:"cd ../endorser-ch; NODE_ENV=test-local npm run dev",
*command:"cd ../endorser-ch; NODE_ENV=test-local npm run start:web",
*url:'http://localhost:3000',
*reuseExistingServer:!process.env.CI,
*},
@ -112,7 +112,7 @@ export default defineConfig({
*/
webServer:{
command:
"VITE_APP_SERVER=http://localhost:8081 VITE_DEFAULT_ENDORSER_API_SERVER=http://localhost:3000 VITE_DEFAULT_PARTNER_API_SERVER=http://localhost:3000 VITE_DEFAULT_IMAGE_API_SERVER=https://test-image-api.timesafari.app VITE_PASSKEYS_ENABLED=true npm run dev -- --port=8081",
@ -437,19 +437,23 @@ export async function getHeaders(
}
headers["Authorization"]="Bearer "+token;
}catch(error){
// This rarely happens: we've seen it when they have account info but the
// encryption secret got lost. But in most cases we want users to at
// least see their feed -- and anything else that returns results for
// anonymous users.
// We'll continue with an anonymous request... still want to show feed and other things, but ideally let them know.
// This rarely happens: we've seen it when they have account info but the
// encryption secret got lost.
// Replicate this in Chrome: go to Storage and hit 'Clear site data'.
// Check the util.ts retrieveFullyDecryptedAccount method where it calls simpleDecrypt.
// In most cases we want users to at least see their feed -- and anything
// else that returns results for anonymous users.
// We'll continue with an anonymous request... still want to show feed
// and other things, but we need to let them know.
logConsoleAndDb(
"Something failed in getHeaders call (will proceed anonymously"+
($notify?" and notify user":"")+
"): "+
// IntelliJ type system complains about getCircularReplacer() with: Argument of type '(obj: any, key: string, value: any) => any' is not assignable to parameter of type '(this: any, key: string, value: any) => any'.
//JSON.stringify(error, getCircularReplacer()), // JSON.stringify(error) on a Dexie error throws another error about: Converting circular structure to JSON