Skip to content

Add founder project persistence with local DB and network scan separation#745

Merged
dangershony merged 4 commits intomainfrom
feature-founder-project-persistence
Apr 2, 2026
Merged

Add founder project persistence with local DB and network scan separation#745
dangershony merged 4 commits intomainfrom
feature-founder-project-persistence

Conversation

@dangershony
Copy link
Copy Markdown
Member

Summary

  • Adds local persistence for founder projects using a new IFounderProjectsService / FounderProjectsDocument (mirroring the IPortfolioService pattern for investors), so founder projects load instantly from LiteDB instead of scanning the network every time.
  • Splits GetFounderProjects into two operations: a fast local-only read (GetFounderProjects) and a heavy network scan (ScanFounderProjects) that diffs local DB against all 15 derived key slots and only queries the indexer for unknown projects.
  • Persists new projects at creation timeCreateProject handler now saves a FounderProjectRecord (with CreationTransactionId) to the local DB immediately after transaction creation.
  • Adds "Scan for Projects" UI in the design app's My Projects section with a spinner button and toast error notifications.

Changes

SDK (Angor.Sdk)

File Change
Funding/Founder/Domain/FounderProjectRecord.cs New record: ProjectIdentifier + nullable CreationTransactionId
Funding/Founder/Domain/FounderProjectsDocument.cs New LiteDB document keyed by WalletId
Funding/Founder/Domain/IFounderProjectsService.cs New interface: GetByWalletId, Add, AddRange
Funding/Founder/Domain/FounderProjectsService.cs Implementation with idempotent add (skips duplicates)
Funding/Founder/Operations/GetFounderProjects.cs Refactored — reads from local IFounderProjectsService instead of scanning derived keys
Funding/Founder/Operations/ScanFounderProjects.cs New MediatR handler — scans derived keys, diffs against local DB, queries indexer for unknowns, persists results
Funding/Founder/Operations/CreateProject.cs Saves FounderProjectRecord after successful tx creation
Funding/Projects/IProjectAppService.cs Added ScanFounderProjects(WalletId)
Funding/Projects/ProjectAppService.cs Added MediatR dispatch for scan
Funding/FundingContextServices.cs DI registration for IFounderProjectsService

Design App

File Change
MyProjectsViewModel.cs Added logger, toast event, ScanForProjectsAsync() with error handling
MyProjectsView.axaml Added "Scan for Projects" button with spinner in header row
MyProjectsView.axaml.cs Wired scan button click + toast forwarding to shell

Other

File Change
TESTING_GUIDELINES.md Added testing guidelines for integration tests

How it works

  1. App startup / navigating to My Projects → calls GetFounderProjects → reads local DB → returns cached projects instantly (or empty list if first run)
  2. User clicks "Scan for Projects" → calls ScanFounderProjects → reads all 15 derived key slots → compares against local DB → only queries indexer for new project IDs → persists discoveries → returns full project list
  3. Founder creates a new projectCreateProject handler saves the record to local DB immediately → next GetFounderProjects call returns it without scanning

Build & Test

  • SDK: 0 errors
  • Design app + integration tests: 0 errors
  • Avalonia MyProjectsSectionViewModel automatically benefits from the refactored GetFounderProjects handler (no changes needed)

@dangershony dangershony merged commit cb33e08 into main Apr 2, 2026
1 check passed
@dangershony dangershony deleted the feature-founder-project-persistence branch April 2, 2026 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant