Stream Facility

Development Log

A running record of what's been built, what's underway, and what's on the horizon. Updated as the platform grows.

Last updated 2026-09-01

99

Features built

0

In progress

5

Planned

PlatformBuilt
2026-08

Author Manuscript Sales

Authors can now sell access to their manuscripts directly on the platform. Set a price, switch the draft to Paid access mode, and readers purchase through Stripe Checkout — proceeds transfer automatically to the author's connected payout account, minus the platform commission.

  • ·Authors set a price and access mode on any Studio draft — no Stripe product setup needed; checkout sessions are built dynamically using Stripe price_data
  • ·Readers see the chapter and scene structure as a teaser; scene content is gated until purchase
  • ·Stripe Checkout routes proceeds directly to the author's Connect account at the moment of charge via transfer_data — no manual payout steps
  • ·Webhook confirms each purchase and writes to the manuscript_purchases collection; all access checks on the book page and scene API query it
  • ·Authors must have a verified, charges-enabled Stripe Connect account before their draft can be purchased — an amber prompt guides them through setup if not
  • ·Platform-wide feature flag (manuscriptSalesEnabled) lets admins enable or disable manuscript sales without a deploy
PlatformBuilt
2026-08

Author Payout Accounts (Stripe Connect)

Authors can connect a Stripe Express account from Dashboard → Billing to receive proceeds from manuscript sales. Stripe handles identity verification, bank details, and tax documents. The platform retains a configurable commission; the remainder transfers automatically at the moment each sale completes.

  • ·One-click setup from Dashboard → Billing — Stripe Express account created and the standard Stripe onboarding flow opened immediately
  • ·Three states surfaced in the UI: not connected (Set up payouts), verification pending (Complete setup), and active (Manage payouts →)
  • ·Active accounts link to the Stripe Express dashboard for payout history, bank management, and tax documents (W-9 / 1099 handled by Stripe)
  • ·Commission rate is admin-configurable (default 15%); Stripe applies the split automatically at charge time — no manual transfers or ledger entries needed
  • ·A verified, charges-enabled account is required before a manuscript can go on sale — authors are prompted if setup is incomplete
PlatformBuilt
2026-08

Content Reporting & Moderation — Safety Tools for Readers and Authors

Readers can now flag content directly from the manuscript view, and authors whose content is reviewed by the team will receive clearer, reason-specific notifications and see an informative banner on their dashboard — with a straightforward path to dispute any decision they believe was made in error.

  • ·A Report button appears at the end of each scene while reading, opening the report form with the content location already filled in (world, series, book, chapter, and scene)
  • ·Moderation actions now carry a specific reason — such as a copyright claim, a policy concern, or a content safety issue — which is reflected in the notification sent to the author and the banner shown on their dashboard
  • ·Authors whose content is reviewed receive a clear banner on the relevant dashboard page explaining the action, with a built-in dispute form
  • ·Individual scenes can be hidden by the moderation team without affecting the rest of the manuscript — hidden scenes appear as locked in the reading tree while the author retains access to review and correct the content
  • ·The book dashboard surfaces a count of any hidden scenes and prompts the author to review and address them
PlatformBuilt
2026-07

Ad System — Tier Gating & Subscription Visibility

Free-tier users see ads in the Lobby and Library; paid tiers see none. Ads are fully configurable from the platform dashboard — paste any provider's embed code and it goes live immediately, or leave blank for house ads promoting the Indie plan. Purchasing a paid subscription hides ads and the active plan is now clearly shown on the user's profile.

  • ·AdZone component: house ad (Indie upgrade CTA) with fallback; script tags injected via DOM creation so third-party scripts execute correctly in both RSC and client components
  • ·Lobby: two ad placements (after Authors, between Coming Soon and New Releases); Library refactored to server wrapper + LibraryClient so showAds resolves server-side
  • ·Ad placement management: paste any provider embed code (AdSense, Carbon, custom); status indicator (house ads vs. custom active); provider quick-reference guide; clear button
  • ·Config API patched to merge per top-level key so Tier Config and Ads settings save independently without overwriting each other
  • ·Stripe webhook fully wired: checkout.session.completed sets tier on purchase, customer.subscription.deleted reverts to free, invoice.payment_failed marks past_due
  • ·Profile page: new Plan & Subscription section — tier badge, benefit summary, Manage Billing button (Stripe portal) for paid users, past-due warning with payment update CTA
  • ·Subscriber dashboard: tier cell shows Stripe/manual source and subscription status for all paid-tier users
PlatformBuilt
2026-07

Security: Access Control & Gate Improvements

