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.
- Capture Layer:
touched-page/extension(Manifest V3 + declarativeextension-storepacks) andtouched-page/touched-android(ACTION_SEND+ on-devicewindow.TouchedNativemetadata extraction) write via scopedtp_live_...Bearer tokens to eithertouched.pageor any self-hostedtouched-node. - Node Layer:
touched-page/touched-noderuns standalone in one container on embedded PGlite (or external PostgreSQL) and optionally links a free cloud account at/cloudfor bidirectional sync and WorkDB metadata enrichment. - Open Protocol Layer: Public spaces emit CORS-enabled
touched.json(touched.page/v1) and RSS; authenticated owners exportfollowing.opml,following.json, and full idempotenttouched.page/backup/v1archives anytime. - Consumption Layer: Browsers pull opted-in peer nodes directly over CORS (zero server SSRF) with freshness-first deduplication;
touched-page/touched-frontenddeploys zero-DB custom sites on Vercel and builds<touched-work-card>for external blogs;touched-page/mcpexposes 12 safe tools over stateless remote/mcpand localstdiofor 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:
| Layer | Cardinality | Key Fields & Rules |
|---|---|---|
| System List | Mutually 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 Lists | Multi-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 / POV | Multi-select (<= 50 / work) | Lightweight cross-medium facets (#CRPG, #roguelike, #dialogue) |
| Free-Form Status | Plain 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 a1..5rating 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 to0–Ncross-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:
| Component | License / Scope | What Lives Here | Why |
|---|---|---|---|
touched-node | MIT Open Source | Full single-user Personal Media Library, blog, TierMaker, Poster Studio, embedded PGlite / PostgreSQL storage, Cloud Bridge, Direct Node Pull, full backup/restore | Guarantees lifetime personal ownership and offline sovereignty |
touched-frontend | MIT Open Source | Zero-DB Vercel blog & library template + standalone <touched-work-card> Web Component | Separates personal presentation and domain from storage |
extension & extension-store | MIT Open Source | MV3 browser extension, 12-site starter rule pack (v1.2.0 with declarative safe badge spec), declarative site-rules/v1 engine, community registry & ReDoS/schema validator | Anyone can inspect capture logic and add new media sites via 10-line JSON PRs |
touched-android | MIT Open Source | Android WebView thin-shell, ACTION_SEND extractor, SSRF-guarded window.TouchedNative bridge, server switcher | Transparent mobile permissions (INTERNET only) and first-class self-hosted node support |
mcp | MIT Open Source | Official MCP server (Streamable HTTP /mcp + local stdio CLI) with 12 read/write tools, private-only draft_post, and SSRF-hardened read_public_node | Lets AI assistants read your real taste and draft essays without vendor lock-in or accidental public posting |
touched.json v1 & Docs | MIT Open Source | Public JSON schema, NIP-36 NSFW convention, OPML 2.0, backup format, interactive validators | Enables static blogs, Cloudflare Workers, and third-party backends to join the network |
Hosted touched.page | Hosted Multi-Tenant Service | Multi-user OAuth pseudonym onboarding, anti-abuse & trust gating, global WorkDB dedup operations, cross-user white-box taste-overlap feed | Sustains 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)
- 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.pageidentity; public external badges and blog links default tofalse(explicit opt-in only). - 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 inog:image/twitter:image. - Logged-out Home
/and search strictly exclude NSFW items; signed-in members pickhide,blur(default), orshow. - Public
touched.jsonemits"contentWarning": "nsfw"(omitted on safe items) so browser readers respect the viewer's preference across nodes.
- Covers and backdrops of NSFW works (
- Zero SSRF on Cross-Node Reading: Remote
touched.jsonsubscriptions 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. - 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. - Verified Public Domains Gate & Safe
draft_post: Personal libraries allow saving and exporting anyhttps://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 MCPdraft_postalways save withvisibility: "private".
5. Co-Creation Roadmap
| Area | Status | Concrete Opportunities for Contributors |
|---|---|---|
Single-container touched-node (PGlite / PG + Cloud Bridge + Direct Node Pull) | Shipped | Add NAS / Coolify / NixOS / Fly.io deployment templates; optimize large-library imports |
Declarative site-rules/v1 & 12-site Starter Pack | Shipped | Submit new media site packs to extension-store (test live in our Rule Pack Validator) |
Open Protocol touched.json v1 + Backup/OPML | Shipped | Build 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> | Shipped | Create alternative editorial, minimalist, or gallery themes; improve widget themes |
Official MCP Server (touched-page/mcp + /mcp) | Shipped | Build custom workflows, reading-list scripts, and cross-node recommendation prompts (see AI & MCP Guide) |
Shareable Topic Pages (/t/:topicId) & 3-State Visibility | Shipped | Share curated cross-medium playlists (Public / Unlisted / Private) with 2×2 safe mosaics and instant `List |
Android Thin-Shell (v0.1.0-preview.1 APK) | Active | Expand ShareUrlExtractor support for regional reading/music/film apps; polish gesture & tablet ergonomics |
| Cross-Platform Importers & Ecosystem Tools | Open | Contribute offline converters from Douban, Steam, Letterboxd, Goodreads, or Bangumi exports into touched.page/backup/v1 |
Optional Cryptographic Identity (pubkey / sig) | Open | Explore 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.