BoilerPrompt
Bolt

Bolt prompt to build a blog with a CMS

One Bolt project here holds both halves of a blog, the public site and a password-protected admin with a markdown editor, sharing a single Supabase schema. You end up owning the whole stack: posts as rows you can query, drafts invisible until published, and no external CMS subscription in the loop.

Last updated

Prompt
Build a blog with a small self-hosted CMS in one Bolt project: public site plus an /admin area, Vite + React, connected to Supabase for storage and auth.

Data model, created as a Supabase migration:
- posts: id, title, slug, excerpt, body_md, cover_url, status (draft or published), published_at, author_id.
- tags: id, name, slug, plus a post_tags join table.
Enable row level security: anyone can select published posts, only authenticated authors can insert or update their own rows.

Public screens:
- / : published posts newest first, excerpt and tag chips, paginated 10 per page.
- /post/:slug : renders body_md as sanitized HTML, code blocks in monospace, and a 404 view for unknown or draft slugs.
- /tag/:slug : the same list filtered by tag.

Admin screens behind Supabase email auth:
- /admin : a table of all posts with status badges and edit links.
- /admin/edit/:id : title, slug auto-generated from the title but editable, a markdown textarea with side-by-side preview, and separate Save draft and Publish buttons. Publishing sets published_at once and never overwrites it on later edits.

Edge cases: slug collisions get a numeric suffix, deleting a tag detaches it from posts rather than deleting them, and an empty admin list shows a Create your first post button.

Styling: a reading measure around 65 characters, generous line height, no sidebar on the public site.

Acceptance: sign in through the preview, publish a post, open it by slug while logged out, and confirm drafts stay hidden from anonymous visitors.

Same task in other tools

Questions about this prompt

Why build the CMS instead of pulling in a headless one?

For a blog this size the admin is two screens, and keeping it in the same Bolt project means one deploy, one auth system, and content you can query with SQL. A headless CMS earns its keep with editorial workflows and many authors, and this spec has neither.

How do I let a second author in?

Sign them up through Supabase auth. The RLS policies already scope edits by author_id, so their posts stay theirs. If authors should edit each other's drafts, you need a role column checked in an updated policy, and it is worth asking Bolt for that migration as its own step.

Published posts render fine, but draft URLs show the post too. What happened?

The public query probably fetches all posts and filters status client-side, which also leaks drafts to anyone reading network responses. The real gate is the RLS policy from the migration, select only published rows for anonymous users, so verify the policy exists and the public client holds no privileged key.

Related prompts