Two access control issues corrected following the unified profile rollout. The Forge was incorrectly gating on a role that no longer exists, blocking authenticated users from reaching their dashboard. Separately, a tier assignment edge case was resolved to prevent unintended tier changes during account management operations.

  • ·The Forge now correctly allows any authenticated user to reach their dashboard; tier limits apply inside
  • ·Tier assignment logic tightened to prevent unintended tier changes during account role updates
PlatformBuilt
2026-07

Unified Author/Reader Profile Model

Eliminated the author/reader registration toggle in favour of a single unified account. Author status is earned (and sticky) the moment a draft is made available or a book is set public. Free-tier users can access the Forge with configurable limits; all tier limits are configurable via the management dashboard.

  • ·isAuthor flag earned when draft accessMode→free/paid or book isPublic→true; never revoked
  • ·isAuthor carried in JWT and refreshed every 5 minutes from DB
  • ·Free tier gets Forge access: 1 world, 1 book, 0 series, 25 codex entries, 0 eras, 1 draft
  • ·TierConfig expanded with maxSeries, maxCodexEntries, maxEras, maxDrafts, canAccessForge
  • ·All 5 new limits are configurable in the platform management dashboard
  • ·InsideNav unified — all users see the same nav including Forge and Studio links
  • ·Discovery queries (lobby, authors, search) filter by isAuthor:true instead of role
  • ·Registration page simplified to name/email/password — no role selection
  • ·Public /readers/[id] profile works for all users; label shows Author or Member dynamically
PlatformBuilt
2026-07

Lobby: Wing Directory

The lobby page now has a four-panel wing directory between the masthead and the following feed. Each panel is a clickable entryway to one of the platform's four areas — The Hearth (Library), Local & You (Authors), The Stage (Beta), and The Forge (Dashboard/Studio).

  • ·gap-px bg-sf-border grid — the border colour is the gap; panels sit flush against each other
  • ·Short h-px w-8 rule at the top of each panel encodes wing personality in colour
  • ·The Hearth (gold): /library if signed in, /sign-in if not
  • ·Local & You (dim gold): /authors — community discovery
  • ·The Stage (crimson): /beta — open manuscripts for beta reading
  • ·The Forge (subtle or border): /dashboard if author, /pricing if not
  • ·sm:grid-cols-2 lg:grid-cols-4 — 2×2 on tablet, 4-wide on desktop
  • ·Compass direction labels removed — those were internal book references, not UI copy
PlatformBuilt
2026-07

Slug URL System

All public and dashboard URLs now use human-readable slugs instead of raw MongoDB ObjectIds. Slugs are generated at creation time and lazily migrated on first visit for existing entities. The server wrapper pattern keeps client components decoupled from slug resolution.

  • ·slugify() + resolveEntitySlug() in src/lib/slugUtils.ts handle creation and resolution
  • ·Lazy migration: first ObjectId visit generates and saves the slug, then redirects
  • ·Server wrapper pattern: thin page.tsx resolves slug → ObjectId; PageClient.tsx receives OID
  • ·Dashboard pages updated: books, series, worlds, codex pages, timeline, currently-writing widget, global codex, persona links
  • ·MongoDB projection caveat: restricted projections must explicitly include slug: 1
  • ·Edit subroutes (/edit) use useParams() and continue to accept ObjectIds — slug support deferred
PlatformBuilt
2026-07

Email System: Verification, Daily Digest & Author Mailing Lists

The platform now has a complete email system built on Resend. New accounts must verify their email before accessing the dashboard. Authors get a daily digest of unread notifications instead of individual emails. Authors can collect subscribers via an external mailing list link or the built-in subscriber system with their own Resend key.

  • ·Email verification: new accounts created with emailVerified=false; 24-hour token sent on registration; middleware blocks /dashboard and /studio until verified
  • ·Daily notification digest cron at 08:00 UTC: groups unread notifications per author into one email; digestSentAt field prevents double-sending; per-author opt-out toggle in Profile
  • ·Author mailing list — external path: paste a Mailchimp/ConvertKit/etc URL in Profile; 'Join my mailing list' button appears on public profile
  • ·Author mailing list — platform path: store own Resend API key (encrypted at rest) + verified from-address; native subscribe widget on public profile
  • ·Subscriber endpoint is rate-limited; unsubscribe via tokenized one-click link appended to every campaign email
  • ·Campaign sending batches recipients at a time using the author's own Resend key (author owns cost + CAN-SPAM compliance)
PlatformBuilt
2026-07

Security Hardening: Pre-Production Audit

