src/pages

Routes. Every page uses layouts/Plain.astro; pages that read the database run on demand.

Products and collections

Path What it does
/ The front page: what the site is, and the most kept products right now
/account Confirm emails, connect accounts, sign out, delete everything
/submit Paste a product’s address; the site reads its name, description and icon
/p/<domain> One page per root domain: keep it, see how many people keep it, discuss it
/c/<id> A collection: public ones for anyone, private ones for their owner
/collections Make, rename, publish or delete your collections
/import Import bookmarks (browser HTML, Chrome JSON, Raindrop.io HTML or CSV)
/u/<handle> A curator’s page: name, public collections, follow button
/following New public keeps from the curators you follow
/new This week’s builder launches and newly public products, ranked by keepers
/sitemap-pages.xml Public products, collections and curator pages, for search engines
/developers, /llms.txt How to use the MCP server and the API
/mcp MCP server (Streamable HTTP); OAuth at /oauth/* and /.well-known/oauth-*
/terms Terms of use; names the operator and the contact address (OPERATOR, CONTACT in lib/site.ts)
/admin The team’s review queue (curator handles in ADMIN_HANDLES); 404 for everyone else
/card/<domain>.png, /card/c/<id>.png Drawn 1200×630 share cards

A product is keyed by its root domain (www.app.mercury.com → mercury.com). Submitting visits the home page once (then www.), reads its <head>, and stores the icon in Postgres, so pages never load another site’s files. The fetcher refuses IP addresses, other ports and any name that resolves to a private network. A new product is pending and says so on its page.

The first keep makes a private default collection, “My sky”. A product page counts each person once, however many collections they keep it in. Imported folders become private collections; links to known products become keeps, and other links stay plain links that only the owner sees.

Only someone with a confirmed email or connected account can have a curator page, so every public name stands for a real person. A product page names the first curator who kept it in a public collection.

Comments need a curator page. A reply emails the person it answers, using the encrypted copy of their confirmed address (lib/notify.ts), unless they turned notices off.

A pending product goes public once three verified people keep it in public collections, or an admin approves it (lib/publish.ts). The site emails the submitter a thank-you, and again when the product goes public, and sends a security alert (time, IP, place, device) on each new sign-in or connection.

API

Path Methods What it does
api/products POST, PATCH Submit a product by domain; its builder edits it
api/keep GET, POST Keep counts for a product; keep or let go
api/collections GET, POST, PATCH, DELETE Your collections
api/import POST Import a bookmark file (up to 2,000 links)
api/profile GET, POST Your curator page: handle, name, hidden or not
api/follow GET, POST Follow a curator, or stop
api/comments GET, POST, DELETE A product’s discussion: like, compare, suggest, reply; remove your own
api/report POST Report a comment to the team
api/quiet GET, POST Turn email notices on or off
api/claim GET, POST Claim a product page with an email on its domain
api/launch POST A builder launches their product (once per root domain every 60 days)
api/v1/… GET, POST The public API: products, collections, keep, submit (Bearer token for writes)
api/tokens GET, POST, DELETE Personal tokens and connected apps
api/oauth/approve POST The consent button on /oauth/authorize
api/admin POST Approve or hide a product; remove or keep a reported comment; open an account for a teammate who agreed
api/icon/<domain> GET A product’s stored icon
api/me GET, DELETE Who you are; delete everything
api/email, api/connect, api/signout, api/facebook Sign-in and deletion

Every write goes through write() in src/lib/http.ts: same origin, JSON, a known visitor and a rate limit.