New
Apps 6,419Makers 6,403This week 7
Promote your app−30%
MTL Archives screenshot 1
4views in
the last 30 days

MTL Archives

Montréal archives search, daily game, prints, and newsletter on Cloudflare + Next.js

Built with Claude Code

by zouantchaw · Unclaimed · from USUnited States · added Oct 29, 2026
no ratings0 comments

MTL Archives

Search and play with ~14k photographs in the City of Montreal archives.

Live: www.mtlarchives.com

A visitor can search by what a picture looks like or what its caption says, play a daily “where is this?” game, or ask the reading room in French or English. A reading-room collection can be saved as a provenance package — a shareable handoff of sources, claims, unknowns, and assembler review. client-ok is not a City certification.

The B3 redesign is live at https://www.mtlarchives.com; https://staging.mtlarchives.com remains behind Access for verification. It adds /fr and /en place-first pages, bilingual photo metadata, quartier/street/era hubs, the Paper rosette system, a self-hosted Protomaps map, double-opt-in signup and the partner inquiry form. See B3 implementation and verification. Current deployment and rollback versions are in the release receipt.

B3 also provides /llms.txt, /llms-full.txt, and Markdown companions at <path>.md or through Accept: text/markdown. Exports preserve archival fields, source links and Archives attribution plus cote, without asserting a photo licence. Hidden/noindex photos are excluded; public noindex informational pages export static instructions without personal or transactional state. See public Markdown and structured-data contract for the complete route inventory, exclusions and schema coverage. Future releases retain the separate staging verification and owner-authorization gate. Round-three staging behavior, gates and remaining verification limits are recorded in the staging verification receipt.

B4 staging integration, visual QA and the approved hub-content loader are documented in the B4 integration receipt. The loader validates all 32 bilingual approved Markdown files and preserves quoted source spans; remote writes require --apply and an explicit matching D1 environment. Production loading remains part of the authorized release.

Localized route names now use French slugs under /fr and English slugs under /en (for example /fr/histoires and /en/stories). Cross-locale document aliases redirect once; RSC/prefetch aliases rewrite without changing _rsc. Flight responses are private and never enter shared CDN caches. The RSC release matrix and standing QA gates cover navigation and 30-second idle checks.

The v2 platform proof is staging-only: results, costs and limits, performance baseline. apps/v2-platform retains historical proof code; its image/OG/lab endpoints are now retired with 404/no-store and no IMAGES binding. Dedicated serving Workers own the immutable tiles/PMTiles hosts. The historical performance baseline is not a release pass.

The v2-site candidate implements the approved A+ system in FR and EN at staging.mtlarchives.com. Its public locale routes use Server Components, ISR, Workers Cache tags and a shared publication boundary; Clerk is limited to private research APIs. Legacy transactional/research pages return 410, and discovery aliases redirect once. Photo delivery uses Child D's fully inventoried fixed ladder/OG/packed-DZI assets. The former image proof and request-time transformation routes are retired. This candidate has not been released to production. Staging evidence and blockers, data contract, SEO inventory and design deviations govern the release handoff.

Stack

Layer What
apps/next-app Next.js site — search, stories, game, newsletter, /research (Cloudflare Workers / OpenNext)
apps/api Cloudflare Worker — D1, Vectorize, R2, Workers AI, operator jobs, provenance packages
apps/operator-agent Eve control surface; completions go through Cloudflare AI Gateway
packages/scripts ETL, CLIP/text index ingest, evals, explorer snapshot export
apps/web Optional similarity explorer with a dated canonical snapshot, live Smart/Visual search, connection webs, and a device-local collection. Not the main site. See explorer notes.
pipelines OCR / VLM / Instagram packaging

Search is CLIP (visual) + BGE (captions) on Cloudflare Vectorize. /research uses Mistral Small on Workers AI, with GPT-5.4 only as a bounded inspect fallback. Original archive bytes are never overwritten.

/api/thumb snaps transform parameters to the fixed tuples emitted by the site, weekly email and Explorer, bounding billable variants per source and rotation. See image delivery.

Develop

npm install
cp .env.example .env   # if present; otherwise see env below
npm run dev --workspace=apps/next-app
npm run dev --workspace=apps/api
npm run typecheck
npm run test --workspace=apps/api
npm run deploy --workspace=apps/api   # API Worker
npm run deploy:cloudflare --workspace=apps/next-app   # Site (builds first)
npm run deploy:cloudflare --workspace=apps/web        # Explorer (separate deployment)