Full security audit completed before moving to a live server. All HIGH and MEDIUM severity issues resolved. Covers authentication, authorization, injection prevention, rate limiting, content security headers, account data isolation, and ESLint security rules.

  • ·Session security: short-lived tokens with periodic live re-validation; automatic sign-out on account suspension, deletion, or credential change
  • ·Rate limiting on registration, login, password reset, email verification, and subscriber signup
  • ·Security headers: CSP, HSTS with long-term preload, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Permissions-Policy
  • ·Central middleware enforces authentication on all protected routes
  • ·Strict ownership verification on all resource-scoped API endpoints
  • ·Input validation and allowlist enforcement on all data-modification and AI endpoints
  • ·Secure file delivery for manuscript downloads; file type validation on all uploads
  • ·API responses use explicit field allowlists — sensitive account data is never returned to the client
  • ·Account deletion covers all user data across the platform; internal debug utilities removed from production
  • ·eslint-plugin-security rules enforced as errors across the codebase
PlatformBuilt
2026-07

Image Upload Optimization

Two complementary layers keep uploaded images compact. Client-side canvas resizing fires before the upload even starts. Cloudinary URL transforms ensure optimized delivery to readers regardless of what was stored.

  • ·Client-side: landscape capped at 2400 px, portrait at 1200 px, files over 2 MB compressed
  • ·Canvas → JPEG 0.88 quality output; GIFs pass through unchanged (preserves animation)
  • ·Spinner visible during resize phase, not just during the HTTP upload
  • ·Cloudinary delivery transform injected into stored URL: c_limit, w_2000, q_auto, f_auto
  • ·f_auto serves WebP or AVIF to browsers that support it
PlatformBuilt
2026-07

Save Confirmation Flash

All 23 codex entity and content detail pages now show a green 'Saved ✓' flash for 2 seconds after a successful save — eliminating silent saves that looked like nothing happened.

  • ·SaveButton component manages three states: Saving… / Saved ✓ / Save Changes
  • ·Green background on success state for clear visual confirmation
  • ·Button disabled during both saving and the 2-second success window
  • ·Applied across all codex entity, book, series, excerpt, and era detail pages
PlatformBuilt
2026-05

Platform Shop

Three product types: subscription gift codes, digital content, and physical products. Gift codes redeemable at /redeem extend or grant a subscription tier.

  • ·Gift certificates generate a one-time code after Stripe checkout
  • ·Gifted tier stacks with paid tier; same-tier codes extend expiry
  • ·Products linked to Stripe one-time price IDs
  • ·Order history in Dashboard → Orders
PlatformBuilt
2026-04

Subscription System (Stripe)

Stripe billing for Indie and Pro tiers. Webhook handles subscription events. Tiers can be overridden manually with a billing note.

  • ·Checkout and customer portal via Stripe-hosted pages
  • ·Webhook handles checkout.session.completed, subscription updated/deleted, payment failed
  • ·Tier enforced live from DB — no stale JWT values
  • ·Manual tier overrides available
PlatformBuilt
2026-04

Email Infrastructure (Resend)

Transactional email via Resend. Silent no-op when RESEND_API_KEY is absent — safe in CI. Wired for password reset, beta approval, manuscript revision notifications, and deadline warnings.

  • ·Forgot password: short-expiry single-use reset token
  • ·Beta approval email with deadline date and direct read link
  • ·Manuscript revised: all approved readers notified of new version
  • ·Deadline warning email alongside in-app notification
PlatformBuilt
2026-07

In-App Notification System

A complete in-app notification system: bell dropdown in the nav (with count badge and 5-item preview) and a full notifications page. Six event types trigger notifications — follows, friend requests, friend accepts, beta comments, beta replies, and beta applications.

  • ·NotificationBell in InsideNav: fetches announcements + 5 most recent notifications on mount; red dot when unread; dropdown closes and marks read on link click
  • ·TYPE_ICON map: ◎ beta_comment/reply, ◇ beta_application, ✦ friend_request/accepted, ↑ follow, ♦ gift_received, ✓ purchase_confirmed, ★ gift_redeemed
  • ·follow notification fires on follow, resolves profile link from slug + isAuthor
  • ·friend_request notification fires on POST /api/friends; friend_accepted fires on accept in PUT /api/friends/[id]
  • ·beta_reply fan-out: author reply to a scene triggers insertMany to all readers who commented on that scene
  • ·/dashboard/notifications page: full list, auto mark-all-read after 800ms, relative timestamps, unread badge
  • ·Notifications card added to Dashboard home Social section (now 4-column grid)
  • ·Daily digest cron already integrated — digestSentAt prevents double-sending
PlatformBuilt
2026-07

Shop — Gift From Your Network

Gift certificate purchases can now target a friend directly from a 'From your network' tab in the recipient selector, without having to search by name or email.

  • ·Two-tab switcher: Search (by name/email) and From your network
  • ·Friends list loaded lazily from GET /api/friends on first tab switch
  • ·Accepted friends appear as a scrollable list; clicking sets recipient and returns to the selected state

This log tracks platform features, not individual content. For questions or feedback, get in touch.