Remove CORS headers to enable universal image support and fix local API server settings. ## Changes **Remove CORS Headers** - Remove Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy headers - Enables images from any domain (Facebook, Medium, arbitrary websites) - Database falls back to IndexedDB mode (minimal performance impact) **Fix Local Development Configuration** - Set LOCAL_ENDORSER_API_SERVER to http://127.0.0.1:3000 (was "/api") - Create .env.development with local API server config - Fix ensureCorrectApiServer() method in HomeView.vue - "Use Local" button now sets proper localhost address **Fix Settings Cache Issues** - Add PlatformServiceMixin to AccountViewView.vue - Disable settings caching to prevent stale data - Settings changes now apply immediately without browser refresh ## Impact **Tradeoffs:** - Lost: ~2x SharedArrayBuffer database performance - Gained: Universal image support from any domain - Result: Better user experience, database still fast via IndexedDB **Files Modified:** - Configuration: vite.config.*.mts, index.html, .env.development - Source: constants/app.ts, libs/util.ts, views/*.vue, utils/PlatformServiceMixin.ts ## Rationale For a community platform, universal image support is more critical than marginal database performance gains. Users share images from arbitrary websites, making CORS restrictions incompatible with Time Safari's core mission.
TimeSafari.app - Crowd-Funder for Time - PWA
Time Safari 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 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 - Complete migration process
- Migration Fence Definition - Fence boundaries and rules
- Database Migration Guide - User-facing migration tools
Roadmap
See project.task.yaml for current priorities. (Numbers at the beginning of lines are estimated hours. See taskyaml.org for details.)
Setup & Building
Quick start:
- For setup, we recommend pkgx, which installs what you need (either automatically or with the
devcommand). 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.
npm install
npm run dev
See BUILDING.md for more details.
Tests
See TESTING.md for detailed test instructions.
Icons
Application icons are in the assets directory, processed by the capacitor-assets command.
To add a Font Awesome icon, add to main.ts and reference with font-awesome element and icon attribute with the hyphenated name.
Other
Reference Material
-
Notifications can be type of
toast(self-dismiss),info,success,warning, anddanger. They are done via notiwind and set up in App.vue. -
If you are deploying in a subdirectory, add it to
publicPathin vue.config.js, eg:publicPath: "/app/time-tracker/",
Code Organization
The project uses a centralized approach to type definitions and interfaces:
src/interfaces/- Contains all TypeScript interfaces and type definitionsdeepLinks.ts- Deep linking type system and Zod validation schemasgive.ts- Give-related interfaces and type definitionsclaims.ts- Claim-related interfaces and verifiable credentialscommon.ts- Shared interfaces and utility types- Other domain-specific interface files
Key principles:
- All interfaces and types are defined in the interfaces folder
- Zod schemas are used for runtime validation and type generation
- Domain-specific interfaces are separated into their own files
- Common interfaces are shared through
common.ts - Type definitions are generated from Zod schemas where possible
Database Architecture
The application uses a platform-agnostic database layer with Vue mixins for service access:
src/services/PlatformService.ts- Database interface definitionsrc/services/PlatformServiceFactory.ts- Platform-specific service factorysrc/services/AbsurdSqlDatabaseService.ts- SQLite implementationsrc/utils/PlatformServiceMixin.ts- Vue mixin for database access with cachingsrc/db/- Legacy Dexie database (migration in progress)
Development Guidelines:
- Always use
PlatformServiceMixinfor database operations in components - Never import Dexie directly in application code
- Test with
USE_DEXIE_DB = falsefor new features - Use migration tools for data transfer between systems
- Leverage mixin's ultra-concise methods:
$db(),$exec(),$one(),$contacts(),$settings()
Architecture Decision: The project uses Vue mixins over Composition API composables for platform service access. See Architecture Decisions for detailed rationale.
Kudos
Gifts make the world go 'round!
- WebStorm by JetBrains for the free open-source license
- Máximo Fernández for the 3D code and explanatory post
- Many tools & libraries such as Nodejs.org, IntelliJ Idea, Veramo.io, Vuejs.org, threejs.org
- Bush 3D model
- Forest floor image
- Time Safari logo assisted by DALL-E in ChatGPT
- DiceBear and Avataaars for human-looking identicons
- Some gratitude prompts thanks to Develop Good Habits