Env (site): NEXT_PUBLIC_API_URL, NEXT_PUBLIC_R2_PUBLIC_DOMAIN, STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET, CRON_SECRET, NEWSLETTER_ADMIN_SECRET, RESEARCH_API_SECRET.

Site bindings: ARCHIVE_API service binding to the existing API Worker, Images, Analytics Engine, R2 incremental cache, Durable Object revalidation queue/tag cache, MAIL_DB and native EMAIL. The public API is https://api.mtlarchives.com; new newsletter action links and standalone video/reel clients use that domain. Email templates and recipient rules are preserved; delivery evidence is durable and unknown outcomes require review. Clerk remains the game identity provider.

Secrets (Worker): RESEARCH_API_SECRET, optional LAMBDA_API_KEY (GPU stays off until a named job is authorized).

Docs

Instagram/Facebook packaging lives in pipelines/daily-reel and apps/story-video (npm run social:today). That is the social funnel, not search. Social publishing is hard-off in both deployed environments. The renderer starts for queued render work, drains its response inside the Durable Object, then destroys the container; the two-minute idle timer is a fallback. See the container cost and shutdown evidence.

Print fulfillment is still manual after Stripe payment. Newsletter is explicit opt-in.

The snapshot Explorer includes researcher map settings: published/local/broad layouts, true 2D/3D similarity, date-depth views, and cancellable custom UMAP. Custom layouts persist on the device; uncached shared layouts ask before computing. Shared links and result exports record settings and snapshot identity; see Explorer documentation.

Production hosting uses Cloudflare Custom Domains: www.mtlarchives.com (site), explorer.mtlarchives.com (snapshot Explorer), and api.mtlarchives.com (API). The previous site and Explorer Vercel projects are retired. See Cloudflare operations for manual deployment, mail evidence, cron, private domains and the historical email-link compatibility transition.

Job 0 data foundation

The production source of truth is D1 mtl-archives, with provenance-aware source records and photo facts. The existing API reads the compatibility manifest view over accepted facts. Stories and durable mail delivery share DB. See data model and adding a source. Public images use https://images.mtlarchives.com; v2 staging has its own D1, a configured transactional EMAIL sender, and the game/watchdog schedules listed in the API Wrangler configuration.

Print sales are paused: /print and /checkout serve bilingual noindex notices, and /api/checkout returns 410. Photo credits and linked licenses resolve from the source registry.

A2 adds immutable source-record versions, official geographic layers, REAL coordinate facts, exact civic-address/landmark matching and bilingual titles with separate catalogue credits and cotes. Street names alone never locate a photo. Its data bundle passed the 200-photo review gate and was promoted to production on 2026-10-24; see A2 workflow.

Official index maps remain hidden source assets; public photo routes return 404 for hidden records. UI dates are normalized without changing archival facts, and photo titles avoid repeated years. See the visibility and display contract.

Navigation geography uses Ville de Montréal’s 32 quartiers sociologiques (2014, CC BY): accepted points derive jurisdiction-aware quartier, arrondissement/linked-city borough, or off-island municipality facts. photo_resolved.neighbourhood aliases quartier; housing-reference areas remain as detail-only reference_area. See navigation data workflow.

B3 staging card processing and static home maps are documented in the data model; refresh commands preserve archival originals.

Latest B3 staging acceptance and per-board results: round 2 verification.

MTL email templates now live in packages/emails: React Email generates both HTML and plain text for B3 newsletter confirmation/welcome/unsubscribe, partner notices and legacy newsletter senders. Weekly editions are stored only. Sponsor templates and their separate-repository integration plan are prepared without changing or deploying mtl-sponsors. The package README documents the owner-only staging QA gate and sender boundaries.

Prepared B3/E1 production steps, Turnstile prerequisite, rehearsed D1 delta and pinned rollback versions: 2026-10-26 release runbook. The owner-authorized production rollout is recorded in the shipped receipt.

Post-launch fixes on b3-post-launch-fixes shipped after staging verification: active subscribers can change their followed place without reconfirming (60-second cooldown and an atomic audit event). Hub maps preload their code, receive live photo coordinates with the page, and render archive layers before basemap tiles finish; existing static map artwork fills the loading frame.

