Skip to content

Architecture & Open-Core Boundaries ​

This page documents how the touched.page ecosystem fits together, what stays MIT open source versus what the hosted service operates, and the non-negotiable engineering invariants that protect user privacy and data ownership.


1. System Topology ​

Every layer speaks the same canonical work source keys (namespace:externalId, such as steam:632470, bangumi:400602, douban:6082808) and stable essay slug identifiers, so self-hosted nodes, browser extensions, Android shells, custom frontends, and static blogs interoperate without vendor lock-in.

1. CAPTURE2. NODE LAYER3. OPEN PROTOCOL4. CONSUMPTIONextension + storeMV3 1-click captureDeclarative site-rules/v1touched-androidACTION_SEND share intentZero-CORS TouchedNativetouched-node (MIT)Single-container PGlite / PGOffline-first · /cloud synctouched.page CloudMulti-user taste discoveryShared WorkDB aggregationtouched.json v1CORS * public JSON feedNIP-36 NSFW separationbackup/v1 & OPMLFull export & idempotent importStandard RSS & scoped APIDirect Pull · MCPZero-SSRF CORS peer pull/mcp + stdio AI clientstouched-frontendZero-DB Vercel template<touched-work-card> · RSSCanonical namespace:externalId work keys + stable post slugs unify all four layers with zero lock-in1. CAPTURE LAYERextension / store · touched-androidDeclarative site-rules/v1 & ACTION_SEND2. NODE LAYERtouched-node (MIT) ⇄ touched.pageSelf-hosted PGlite/PG or hosted hubOptional /cloud bidirectional sync3. OPEN PROTOCOL LAYERtouched.json v1 · OPML · backup/v1CORS * JSON, NIP-36 NSFW & full backup4. CONSUMPTION LAYERDirect Pull · MCP · frontendZero-SSRF pull, AI tools & work cards
  • Capture Layer: touched-page/extension (Manifest V3 + declarative extension-store packs) and touched-page/touched-android (ACTION_SEND + on-device window.TouchedNative metadata extraction) write via scoped tp_live_... Bearer tokens to either touched.page or any self-hosted touched-node.
  • Node Layer: touched-page/touched-node runs standalone in one container on embedded PGlite (or external PostgreSQL) and optionally links a free cloud account at /cloud for bidirectional sync and WorkDB metadata enrichment.
  • Open Protocol Layer: Public spaces emit CORS-enabled touched.json (touched.page/v1) and RSS; authenticated owners export following.opml, following.json, and full idempotent touched.page/backup/v1 archives anytime.
  • Consumption Layer: Browsers pull opted-in peer nodes directly over CORS (zero server SSRF) with freshness-first deduplication; touched-page/touched-frontend deploys zero-DB custom sites on Vercel and builds <touched-work-card> for external blogs; touched-page/mcp exposes 12 safe tools over stateless remote /mcp and local stdio for Claude Desktop, Cursor, OpenCode, and OpenChamber.

2. The 4-Layer Data Model & 1 User × 1 Work = 1 Review ​

Rather than duplicating state across parallel activity feeds, every user-work relationship has a single source of truth:

