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.

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.
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.
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:
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 |
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.
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.
sharp, so every post ships with its own artwork instead of stock photos.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.
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.
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.
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.
The interesting work was in the seams, the places where model output meets a real rendering and publishing pipeline.
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.
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.
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.
Because AI usage costs real money and the platform touches public channels, control was a first concern.
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.
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.
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.
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.
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.
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.
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.
Want a platform like this for your team? Get in touch with Algoramming.
FeaturedAlgonize is the cloud ERP, CRM and POS platform built in Dhaka for multi-branch retail shops, restaurants and delivery businesses. This case study shows how one real-time dashboard unifies sales, inventory, riders, loyalty and accounting across Android, iOS, macOS and the web.
Read case study
02 · RelatedHow Algoramming built an offline-first, weighbridge-integrated waste management platform for Dhaka South City Corporation: a Flutter ecosystem that reads live scale weights, prints tamper-resistant slips, and syncs across transfer stations even when the network drops.
Read case study
03 · RelatedHow Algoramming built DNCC EMS, a cross-platform equipment-management platform on Flutter and Supabase that runs a city corporation's vehicles, spare-parts inventory, procurement, fuel, and maintenance job cards on one double-entry ledger, from any device.
Read case studyWe will reply in plain English within one business day, NDA on request. Discovery call is free.