Projects

fankritsFanslides

Thai news-deck studio

Fanslides#

A private tool that turns one AI or tech news story into a short Thai slide deck for social posts: a cover, a few question-and-answer slides and a US stock chart. An editor, a PNG exporter and an MCP server let a model draft the deck while the server enforces the house style.

  • TanStack Start
  • Nitro
  • Neon Postgres
  • Drizzle
  • satori + resvg
  • MCP
  • Cloudflare Workers

At a glance

Access
Internal tool, not publicly linked
Repository
Private
Output
Portrait 9:16 slides by default (4:5 and 16:9 also supported), exported as PNG
Language
Slide copy in Thai, English company names kept as written
Hosting
Cloudflare Worker, deployed from GitHub Actions
Data
Neon Postgres: daily folders, decks, uploaded images, TikTok link state
The Fanslides deck editor showing a cover slide and two question-and-answer slides side by side, each with a logo and Thai text on a light page
The deck editor: one portrait card per slide, with logo, image and reorder controls.

Overview#

Fanslides produces the short portrait decks that accompany a daily AI and tech news feed. Every deck covers one story and is anchored on one US-listed tech company: a cover, two or three question-and-answer slides, and a closing stock chart slide.

It exists because the format is repetitive and the rules are strict: Thai copy, short answers, a verified ticker, a dated source. Instead of relying on a prompt, the server checks every deck against those rules and refuses to save one that breaks them.

Features#

  • Deck list. A paginated table of decks by date, category, topic and one-line summary, with a selectable page size.
  • Three slide types. Cover, Q&A and a stock-chart slide. Add, delete and reorder slides in the editor; each change is validated against the slide schema.
  • Brand logos by name. Logos are picked from a searchable brand registry and stored as a short reference, not a guessed URL. A cover can carry a second logo, and logos can be resized or recoloured.
  • Stock chart snapshots. A chart is fetched once, stored inside the slide as price points, and drawn from that data. A deck therefore renders the same next week as today. A Refresh chart button re-fetches it for a ticker.
  • Images. Paste an image URL or upload a PNG, JPEG, WebP or GIF up to 4 MB. Uploads are stored in the database so exports do not depend on other storage.
  • Export. One click returns a ZIP of numbered PNGs, one per slide.
  • Send to TikTok. Pushes the exported slides to your TikTok inbox as a photo draft; you review and publish in the app.

Screenshots#

Fanslides home page: a table of daily news decks with date, category, topic and summary columns, and a New deck button
Deck list with date, category, topic and summary, plus pagination and a New deck button.
Editor scrolled to the last slides: a Q&A slide and a stock-chart slide with a company logo, ticker, price chart and price, next to an Add slide control
The closing stock-chart slide with its ticker field and Refresh chart button, and the Add slide control with a slide-type selector.
A second deck's stock-chart slide showing a falling price chart, the ticker and the latest price
Another deck: the chart direction and price come from the stored snapshot, not from a live quote.

How it's built#

A single TanStack Start app on Nitro, built for the Cloudflare Workers module preset. Decks, daily folders, uploads and the TikTok link live in Neon Postgres through Drizzle; slides are stored as validated JSON (a zod discriminated union over the three slide types).

  • One renderer. The editor preview and the export share the same slide layout. Export renders to PNG on the server with satori and resvg-wasm, so it needs no headless browser; Noto Sans Thai and Noto Sans supply the glyphs.
  • Logos. Brand marks come from an open icon registry, are validated against it and cached, so a slide cannot reference a logo that does not exist.
  • Market data. Chart snapshots come from a public quote endpoint behind a small provider interface; failure only blocks creating a chart, never rendering one.
  • Deploys. Pushes to the main branches run check, test and build, then deploy the Worker through GitHub Actions. Runtime secrets live on the Worker, not in the repository.

Drafting decks with MCP#

Fanslides exposes a stateless MCP server so any model, including a weak free one, can draft decks. A default toolset of ten tools covers the path from news to export; a full toolset adds lint, logo search and day-overview tools. A bearer token can protect it.

StepToolWhat it does
1get_style_guideReturns the short house style, or one section in detail.
2find_latest_newsReads dated publisher feeds and returns the newest AI, tech and US-stock stories with their tickers.
3resolve_companyMaps a company name or ticker to a US ticker and logo reference.
4create_news_deckBuilds the whole deck from one flat brief; dryRun checks without saving.
5export_deck_as_imagesReturns a link to a ZIP of PNGs.

The server, not the prompt, enforces the style. It fixes small slips automatically and rejects the rest with a code and a fix the model can act on, for example NOT_THAI, ANSWER_LEN, US_TICKER, STALE_NEWS or SOURCE_MISMATCH. Nothing is saved when a deck is rejected.