Overview
HashNotes is a minimalist notes app that lets you write short notes and pin them to IPFS using Pinata. Each note returns a CID and a gateway URL you can share instantly. The UI also lists pinned notes back, merging server results with a small local cache after hydration.
What it demonstrates
- Next.js App Router architecture (server + client components)
- Secure server endpoints to pin and list notes (
/api/notes) - IPFS publishing UX: write → pin → share CID link
- Production hardening: validation, rate limiting, and CSP via proxy
Key features
- Create a note and pin it to IPFS via Pinata
- Returns
{ cid, url }for instant sharing - Notes listing with pagination support (limit + pageToken)
- Local cache via
localStoragemerged with server listing on hydrate - Server-side safeguards:
- MIME allowlist (
text/plain,application/json) - Size limit (≤ 1MB)
- Rate limiting per IP (POST/GET)
- MIME allowlist (
- Strict Content Security Policy in production
Never commit secrets. Keep PINATA_JWT in your platform’s secret manager.
Live demo
Quickstart
Bash
git clone https://github.com/casaisdev/HashNotes.gitSee the README on GitHub for env vars and Pinata JWT setup.
Notes
- Uploads are tagged in Pinata with
keyvalueslike{ app: "hashnotes" }to filter listings cleanly. - The gateway host is configurable via
NEXT_PUBLIC_GATEWAY_URLso share links stay consistent. - If you scale horizontally, back the rate-limit store with Redis instead of in-memory state.
Next steps
If I were to evolve HashNotes further:
- Add client-side encryption (encrypt before pinning to IPFS)
- Add optional “private notes” mode (signed access + encrypted payloads)
- Improve indexing/search UX (simple search over cached previews)
- Add export/import (download all notes as JSON)