Remove unused usePlatformService composable and document mixin architecture

- Delete unused usePlatformService.ts file
- Create architecture-decisions.md documenting mixin choice over composables
- Update README.md with architecture decision reference and usage guidance
- Document rationale: performance, consistency, developer experience
- Maintain established class-based component pattern with vue-facing-decorator
This commit is contained in:
Matthew Raymer
2025-07-02 11:27:18 +00:00
parent f4d2923916
commit 03e14371f6
5 changed files with 293 additions and 546 deletions

View File

@@ -88,18 +88,23 @@ Key principles:
### Database Architecture
The application uses a platform-agnostic database layer:
The application uses a platform-agnostic database layer with Vue mixins for service access:
* `src/services/PlatformService.ts` - Database interface definition
* `src/services/PlatformServiceFactory.ts` - Platform-specific service factory
* `src/services/AbsurdSqlDatabaseService.ts` - SQLite implementation
* `src/utils/PlatformServiceMixin.ts` - Vue mixin for database access with caching
* `src/db/` - Legacy Dexie database (migration in progress)
**Development Guidelines**:
- Always use `PlatformService` for database operations
- Always use `PlatformServiceMixin` for database operations in components
- Never import Dexie directly in application code
- Test with `USE_DEXIE_DB = false` for 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](doc/architecture-decisions.md) for detailed rationale.
### Kudos