How This Site Is Built — Behind the Scenes of KoishiAI
Behind KoishiAI: Astro builds every page as a static HTML file, Cloudflare Pages serves it, and a Python backend takes each news story from source to site.
TL;DR: KoishiAI builds its pages with Astro 5 as static HTML files and serves them from Cloudflare Pages. The backend is written in Python and has a scheduled job that runs once a day. A news story goes through source research, drafting, a fact check against the sources and a quality score before it is published.
[Updated · 2026-10-11] Rewritten in full to match the current system. The April version contained several statements that were outdated or wrong; they have been removed.
[Updated · 2026-10-14] Corrected the sentence about the two languages. It said every page exists in both; that holds for articles, guides and tools, while the tag pages of the two languages do not match.
Key facts
- Pages are built with Astro 5 and come out as static HTML files.
- The site has two languages, Thai and English, without an extra library.
- It is served from Cloudflare Pages (Firebase Hosting until 15 October 2026), with images stored in the same place as the pages.
- The backend is written in Python and keeps its queue and work logs in SQLite.
- A scheduled job runs once a day and aims to publish one news story.
- A draft that scores below the quality threshold is held; it goes live only if a later revision passes.
- The source code is not public.
KoishiAI is a bilingual AI news and insights site. We use AI systems to assist the editorial work. This article explains what the site is built with, and what a news story goes through between a news source and the page you read.
Frontend
- Astro 5 builds every page as an HTML file at build time. Readers get a finished file; no server-side code runs when a page is opened.
- Tailwind CSS styles the site.
- Strict TypeScript catches mistakes while the code is being written.
- The fonts are IBM Plex Sans Thai and Inter.
- Two languages. Articles, guides and tools are built under both
/thand/en, without an extra library.
The sitemap and each language’s RSS feed are generated at build time as well.
Hosting
- Cloudflare Pages serves the built files to readers.
- Images are stored in the same place as the pages.
- Images and assets may be kept by the browser for 1 year, while HTML pages are fetched fresh every time, so readers always see the latest version.
- Security headers are set at the host, including HSTS and a Content-Security-Policy.
Backend
- FastAPI, in Python, is the backend.
- SQLite holds the topic queue and the work logs.
- APScheduler starts the news job once a day.
The path of one news story
AI news sources
↓
Select a topic, and check it has not been covered already
↓
Find and read the sources
↓
Draft the article from the cited sources
↓
Write the page title and description
↓
Check the facts in the draft against the sources
↓
Score quality (a draft that fails is held, then revised and scored again; if it still fails it is discarded)
↓
Look for a stock photo; a photo carries its photographer credit
↓
Produce the other-language version
↓
Save the file → git commit → build → deploy
↓
Share the day's news story, in its Thai version, to the Facebook Page
The steps above run in our publishing system. An editor reads every article for clarity. If you spot an error, tell us and we will correct it. The Corrections page explains how.
On some days the system also releases older drafts that have been revised until they pass.
Why Astro
- Pages are static HTML files. No server-side code runs when a reader opens a page, which leaves less to secure.
- Articles can be written directly as Markdown files, and Astro builds the pages from them.
- No JavaScript framework is shipped to the browser, so article pages stay light.
What else is on the site
- Tools, such as the Thai Token Counter and Baht amount in Thai words
- AI plan prices shown in Thai baht
- The Claude Code guide and the tutorial series
Source code
The source code of this site is not public.
Sources
- Why Astro?, Astro documentation
- Cloudflare Pages, Cloudflare documentation
- FastAPI, FastAPI documentation
- About SQLite, SQLite documentation
Questions about how the site is built? Leave a comment on our Facebook Page.