How koteitan/nostr-post-checker works
Project Type and Purpose
• This is a small, static, front-end only web application (“nostr-post-checker”) that runs entirely in the browser.
• Its sole purpose is to let a user enter a Nostr “note” ID and verify whether that note exists on one or more Nostr relays.
Top-Level File Structure
• index.html: single‐page UI shell
• style.css: styling for the page
• main.js: application logic (handles user input, invokes Nostr library, drives UI updates)
• bech32.js: utility module for bech32 encoding/decoding (part of Nostr protocol)
• LICENSE.md, README.md: documentation
Key Components
a. Browser / Client
• UI Layer (index.html + style.css)
• Application Logic (main.js)
• Utility Module (bech32.js)
• External Library (nostr-tools, implicitly imported by main.js)
b. External Services
• Nostr Relays (WebSocket or HTTP endpoints where “notes” are stored)
c. Hosting
• GitHub Pages (static file host)
Relationships & Data Flows
1. User opens index.html in browser
2. Browser loads style.css, bech32.js, main.js (+ nostr-tools bundle)
3. User inputs a note ID into the UI
4. main.js uses nostr-tools + bech32.js to format the ID
5. main.js opens WebSocket connections (or HTTP requests) to configured Nostr relays
6. Relays respond with presence/absence of the note
7. main.js updates the UI with the check result
Architectural Patterns & Design Principles
• Separation of concerns:
• UI (HTML/CSS)
• Business logic (main.js)
• Utility code (bech32.js)
• Single-page application pattern
• Externalizing protocol logic into nostr-tools
Technologies & Frameworks
• HTML5, CSS3, Vanilla JavaScript
• bech32.js (bech32 encoding module)
• nostr-tools (imported via CDN or bundle)
• GitHub Pages (static hosting)
• WebSocket or HTTP for relay communication
Elements
• Clear labels for each component (e.g., “UI (index.html + style.css)”, “App Logic (main.js)”).
• Rectangles for in-browser modules
• Optional: callouts or annotations for “nostr-tools” usage and bech32 encoding.