Add local-first SPA architecture and containerized production deploy.

Move data access to use-cases and IndexedDB repositories with optional
remote fallback, changelog/sync ports, and encrypted local backup.
Add production Docker Compose (nginx frontend + optional backend) and
Apache host proxy configuration for deployment.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-29 16:08:02 +03:00
co-authored by Cursor
parent b668ee8507
commit 5e0af42fce
37 changed files with 1117 additions and 51 deletions
@@ -0,0 +1,44 @@
import { appendChange } from '../../infrastructure/sync/changeLogRepository'
import { getContactRepository } from '../../infrastructure/repositories/repositoryFactory'
const contactRepo = () => getContactRepository()
export async function listContacts(search = '') {
return contactRepo().list(search)
}
export async function getContactById(id) {
return contactRepo().getById(id)
}
export async function createContact(payload) {
const created = await contactRepo().create(payload)
await appendChange({
entityType: 'contact',
entityId: created.id,
op: 'created',
payloadPatch: created,
})
return created
}
export async function updateContact(id, payload) {
const updated = await contactRepo().update(id, payload)
await appendChange({
entityType: 'contact',
entityId: id,
op: 'updated',
payloadPatch: payload,
})
return updated
}
export async function deleteContact(id) {
await contactRepo().remove(id)
await appendChange({
entityType: 'contact',
entityId: id,
op: 'deleted',
payloadPatch: {},
})
}