forked from trent_larson/crowd-funder-for-time-pwa
docs: comprehensive documentation updates and modernization
- Update BUILDING.md with current build system information - Modernize various README files across the project - Update CHANGELOG.md with recent changes - Improve documentation consistency and formatting - Update platform-specific documentation (iOS, Electron, Docker) - Enhance test documentation and build guides
This commit is contained in:
@@ -9,6 +9,7 @@ This document defines the **migration fence** - the boundary between the legacy
|
||||
## Current Migration Status
|
||||
|
||||
### ✅ Completed Components
|
||||
|
||||
- **SQLite Database Service**: Fully implemented with absurd-sql
|
||||
- **Platform Service Layer**: Unified database interface across platforms
|
||||
- **PlatformServiceMixin**: Centralized database access with caching and utilities
|
||||
@@ -17,12 +18,14 @@ This document defines the **migration fence** - the boundary between the legacy
|
||||
- **Data Export/Import**: Backup and restore functionality
|
||||
|
||||
### 🔄 Active Migration Components
|
||||
|
||||
- **Settings Migration**: Core user settings transferred
|
||||
- **Account Migration**: Identity and key management
|
||||
- **Contact Migration**: User contact data (via import interface)
|
||||
- **DatabaseUtil Migration**: Moving functions to PlatformServiceMixin
|
||||
|
||||
### ❌ Legacy Components (Fence Boundary)
|
||||
|
||||
- **Dexie Database**: Legacy IndexedDB storage (disabled by default)
|
||||
- **Dexie-Specific Code**: Direct database access patterns
|
||||
- **Legacy Migration Paths**: Old data transfer methods
|
||||
@@ -45,6 +48,7 @@ export const PlatformServiceMixin = {
|
||||
```
|
||||
|
||||
**Fence Rule**: All database operations must use:
|
||||
|
||||
- `this.$db()` for read operations
|
||||
- `this.$exec()` for write operations
|
||||
- `this.$settings()` for settings access
|
||||
@@ -64,6 +68,7 @@ export class PlatformServiceFactory {
|
||||
```
|
||||
|
||||
**Fence Rule**: All database operations must use:
|
||||
|
||||
- `PlatformService.dbQuery()` for read operations
|
||||
- `PlatformService.dbExec()` for write operations
|
||||
- No direct `db.` or `accountsDBPromise` access in application code
|
||||
@@ -71,6 +76,7 @@ export class PlatformServiceFactory {
|
||||
### 3. Data Access Patterns
|
||||
|
||||
#### ✅ Allowed (Inside Fence)
|
||||
|
||||
```typescript
|
||||
// Use PlatformServiceMixin for all database operations
|
||||
const contacts = await this.$contacts();
|
||||
@@ -79,6 +85,7 @@ const result = await this.$db("SELECT * FROM contacts WHERE did = ?", [accountDi
|
||||
```
|
||||
|
||||
#### ❌ Forbidden (Outside Fence)
|
||||
|
||||
```typescript
|
||||
// Direct Dexie access (legacy pattern)
|
||||
const contacts = await db.contacts.where('did').equals(accountDid).toArray();
|
||||
@@ -98,6 +105,7 @@ export async function compareDatabases(): Promise<DataComparison> {
|
||||
```
|
||||
|
||||
**Fence Rule**: Migration tools are the exclusive interface between:
|
||||
|
||||
- Legacy Dexie database
|
||||
- New SQLite database
|
||||
- Data comparison and transfer operations
|
||||
@@ -107,11 +115,13 @@ export async function compareDatabases(): Promise<DataComparison> {
|
||||
### 1. Code Development Rules
|
||||
|
||||
#### New Feature Development
|
||||
|
||||
- **Always** use `PlatformServiceMixin` for database operations
|
||||
- **Never** import or reference Dexie directly
|
||||
- **Always** use mixin methods like `this.$settings()`, `this.$contacts()`
|
||||
|
||||
#### Legacy Code Maintenance
|
||||
|
||||
- **Only** modify Dexie code for migration purposes
|
||||
- **Always** add migration tests for schema changes
|
||||
- **Never** add new Dexie-specific features
|
||||
@@ -119,11 +129,13 @@ export async function compareDatabases(): Promise<DataComparison> {
|
||||
### 2. Data Integrity Rules
|
||||
|
||||
#### Migration Safety
|
||||
|
||||
- **Always** create backups before migration
|
||||
- **Always** verify data integrity after migration
|
||||
- **Never** delete legacy data until verified
|
||||
|
||||
#### Rollback Strategy
|
||||
|
||||
- **Always** maintain ability to rollback to Dexie
|
||||
- **Always** preserve migration logs
|
||||
- **Never** assume migration is irreversible
|
||||
@@ -131,6 +143,7 @@ export async function compareDatabases(): Promise<DataComparison> {
|
||||
### 3. Testing Requirements
|
||||
|
||||
#### Migration Testing
|
||||
|
||||
```typescript
|
||||
// Required test pattern for migration
|
||||
describe('Database Migration', () => {
|
||||
@@ -144,6 +157,7 @@ describe('Database Migration', () => {
|
||||
```
|
||||
|
||||
#### Application Testing
|
||||
|
||||
```typescript
|
||||
// Required test pattern for application features
|
||||
describe('Feature with Database', () => {
|
||||
@@ -159,6 +173,7 @@ describe('Feature with Database', () => {
|
||||
### 1. Static Analysis
|
||||
|
||||
#### ESLint Rules
|
||||
|
||||
```json
|
||||
{
|
||||
"rules": {
|
||||
@@ -178,6 +193,7 @@ describe('Feature with Database', () => {
|
||||
```
|
||||
|
||||
#### TypeScript Rules
|
||||
|
||||
```json
|
||||
{
|
||||
"compilerOptions": {
|
||||
@@ -190,6 +206,7 @@ describe('Feature with Database', () => {
|
||||
### 2. Runtime Checks
|
||||
|
||||
#### Development Mode Validation
|
||||
|
||||
```typescript
|
||||
// Development-only fence validation
|
||||
if (import.meta.env.DEV) {
|
||||
@@ -198,6 +215,7 @@ if (import.meta.env.DEV) {
|
||||
```
|
||||
|
||||
#### Production Safety
|
||||
|
||||
```typescript
|
||||
// Production fence enforcement
|
||||
if (import.meta.env.PROD) {
|
||||
@@ -209,6 +227,7 @@ if (import.meta.env.PROD) {
|
||||
## Migration Status Checklist
|
||||
|
||||
### ✅ Completed
|
||||
|
||||
- [x] PlatformServiceMixin implementation
|
||||
- [x] SQLite database service
|
||||
- [x] Migration tools
|
||||
@@ -217,11 +236,13 @@ if (import.meta.env.PROD) {
|
||||
- [x] ActiveDid migration
|
||||
|
||||
### 🔄 In Progress
|
||||
|
||||
- [ ] Contact migration
|
||||
- [ ] DatabaseUtil to PlatformServiceMixin migration
|
||||
- [ ] File-by-file migration
|
||||
|
||||
### ❌ Not Started
|
||||
|
||||
- [ ] Legacy Dexie removal
|
||||
- [ ] Final cleanup and validation
|
||||
|
||||
@@ -240,4 +261,4 @@ if (import.meta.env.PROD) {
|
||||
**Created**: 2025-07-05
|
||||
**Status**: Active Migration Phase
|
||||
**Last Updated**: 2025-07-05
|
||||
**Note**: Migration fence now implemented through PlatformServiceMixin instead of USE_DEXIE_DB constant
|
||||
**Note**: Migration fence now implemented through PlatformServiceMixin instead of USE_DEXIE_DB constant
|
||||
|
||||
Reference in New Issue
Block a user