Skip to content

chore: pivot data layer to Nostr protocol (Note foundation)#1

Open
samarthsinh2660 wants to merge 1 commit into
mainfrom
feat-data-note-codebasesetup
Open

chore: pivot data layer to Nostr protocol (Note foundation)#1
samarthsinh2660 wants to merge 1 commit into
mainfrom
feat-data-note-codebasesetup

Conversation

@samarthsinh2660

Copy link
Copy Markdown
Collaborator

What changed and why

This PR establishes the Note data layer foundation for the Nostr protocol
and fixes a critical build toolchain incompatibility.


Deleted

  • PostModel, PostEntity, PostRepository, PostUseCase
  • CommentModel, CommentEntity, CommentRepository, CommentUseCase
  • PostInput, CommentInput

In Nostr, everything is a Kind 1 Note. A "post" is a note with no parent.
A "comment" is a note with rootEventId set. No separate models needed —
this removes the redundancy.


Added

  • lib/core/enum/note_type.darttext | image | link | reference
  • lib/data/models/note_model.dart — Isar collection for Kind 1 notes
  • lib/data/models/note_model.g.dart — generated Isar schema
  • lib/domain/entities/note/note_entity.dart — freezed domain entity
  • lib/domain/entities/note/note_entity.freezed.dart — generated
  • lib/domain/repositories/note_repository.dart — abstract interface
  • lib/data/repositories/note_repository_impl.dart — Isar implementation
  • CLAUDE.md — architecture context file (module map, layer rules, DO/NEVER
    list)

Modified

pubspec.yaml — Three dependency changes:

  1. isarisar_community 3.3.2
    Isar 3.x is unmaintained and incompatible with Dart 3.11 — build_runner
    crashes. The community fork is a drop-in replacement with the same API.

  2. freezed^3.0.0, freezed_annotation^3.0.0
    Required by isar_community_generator (both need build ^4.x).

  3. build_runner^2.13.0
    Older versions crash on Dart 3.11 due to a missing SDK snapshot file.

All *.freezed.dart and *.g.dart diffs — Auto-regenerated by
build_runner after the freezed 2.x → 3.x upgrade. Logic is unchanged,
only the generated boilerplate format changed.

local_datasource.dart — Added NoteModelSchema to Isar.open().

.gitignore — Added docs/ and uniun/ (local files, not for VCS).


What is NOT changed

  • All existing community, user, and feed UI — untouched
  • All existing BLoC logic — untouched
  • App still compiles and runs as before

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