Frame Technology and Infrastructure
Part of Frame. Proposed stack for a small initial team; none is implemented or final.
Stack
| Layer | Proposal | Purpose |
|---|---|---|
| Web UI | Next.js, React, TypeScript | Recap cards, forms, lobby, swipe interactions, results, sharing |
| Application API | Go HTTP service | Product authorization, room transactions, import orchestration, recap queries |
| Import workers | Go bounded worker pools | Fetch and parse source pages once supported access is established |
| Jobs | Redis + Asynq | Import/recap/export tasks with retries and progress |
| Product state | PostgreSQL | Immutable snapshots, films, metrics, room membership, votes, results |
| Live room updates | Initial polling; SSE later | Deliver committed revisions and match results without making clients authoritative |
| Session identity | Secure Frame guest sessions; optional OIDC accounts later | Own recaps and room membership independently of public usernames |
| Private files | S3-compatible storage if needed | Optional recap images and bounded parser diagnostics |
| Runtime | Docker Compose locally; managed container host or VM for pilot | Persistent API and worker processes |
Next.js App Router is a UI/server framework option; keeping business state in the Go API avoids splitting room rules between runtimes. Asynq supplies Redis-backed Go tasks. Use PostgreSQL transaction controls and explicit round locking for vote correctness.
System shape
flowchart LR Browser[Web UI] --> API[Go API] API --> DB[(PostgreSQL)] API --> Jobs[(Redis queue)] Jobs --> Worker[Go workers] Worker --> Access[Conditional authorized source access] Access --> LB[Letterboxd public pages] Worker --> DB Editor[Reviewed event datasets] --> DB Worker --> Files[Private export storage] API --> Browser
Keep the source adapter behind a feature flag until Frame Data Sources and Import feasibility is established. Use fixtures for product development in the meantime, clearly labeled as demo data.
Core data
| Record | Key relationships and invariants |
|---|---|
| Frame session/account | Owns saved recaps and membership credentials; not equivalent to a Letterboxd profile |
| Source profile | Normalized username and observed public fields; no verified-ownership assertion |
| Import job/snapshot | Source type, version, completeness, progress, parser version, timestamps |
| Diary event | Source event identity, film, watch date, rating, rewatch flag; retain repeated viewings |
| Watchlist snapshot/item | One film identity per snapshot; frozen inputs for a round |
| Film | Stable internal ID, source IDs/URLs, title/year, reviewed aliases, optional metadata coverage |
| Event dataset | Edition, section, nomination/selection/award records, recipients, sources, review/version |
| Recap | Owner/session, viewing year, pinned source and dataset versions, metric version |
| Room/round | Host, invitation capability, expiry, locked roster, N/K, pool mode, seed, state, revision |
| Deck/member/vote/result | Ordered unique candidate set, authenticated membership, unique choices, one committed winner |
| Outbox event | Durable event identity and revision for asynchronous job/event delivery |
Jobs and consistency
Create job state plus an outbox record transactionally. Dispatch tasks idempotently and reconcile pending work after a crash. Workers claim leases and persist results before acknowledgement; retries must not duplicate diary events, snapshots, or exports. Keep import results immutable once used by a recap or round.
Use a shared source rate limiter across all workers/jobs, bounded retries and request sizes, and a cache keyed by username/source/parser contract. Source limits include redirects and retry attempts. A Redis/limiter failure defers fetching rather than removing load controls.
Room matching remains a short database transaction; do not queue ordinary vote acceptance behind a slow import. Persist revisioned room events in the same transaction and recover current state by query after missed notifications.
Access, sharing, and deployment
- Keep database/Redis private and credentials server-side. Expose the UI/API over HTTPS, ideally on one origin.
- Authorize imports, recaps, and rooms by Frame sessions; fetching a public username does not authorize access to another Frame user’s saved data.
- Rate-limit room joins, imports, and exports; room codes alone should not permit vote impersonation.
- Treat extracted strings and imported links as untrusted. Fixed-host URL reconstruction and outbound destination validation protect the import service.
- Public sharing is opt-in and can be revoked. Export only selected content and avoid leaking raw watchlists or another member’s votes.
- Separate development/preview and production credentials/data. Preview demos use fixtures and restricted budgets.
- Define snapshot/room retention and cleanup. Back up PostgreSQL and verify restore; handle object-storage lifecycle separately.
Operations and cost
Track queue age, import failures by cause, completeness, parser drift, source requests/cache hits, room join/start rate, vote transaction latency, duplicate requests, reconnects, and export failures. Avoid logging full sensitive query strings, room tokens, or individual votes.
Main costs: app/worker hosting, database, queue, storage/egress, retention, and reviewed awards-data maintenance. No LLM, vector database, or graph database is required for the MVP. Evaluate exact versions, hosting regions, plan limits, maintenance, and licensing at implementation time.
Sources checked on 2026-11-18. The proposed stack does not resolve the independent Letterboxd access dependency.