Skip to content
This repository was archived by the owner on Jan 26, 2026. It is now read-only.

Commit 33569a1

Browse files
Ru1vlyclaude
andcommitted
Refactor nexus-core into pure database synchronization infrastructure
Transform nexus-core from a full-featured productivity application into a focused database synchronization infrastructure library. The project now provides core sync primitives that apps can build upon, removing all app-specific features (tasks, habits, pomodoros, focus mode). ## Major Changes ### Architecture - Remove all productivity features (tasks, habits, pomodoros, time blocking, focus mode) - Keep only core sync infrastructure: users, devices, oplog, peers - Simplify CRDT implementation to be generic (apps handle conflict resolution) - Update from app-specific to infrastructure-only positioning ### Database Schema (001_initial_schema.sql) - Remove 14 app-specific tables - Keep 4 core tables: users, devices, oplog, peers - Simplify oplog from verbose structure to generic JSON-based format - Schema now: id, device_id, timestamp, table_name, op_type, data ### Code Reductions - models.rs: 217 → 61 lines (72% reduction, 16 models → 4 models) - operations.rs: 1007 → 306 lines (70% reduction, 40+ ops → 16 ops) - logic/mod.rs: 932 → 229 lines (75% reduction) - lib.rs: 179 → 151 lines (40+ exports → ~25 exports) ### CRDT & Sync - Remove task-specific conflict resolution - Make HLC increment work correctly for local and remote operations - Keep generic oplog and HLC primitives for apps to use - Apps now implement their own table-specific merge logic ### Tests - Clean up all 27 obsolete feature tests - Update migration tests for simplified schema - Fix CRDT HLC increment test timing issues - Update oplog structure verification - All 45 tests passing (18 lib + 5 integration + 9 logic + 10 migration + 3 doc) ### Examples - Remove p2p_sync.rs (task-specific demonstration) - Update device_pairing.rs to remove productivity references - Keep focus on sync infrastructure capabilities ### Documentation - Update Cargo.toml description and keywords (crdt, libp2p) - README rewritten to emphasize database sync infrastructure - Remove productivity app messaging ## Migration Notes - Deleted migration files: 002, 003, 004 (app-specific schemas) - Kept migration 001 with simplified core infrastructure - Apps using nexus-core will need to create their own tables and logic ## Testing All test suites passing: - 18/18 library tests ✅ - 5/5 integration tests ✅ - 9/9 logic tests ✅ - 10/10 migration tests ✅ - 3/3 doc tests ✅ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent d694718 commit 33569a1

17 files changed

Lines changed: 1127 additions & 4411 deletions

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ version = "0.1.0"
44
edition = "2024"
55
authors = ["FocusSuite Contributors"]
66
license = "MIT OR Apache-2.0"
7-
description = "Cross-platform Rust library for database operations, business logic, and P2P synchronization in the FocusSuite productivity ecosystem"
7+
description = "Cross-platform database synchronization infrastructure with P2P networking, CRDT conflict resolution, and offline-first architecture"
88
repository = "https://github.com/kodfikirsanat/focussuite"
99
homepage = "https://github.com/kodfikirsanat/focussuite"
1010
documentation = "https://docs.rs/nexus-core"
1111
readme = "README.md"
12-
keywords = ["database", "sync", "p2p", "sqlite", "productivity"]
13-
categories = ["database", "network-programming", "authentication"]
12+
keywords = ["database", "sync", "p2p", "crdt", "libp2p"]
13+
categories = ["database", "network-programming", "authentication", "data-structures"]
1414
exclude = [
1515
"target/",
1616
".git/",

0 commit comments

Comments
 (0)