How xoaicatchu/todolist-backend works
TodoSync is an offline-first synchronization backend: clients push todo events, the service applies them, and clients pull updated state; SignalR notifies clients to sync. The README describes the current in-memory event store with JSON snapshot recovery. The tree also contains a database-backed V2 implementation with tenant-aware services, repositories, and event processing. The excerpts show the current API and parts of the V2 service and persistence layer; connections within unsampled V2 components are included only where the source index names them.
Main entry points: TodoSyncDbContext.cs EF database context · Program_V2.cs V2 API bootstrap · Program.cs Sync API routes · EventStoreService.cs Event store
Components 19
API and realtime
- Sync API routes
TodoSync.Api/Program.cs - SignalR hub
TodoSync.Api/Hubs/SyncHub.cs
In-memory sync
- Event store
TodoSync.Api/Services/EventStoreService.cs - JSON snapshot
TodoSync.Api/Services/EventStoreService.cs
Database sync
- V2 API bootstrap
TodoSync.Api/Program_V2.cs - Todo sync service
TodoSync.Api/Services/TodoSyncService.cs - Sync event consumer
TodoSync.Api/Services/SyncEventConsumer.cs - Todo repository
TodoSync.Api/Data/Repositories/TodoRepository.cs - Change repository
TodoSync.Api/Data/Repositories/SyncChangeRepository.cs - Processed-event repository
TodoSync.Api/Data/Repositories/ProcessedEventRepository.cs - EF database context
TodoSync.Api/Data/TodoSyncDbContext.cs - Sync database
- Todo records
TodoSync.Api/Data/Entities/TodoEntity.cs - Change records
TodoSync.Api/Data/Entities/SyncChangeEntity.cs - Processed events
TodoSync.Api/Data/Entities/ProcessedEventEntity.cs
Sync contracts
- Todo events
TodoSync.Api/Models/TodoEvent.cs - Todo items
TodoSync.Api/Models/TodoItem.cs - Sync request/response
TodoSync.Api/Models/SyncDtos.cs
Other components
- Todo clients
Connections 26
- Todo clients → Sync API routes: push / pull
README.md - Sync API routes → Event store: applies and queries
TodoSync.Api/Program.cs - Sync API routes → SignalR hub: broadcasts changes
TodoSync.Api/Program.cs - SignalR hub → Todo clients: notifies
README.md - Event store → JSON snapshot: loads / saves
TodoSync.Api/Services/EventStoreService.cs - Event store → Todo events: applies events
TodoSync.Api/Services/EventStoreService.cs - Event store → Todo items: stores todo state
TodoSync.Api/Services/EventStoreService.cs - Sync API routes → Sync request/response: accepts / returns
TodoSync.Api/Program.cs - Todo clients → V2 API bootstrap: sync requests
- V2 API bootstrap → Todo sync service: routes to
TodoSync.Api/Program_V2.cs - V2 API bootstrap → Sync event consumer: registers
TodoSync.Api/Program_V2.cs - V2 API bootstrap → EF database context: configures
TodoSync.Api/Program_V2.cs - V2 API bootstrap → Todo repository: registers
TodoSync.Api/Program_V2.cs - V2 API bootstrap → Change repository: registers
TodoSync.Api/Program_V2.cs - V2 API bootstrap → Processed-event repository: registers
TodoSync.Api/Program_V2.cs - Todo sync service → Todo repository: reads / writes
TodoSync.Api/Services/TodoSyncService.cs - Todo sync service → Change repository: records / queries changes
TodoSync.Api/Services/TodoSyncService.cs - Todo sync service → Processed-event repository: deduplicates events
- Todo repository → EF database context: queries todos
TodoSync.Api/Data/Repositories/TodoRepository.cs - Change repository → EF database context: queries changes
TodoSync.Api/Data/Repositories/SyncChangeRepository.cs - Processed-event repository → EF database context: tracks processed events
TodoSync.Api/Data/Repositories/ProcessedEventRepository.cs - EF database context → Todo records: maps
TodoSync.Api/Data/TodoSyncDbContext.cs - EF database context → Change records: maps
TodoSync.Api/Data/TodoSyncDbContext.cs - EF database context → Processed events: maps
TodoSync.Api/Data/TodoSyncDbContext.cs - EF database context → Sync database: persists records
- Sync event consumer → SignalR hub: uses realtime hub
TodoSync.Api/Services/SyncEventConsumer.cs