Building an AI-Native CMS That Writes, Illustrates, and Publishes Its Own SEO Content
How we built the AI-native CMS behind algoramming.com, a Next.js 16 and Supabase platform that researches, writes, illustrates and publishes long-form SEO articles to four social networks every night, with a human in control by choice.
- Sectors
- SaaS, CMS
- Year
- 2026
- Status
- In production
- Delivered by
- Custom software, Web applications, Mobile apps

The brief, the approach and what changed.
Content marketing does not scale with headcount, and off-the-shelf AI tools produce generic filler that search engines and readers ignore. We needed expert-grade articles, case studies and social posts to stay visible in search and to be quoted by AI answer engines.
We built a private platform on Next.js 16 and Supabase where a nightly Postgres pg_cron job researches a topic with live web grounding, writes a 3,000 word article, generates a cover image, humanizes the draft, renders it, and distributes it to four social networks.
The team now ships expert-grade, 3,000 word SEO articles on autopilot, with original cover art and multi-channel distribution, full per-call cost visibility, and a complete audit trail, so autonomous publishing stays accountable.
- 26
- Feature modules
- 4
- Social channels
- 3,000+
- Words per article
- Nightly
- Cadence
How it was built, and why.
Short answer: Algoramming built its own content platform, an AI-native CMS on Next.js 16 and Supabase that runs the marketing behind algoramming.com. Every night a Postgres
pg_cronjob wakes the platform, and it researches a topic with live web grounding, writes a 3,000 word SEO article, generates a matching cover image, strips the tell-tale signs of AI writing, renders the markdown to server-ready HTML, and fans the post out to Facebook, Instagram, LinkedIn, and X, plus the newsletter. Cost is metered per call, access is enforced at the database, and a human can step in at any point. A job that used to take a person the better part of a day now runs unattended overnight, and every article is built from the schema up to rank in Google and to be quoted by AI answer engines.
The problem
Content marketing works, but it does not scale with headcount. A software company needs a steady stream of technical articles, case studies, job posts, and social updates to stay visible in search, and increasingly to be quoted by AI answer engines like Google AI Overviews, ChatGPT, and Perplexity. Producing that volume by hand is slow and expensive. One good technical article is a half-day of work before it is even shared: research the topic, write 3,000 words, edit them, make a cover image, format it for the web, publish it, and then post it by hand to four social networks and the newsletter. Do that a few times a week and it becomes a full role. Producing the same volume with off-the-shelf AI tools is fast but produces generic filler that search engines and readers both ignore, so it never ranks and never reaches anyone.
We wanted one internal platform that would:
- Write genuinely long-form, well-researched, on-brand articles, not thin AI filler.
- Illustrate each piece with original cover art instead of stock photos.
- Publish and distribute across every channel on a schedule, without someone watching.
- Be built to rank in search and to be surfaced and quoted by AI answer engines.
- Give the team full editorial override, cost visibility, and a complete audit log.
What we built
We built algoramming_cms, a private, staff-facing content and marketing platform that powers the company's public site. It is not a thin wrapper around an AI API. It is a full production system with 26 feature modules spanning authoring, AI generation, autonomous automation, multi-platform distribution, newsletters, and a performance-analytics suite that watches how the published work actually does in search.
| Capability | What it does |
|---|---|
| AI article generation | Long-form SEO articles with live web grounding, structured for featured snippets and AI Overviews |
| AI cover art | Original 16:9 hero images per article, watermarked and optimized |
| Autonomous pipeline | Nightly pg_cron loop: research, write, illustrate, publish, distribute |
| Social distribution | One-click and automated fan-out to Facebook, Instagram, LinkedIn, and X |
| Content strategist | Reads real Search Console, Analytics, Clarity, and Meta data and proposes topics that match live demand |
| Performance suite | Search Console, Bing Webmaster, Analytics, Microsoft Clarity, first-party Pulse analytics, and an on-site SEO auditor |
| Cost governance | Per-call token and dollar telemetry against an editable rate table |
| Access and audit | Postgres Row-Level Security, a role hierarchy, and column-level change logging |
Architecture
The platform runs on Next.js 16 (App Router) with React 19 and TypeScript, a deliberately modern stack. It uses a strict feature-module convention: every module under app/modules/ splits into interface/ for types, api/ for server actions, queries, Zod schemas, and pipeline logic, and view/ for React components with co-located CSS Modules. Route groups separate the admin shell into an authoring workspace, an administration area for AI config and automations, and a performance area for analytics. Because every module has the same shape, the codebase stays predictable and easy to extend.
Supabase provides Postgres, Auth, Storage, and, most importantly, the scheduling backbone. Rather than depend on an external cron service, the automation engine lives inside the database using pg_cron and pg_net, pulling secrets from Supabase Vault and calling the app's worker route with a signed header. One decision worth calling out: the CMS runs on a custom Node server (server.ts) rather than default serverless functions, because AI generation and the automation worker can run for up to four minutes per request, well beyond a typical serverless timeout.
The autonomous content pipeline
This is the heart of the product. Each night a Postgres cron job dispatches every active automation. For each one, the worker walks a fixed set of steps, and every run is idempotent, so a same-day re-trigger can never double-publish.
- Research. Gemini runs with Google Search grounding enabled, so the article is built on current, real facts rather than stale training data. That grounding is also what keeps claims safe to quote.
- Write. A large, carefully engineered system prompt positions the model as a senior software-agency writer, enforces a hard 3,000 word floor, and mandates the structure answer engines reward: a short-answer block, nine to twelve sections, an FAQ, a key-takeaways box, and real stat callouts.
- Illustrate. A separate Gemini image model generates an original 16:9 cover, which is watermarked and resized with
sharp, so every post ships with its own artwork instead of stock photos. - Humanize. A defensive post-processor strips the tell-tale signs of AI writing, the em-dash overuse, the emoji, the filler phrases, while being fence-aware so code blocks survive untouched.
- Render and store. Markdown is the source of truth. The system derives pre-rendered HTML for fast server-side rendering, a plain-text projection for search and AI, plus word count and reading time.
- Publish and distribute. Depending on the automation's publish mode, the post goes live automatically or lands as a draft for review, then fans out to the configured social platforms and the newsletter.
The time it gives back
The real win is not that a model can write. It is that the whole job, the part that used to need a person at every step, now runs on its own. By hand, one article is a chain of separate manual tasks, and the last few are the most tedious: copying the same post into four social networks and the newsletter, one at a time. The platform collapses that chain into a single unattended run, and a human touches it only where they choose to, usually a quick review before it goes live.
Because the tedious parts are gone, the team can publish far more often without adding people, and the time that used to go into copy-paste distribution goes back into the work that actually needs a human. The platform also keeps a full audit trail and cost meter running the whole time, so publishing more never means losing track of what went out or what it cost.
Built to rank in Google and answer engines
Volume alone is worthless if nothing ranks, so discoverability shaped the data model and the prompts from day one. Each article is generated with the exact structure that search engines and AI answer engines reward, and the platform stores everything those systems need to find, trust, and quote it.
- SEO. Articles are generated with an internal-linking inventory of core pages and finished case studies, so every post ships with a real internal-link graph instead of a dead-end page. The schema stores dedicated SEO metadata, tags, canonical-ready slugs, and separate cover and social images, and the HTML is pre-rendered for fast server-side rendering, which search engines favor.
- AEO, answer engine optimization. The short-answer block, the FAQ, and the key-takeaways box are exactly the shapes that win featured snippets, the People Also Ask box, and Google AI Overviews.
- GEO, generative engine optimization. Live web grounding keeps facts current and safe to quote, the humanizer removes the patterns that mark content as low-value, and the clear, claim-first writing makes each article easy for ChatGPT, Perplexity, and other engines to cite accurately.
The platform does not stop at publishing and hope. The built-in Content Strategist reads live Search Console, Analytics, Clarity, and Meta data, weighs it against every post already published, and proposes the next topics where real search demand is going unanswered. So the writing is aimed at what people are actually searching for, not guesses.
Reaching people across every channel
Ranking gets an article found. Distribution gets it seen. The platform treats reach as part of the product, so one article ends up wherever the audience already is, on its own.
The public pages are server-rendered from pre-built HTML, so they load fast and are easy for search engines and AI crawlers to read. The same post is then pushed to Facebook, Instagram, LinkedIn, and X with a caption written for each, and to the email newsletter through Resend. A person can still send any post by hand with one click, but the point is that nobody has to. The audience is reached in search, in social feeds, and in the inbox, from a single piece of work.
Engineering challenges worth telling
The interesting work was in the seams, the places where model output meets a real rendering and publishing pipeline.
Making markdown and inline charts coexist
The writer emits data visuals as multi-hundred-line inline SVG and figure blocks. The markdown parser follows the CommonMark rule that an HTML block ends at the first blank line, so it was closing charts early and re-parsing their internals as markdown, wrapping shapes and labels in stray paragraph tags and producing empty chart boxes. The fix was a protect-and-restore pass: each raw visual is pulled out and swapped for a single-line placeholder before parsing, then restored afterward. A companion step rescues charts the model accidentally wrapped in code fences.
Surviving malformed JSON from a language model
Structured generation needs valid JSON, and models do not always deliver it. Rather than fail, we wrote a character-level JSON-repair state machine that fixes unquoted keys, single quotes, and trailing commas without corrupting the contents of quoted strings, plus outermost-brace extraction to pull JSON out of the prose wrappers that appear when search grounding is on.
Charts without a charting library
To keep the stack light, the trend charts across the analytics dashboards are hand-rendered SVG using a from-scratch monotone-cubic smoothing routine, the same curve the popular charting libraries use, so area fills never dip below the baseline. No chart dependency ships to the browser.
Governance, cost, and control
Because AI usage costs real money and the platform touches public channels, control was a first concern.
- Cost telemetry. Every AI call logs prompt, output, and cached tokens plus a computed dollar cost against an admin-editable rate table, surfaced in an AI-usage dashboard.
- Access control. Postgres Row-Level Security enforces a role hierarchy of Super Admin, Admin, and Manager at the database layer, not just the interface.
- Audit trail. A database trigger records column-level diffs and actor snapshots for every change, giving a self-contained, tamper-resistant activity log.
- Editorial override. Automations can publish live or hold posts as drafts, so people stay in the loop by choice, not by bottleneck.
Results
- A marketing team that can publish expert-grade, 3,000 word SEO articles on autopilot, complete with original cover art and multi-channel distribution, without adding headcount.
- Hours of manual work given back on every article, because research, writing, illustration, publishing, and channel-by-channel posting now run as one unattended overnight job.
- Content engineered from the schema up to rank in traditional search and to be surfaced and quoted by AI answer engines, aimed at topics with real, measured demand.
- One article reaching people everywhere at once, in search, in four social feeds, and in the inbox, from a single piece of work.
- Full cost visibility and a complete audit trail, so autonomous publishing stays accountable.
Tech stack
Framework: Next.js 16 (App Router), React 19, TypeScript, on a custom Node server.
Data and auth: Supabase, using Postgres, Auth (email and one-time code), Storage, Row-Level Security, and pg_cron with pg_net for scheduling.
AI: Google Gemini for text (with Google Search grounding, structured output, and streaming) and for image generation, called over raw REST to enable prompt caching.
Content and media: marked for markdown to HTML, sharp for image processing and watermarking, and zod for validation.
Delivery: Resend for transactional email and newsletters, Tailwind CSS 4 with CSS Modules.
Frequently asked questions
What is an AI-native CMS?
An AI-native CMS is a content platform where AI generation is a core part of the publishing pipeline rather than an add-on. In this project, AI researches, writes, and illustrates articles, and an automated pipeline publishes and distributes them, with people supervising rather than authoring by default.
How much time does it actually save?
The slow parts of publishing, research, writing, editing, illustrating, formatting, and then posting to four social networks and the newsletter, used to be separate manual jobs done by a person. The platform runs all of them as one unattended overnight job, so the team can publish far more often without adding headcount, and a human only reviews a post if they choose to.
How does it help content rank in Google?
Every article is generated with the structure search rewards: a short-answer block, nine to twelve real sections, an FAQ, and a key-takeaways box. On top of that, each post ships with an internal-link graph, dedicated SEO metadata, canonical-ready slugs, and pre-rendered HTML for fast server-side rendering. A content strategist reads live Search Console and Analytics data so the writing targets real search demand.
How does it reach people beyond search?
The public pages are server-rendered and fast, so search engines and AI answer engines can read and quote them, and the same article is automatically delivered to Facebook, Instagram, LinkedIn, X, and the email newsletter. One piece of work shows up in search, in social feeds, and in the inbox.
How does the autonomous publishing schedule work?
A Postgres pg_cron job runs nightly, pulls secrets from Supabase Vault, and calls the app's worker route to run the research, write, illustrate, publish, and distribute pipeline. Runs are idempotent, so a post is never published twice in a day.
How are AI costs controlled?
Every AI call is logged with token counts and a computed dollar cost based on an admin-editable rate table, and surfaced in a usage dashboard, which keeps autonomous generation financially transparent.
Key takeaways
- AI content only scales when the pipeline around it is production-grade. Grounding, humanizing, rendering, and distribution matter as much as the model.
- The real saving is the tedious work. Automating research, illustration, and channel-by-channel posting gives hours back on every article.
- Optimize for ranking at the schema and prompt level, not as a later SEO pass, and aim the writing at real, measured search demand.
- Reach is part of the product. One article, written once, is found in search and delivered to people across every channel on its own.
- Autonomy needs accountability. Cost telemetry, Row-Level Security, and column-level audit logging make unattended publishing safe to trust.
Want a platform like this for your team? Get in touch with Algoramming.
A closer look at the work.
Other case studies from the studio.

Sparrow: A Serverless, Peer-to-Peer Photo and Video Sharing App
Sparrow is a serverless, peer-to-peer photo and video sharing app built by Algoramming. Your phone becomes a live host and the people you invite connect directly, so photos and videos stream device to device over encrypted WebRTC, never uploaded, never stored in the cloud.
Running on paper somewhere you should not be?
Tell us what the process looks like today. A lead engineer reads every brief and replies within one business day with a concrete, no-obligation next step.

