This repository was archived by the owner on Jan 26, 2026. It is now read-only.
Commit 33569a1
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
File tree
- examples
- src
- db
- migrations
- logic
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
| 12 | + | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
0 commit comments