LayerCardinalityKey Fields & Rules
System ListMutually exclusive (7 lists)ready (Collect), subjective 5-tier scale (5–1), and archive (strictly private, omitted from all public routes, feeds, and touched.json)
Custom Theme ListsMulti-select (<= 50)Curated shareable /t/:topicId lists with 3-state visibility (public / unlisted / private), isolated per-theme topicScore (1–5), and contextNote—never alters your global rating
Tags / POVMulti-select (<= 50 / work)Lightweight cross-medium facets (#CRPG, #roguelike, #dialogue)
Free-Form StatusPlain text (<= 120 chars)Honest progress in your own words; never mapped to hardcoded watching/dropped enums

Strictly Two Content Concepts:

  • Reviews (评价): Stored directly on each (user, work) record (rating, summaryNote, statusText, visibility, updatedAt). Public, non-archived reviews with either a 1..5 rating or non-empty note power /works/:id, Discover /, /@handle, /touched.json, and /rss.xml. Silent unrated collects never leak publicly.
  • Posts (随笔): Titled Markdown essays linked to 0–N cross-medium works by canonical work ID and source keys, keeping comments open by default.

3. Transparent Open-Core Boundaries ​

We draw a hard, predictable boundary so self-hosters and contributors know nothing essential to personal ownership is held back:

ComponentLicense / ScopeWhat Lives HereWhy
touched-nodeMIT Open SourceFull single-user Personal Media Library, blog, TierMaker, Poster Studio, embedded PGlite / PostgreSQL storage, Cloud Bridge, Direct Node Pull, full backup/restoreGuarantees lifetime personal ownership and offline sovereignty
touched-frontendMIT Open SourceZero-DB Vercel blog & library template + standalone <touched-work-card> Web ComponentSeparates personal presentation and domain from storage
extension & extension-storeMIT Open SourceMV3 browser extension, 12-site starter rule pack (v1.2.0 with declarative safe badge spec), declarative site-rules/v1 engine, community registry & ReDoS/schema validatorAnyone can inspect capture logic and add new media sites via 10-line JSON PRs
touched-androidMIT Open SourceAndroid WebView thin-shell, ACTION_SEND extractor, SSRF-guarded window.TouchedNative bridge, server switcherTransparent mobile permissions (INTERNET only) and first-class self-hosted node support
mcpMIT Open SourceOfficial MCP server (Streamable HTTP /mcp + local stdio CLI) with 12 read/write tools, private-only draft_post, and SSRF-hardened read_public_nodeLets AI assistants read your real taste and draft essays without vendor lock-in or accidental public posting
touched.json v1 & DocsMIT Open SourcePublic JSON schema, NIP-36 NSFW convention, OPML 2.0, backup format, interactive validatorsEnables static blogs, Cloudflare Workers, and third-party backends to join the network
Hosted touched.pageHosted Multi-Tenant ServiceMulti-user OAuth pseudonym onboarding, anti-abuse & trust gating, global WorkDB dedup operations, cross-user white-box taste-overlap feedSustains shared multi-user discovery infrastructure without locking anyone in

Every user on hosted touched.page can export their complete archive (GET /api/me/export.json), subscriptions (GET /api/me/following.opml), and migrate to touched-node in minutes.


4. Hard Engineering Invariants (Privacy, Security & NSFW) ​

  1. Credentials-Only External OAuth: GitHub / Linux.DO OAuth and email exist strictly for authentication and anti-abuse. External usernames, avatars, and profile links are never auto-copied onto a user's touched.page identity; public external badges and blog links default to false (explicit opt-in only).
  2. NSFW Text/Media Separation (Option A + NIP-36):
    • Covers and backdrops of NSFW works (isNsfw: true) never route through /api/proxy/image, never cache on server disk, and never appear in og:image / twitter:image.
    • Logged-out Home / and search strictly exclude NSFW items; signed-in members pick hide, blur (default), or show.
    • Public touched.json emits "contentWarning": "nsfw" (omitted on safe items) so browser readers respect the viewer's preference across nodes.
  3. Zero SSRF on Cross-Node Reading: Remote touched.json subscriptions and opt-in Direct Node Pull execute exclusively inside the viewer's browser (mode: "cors", credentials: "omit", strict DOM text sanitization)—the server never fetches untrusted remote URLs on a user's behalf.
  4. Non-Adversarial Interaction Defaults: Reviews are non-commentable (403) to prevent score-policing; same-day rating-only batches collapse cleanly; mute lists (user_mutes) are permanently private and travel only inside authenticated backups.
  5. Verified Public Domains Gate & Safe draft_post: Personal libraries allow saving and exporting any https:// URL privately, while public pages (/works/:id, visitor /@handle, touched.json, <touched-work-card>) and cross-user WorkDB aggregation emit/merge only Verified domains with declarative circular badges. AI writes via MCP draft_post always save with visibility: "private".

5. Co-Creation Roadmap ​

AreaStatusConcrete Opportunities for Contributors
Single-container touched-node (PGlite / PG + Cloud Bridge + Direct Node Pull)ShippedAdd NAS / Coolify / NixOS / Fly.io deployment templates; optimize large-library imports
Declarative site-rules/v1 & 12-site Starter PackShippedSubmit new media site packs to extension-store (test live in our Rule Pack Validator)
Open Protocol touched.json v1 + Backup/OPMLShippedBuild static-site plugins (astro-touched-json, hugo-touched-feed) or non-JS server adapters in Go / Rust / Python (test live in our Protocol Playground)
Zero-DB touched-frontend & <touched-work-card>ShippedCreate alternative editorial, minimalist, or gallery themes; improve widget themes
Official MCP Server (touched-page/mcp + /mcp)ShippedBuild custom workflows, reading-list scripts, and cross-node recommendation prompts (see AI & MCP Guide)
Shareable Topic Pages (/t/:topicId) & 3-State VisibilityShippedShare curated cross-medium playlists (Public / Unlisted / Private) with 2×2 safe mosaics and instant `List
Android Thin-Shell (v0.1.0-preview.1 APK)ActiveExpand ShareUrlExtractor support for regional reading/music/film apps; polish gesture & tablet ergonomics
Cross-Platform Importers & Ecosystem ToolsOpenContribute offline converters from Douban, Steam, Letterboxd, Goodreads, or Bangumi exports into touched.page/backup/v1
Optional Cryptographic Identity (pubkey / sig)OpenExplore lightweight optional signing for touched.page/v1 payloads compatible with relay ecosystems

Ready to dive in? Head to Contributing & Co-Creation or try the interactive Protocol Playground and Rule Pack Validator.

Open-core ecosystem under MIT License. Built around works, writing, and data sovereignty.