mirror of
https://github.com/dergigi/boris.git
synced 2025-12-17 06:34:24 +01:00
365b84ba9d0bcea41b5aa9f87ded3a4493b36ec4
- Remove bookmark title (h3) from bookmark items - Remove duplicate h4 heading from individual-bookmarks section - Keep only the single 'X bookmarks in this list:' line with event link
Markr
A minimal nostr client for bookmark management, built with applesauce.
Features
- Nostr Authentication: Connect using your nostr account
- Bookmark Display: View your nostr bookmarks as per NIP-51
- Minimal UI: Clean, simple interface focused on bookmark management
Getting Started
Prerequisites
- Node.js 18+
- npm, pnpm, or yarn
Installation
- Clone the repository:
git clone <your-repo-url>
cd markr
- Install dependencies:
npm install
# or
pnpm install
# or
yarn install
- Start the development server:
npm run dev
# or
pnpm dev
# or
yarn dev
- Open your browser and navigate to
http://localhost:3000
Usage
- Connect: Click "Connect with Nostr" to authenticate using your nostr account
- View Bookmarks: Once connected, you'll see all your nostr bookmarks
- Navigate: Click on bookmark URLs to open them in a new tab
Technical Details
- Built with React and TypeScript
- Uses applesauce-core for nostr functionality
- Implements NIP-51 for bookmark management
- Supports both individual bookmarks and bookmark lists
Development
Project Structure
src/
├── components/
│ ├── Login.tsx # Authentication component
│ └── Bookmarks.tsx # Bookmark display component
├── App.tsx # Main application component
├── main.tsx # Application entry point
└── index.css # Global styles
Private (hidden) bookmarks (Amethyst-style)
We support Amethyst-style private (hidden) bookmark lists alongside public ones (NIP‑51):
-
Detection and unlock
- Use
Helpers.hasHiddenTags(evt)andHelpers.isHiddenTagsLocked(evt)to detect hidden tags. - First try
Helpers.unlockHiddenTags(evt, signer); if that fails, try with'nip44'. - For events with encrypted
contentthat aren’t recognized as supporting hidden tags (e.g. kind 30001), manually decrypt:- Prefer
signer.nip44.decrypt(evt.pubkey, evt.content), fallback tosigner.nip04.decrypt(evt.pubkey, evt.content).
- Prefer
- Use
-
Parsing and rendering
- Decrypted
contentis JSONstring[][](tags). Convert withHelpers.parseBookmarkTags(hiddenTags). - Map to
IndividualBookmark[]via ourprocessApplesauceBookmarks(..., isPrivate=true)and append to the private list so they render immediately alongside public items.
- Decrypted
-
Caching for downstream helpers
- Cache manual results on the event with
BookmarkHiddenSymboland also store the decrypted blob underEncryptedContentSymbolto aid debugging and hydration.
- Cache manual results on the event with
-
Structure
src/services/bookmarkService.ts: orchestrates fetching, hydration, and assembling the final bookmark payload.src/services/bookmarkProcessing.ts: decryption/collection pipeline (unlock, manual decrypt, parse, merge).src/services/bookmarkHelpers.ts: shared types, guards, mapping, hydration, and symbols.src/services/bookmarkEvents.ts: event type and de‑duplication for NIP‑51 lists/sets.
-
Notes
- We avoid
anyvia narrow type guards fornip44/nip04decrypt functions. - Files are kept small and DRY per project rules.
- Built on applesauce helpers (
Helpers.getPublicBookmarks,Helpers.getHiddenBookmarks, etc.). See applesauce docs: https://hzrd149.github.io/applesauce/typedoc/modules.html
- We avoid
Building for Production
npm run build
# or
pnpm build
# or
yarn build
Contributing
This is a minimal MVP. Future enhancements could include:
- Bookmark creation and editing
- Bookmark organization and tagging
- Search functionality
- Export capabilities
- Mobile-responsive design improvements
License
MIT
Languages
TypeScript
89.6%
CSS
9.4%
Shell
0.6%
JavaScript
0.2%
HTML
0.2%