Replit Agent prompt to build a blog with a CMS
A blog plus CMS is really two apps sharing one database, and the boundaries matter: drafts, slugs, and who gets to publish. This prompt has Replit Agent split public routes from an auth-gated admin, with Object Storage covers and an RSS feed. You end up with a blog you can actually write in, not just render.
Last updated
Build a blog with its own admin CMS in one Repl. Two areas, one codebase. Public site: a home page listing published posts newest first with title, excerpt, and date. A post page at /posts/:slug rendering markdown with code highlighting. An RSS feed at /feed.xml. A 404 page for unknown slugs that links back home. Admin: everything under /admin sits behind Replit Auth, and only the account I sign in with first gets editor rights, tracked in an editors table. The post editor has title, a slug auto-generated from the title but editable, a markdown body with a live preview pane, a cover image uploaded to Object Storage, and a draft or published toggle. Drafts never appear on the public site or in the feed. Data: a posts table with id, title, unique slug, body_md, cover_url, status, published_at, and updated_at in the built-in Postgres database. Seed two sample posts so the public pages render immediately. Behaviors: saving a draft never changes published_at, publishing sets it once, and changing the slug of a published post writes a redirect row from the old slug. Empty and error states: the admin list with zero posts shows a create button front and center. A failed cover upload keeps the editor content intact and reports the reason inline. Done when: I write a draft, preview it, publish it, see it on the home page and in the feed, and confirm a signed-out visitor cannot reach /admin.
Same task in other tools
Questions about this prompt
How does the first-editor rule work?
The first account that signs in through Replit Auth gets a row in the editors table, and everyone else sees only the public site. To add writers later, insert rows directly from the database pane or ask for a small invite screen.
Can I use rich text instead of markdown?
Yes, swap the editor for a rich text field that stores sanitized HTML. Keep the draft and publish rules, the published_at behavior, and the slug redirect logic exactly as specced, none of them depend on the body format.
Draft posts are showing up in the RSS feed, what happened?
The feed query is missing the status filter. Ask the agent to make the home page and the feed share one published-only query, then create a fresh draft and confirm it stays out of both.