Photo credits follow the owner’s 2026-10-26 direction: retain Archives attribution and the cote, omit licence and commercial-authorisation assertions from HTML, public API records, Markdown, llms and structured data. Acquisition provenance in D1 is retained. See post-launch verification.

B4 site-core staging candidate lives on b4-site. Shared schema, draft placement behavior, and sibling integration contracts are recorded in docs/b4/MIGRATIONS.md. Child A uploads unpromoted staging version previews; Claude owns combined staging deployment and the full sweep.

B4's bilingual daily game is being verified on unpromoted staging version previews at /fr/jeu and /en/game. The game API, queue preparation, scoring, and integration contract are documented in docs/b4/GAME.md; production release remains owner-controlled.

B4 content (staging only)

Child C on b4-content adds paired FR/EN web stories, a separate owner story approval in the social review screen, draft-only sourced quartier introductions, and the React Email weekly letter. See content integration and QA. Shared staging API/site integration is one combined A/B/C deployment; Child C uses unpromoted version previews. Production social and weekly sending are not enabled by this work.

The localized public story renderer includes the standalone lede, captioned inline photos, quartier links, sources, place chips and a quartier-preset follow form. API story reads preserve optional section ledes. Story Markdown and Article JSON-LD preserve the same ledes, photos, captions and quartier links. Captions use normalized dates, and the hero is omitted from inline photos. Only published stories appear publicly; partner end cards require an active placement.

B4 integration on b4-integration combines site, game and content; shared staging API/site are promoted for integration QA. See the integration report for route evidence, migration order, release gates and unexecuted production deploy/rollback commands. The reviewed b4-search job is integrated with the B4 pages; see the search release record below. Production release remains owner-controlled. Reviewed B4 search work from b4-search is integrated into b4-integration: caption-aware hybrid retrieval, bilingual descriptive card titles/alt text, confidence-bearing tag filters, separate place chips, anonymous zero-result logging, and a proposed 2,000-photo curation list. Review uses the isolated preview, with no custom-domain routes; shared staging belongs to b4-integration. See search diagnosis, stable API contract, judged evaluation and orientation audit. Claude approved the 20-query visual evaluation and orientation repair on 2026-10-26; production receipts and rollback are in the release record.

B4 search release integration preserves the B4 boards and 12-card paging, using the search API contract. Production orientation facts select new b4-orientation-production-v1 card keys; rejecting release facts restores existing B3 keys. Original image keys and canonical metadata remain unchanged.

Story drafting now follows the v2 editorial workflow: institutional research, Sonnet-only generation, and approved Markdown imports that remain unpublished until the owner publishes them.

Public API security (2026-10-27): legacy newsletter signup and story publishing are retired (410); legacy daily/guess/leaderboard game routes are removed. Signup uses the double opt-in /api/archive/subscribe; active place changes require emailed confirmation. IP limits protect signup, archive search, game writes and provenance-package writes. Challenge images use an opaque, metadata-free JPEG endpoint. See docs/reviews/FIXES-2026-10-27.md for release evidence and remaining findings.

Staging-only follow-up (2026-10-27): story discovery uses bounded live batch photo lookups; the home hero/preload share a responsive AVIF ladder; the game cron maintains 60 future days and emits GAME_QUEUE_LOW below 30. The staging migration ledger is reconciled; use a fresh D1 Time Travel bookmark before future production migrations. The Sonnet web-story path streams with larger output budgets; a real draft still requires a configured Anthropic BYOK key. These follow-ups are not promoted to production.

Home map hover/selection uses the immutable per-quartier points snapshot in DATA-CONTRACT.md, retaining all accepted primary-quartier points at the approved low zoom. Carte and hub maps continue to read PMTiles.

The final D inventory includes 13,489 ladders, 2,000 curated OGs, 2,061 packed DZIs and 17,296 rails, plus 32 unsimplified quartier-point snapshots. Cost, route retirement and immutable asset proofs are linked from the data contract and runbook.

V2 above-fold images use the same-origin /i/ladder/v1/ f

Description taken from the repository README.

Ratings

–
0 ratings
5 0
4 0
3 0
2 0
1 0

Rate this app

Sign in to rate

Comments 0

Sign in to comment

No comments yet.

Related apps

#archives · #montreal