<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: emmi-dev12</title>
    <description>The latest articles on DEV Community by emmi-dev12 (@emmi-dev12).</description>
    <link>https://dev.to/emmi-dev12</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4070971%2Fc01ea573-69dd-4d7b-a3f0-27acb9ff7a6c.png</url>
      <title>DEV Community: emmi-dev12</title>
      <link>https://dev.to/emmi-dev12</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/emmi-dev12"/>
    <language>en</language>
    <item>
      <title>‎Let clients edit. Not break. — building a permission-first CMS</title>
      <dc:creator>emmi-dev12</dc:creator>
      <pubDate>Mon, 10 Aug 2026 09:35:43 +0000</pubDate>
      <link>https://dev.to/emmi-dev12/let-clients-edit-not-break-building-a-permission-first-cms-4lgd</link>
      <guid>https://dev.to/emmi-dev12/let-clients-edit-not-break-building-a-permission-first-cms-4lgd</guid>
      <description>&lt;h2&gt;
  
  
  The problem every CMS has
&lt;/h2&gt;

&lt;p&gt;Every CMS makes the same bet: hand the client the whole dashboard and hope they don't move a section, pick a neon-green heading, or delete the layout on the way out.&lt;/p&gt;

&lt;p&gt;I got tired of taking that bet. So I built &lt;strong&gt;Castor&lt;/strong&gt; — a CMS where &lt;em&gt;you&lt;/em&gt; decide exactly what each client can change, and the system enforces it.&lt;/p&gt;

&lt;p&gt;The one-liner: &lt;strong&gt;Let clients edit. Not break.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;They change the words and the photos in the browser. They can't move a section, choose a colour that isn't yours, or touch the code.&lt;/p&gt;

&lt;p&gt;Free, open source (AGPL-3.0), self-hosted. Live editor demo: &lt;a href="https://castorcms.vercel.app" rel="noopener noreferrer"&gt;https://castorcms.vercel.app&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Most CMSes are binary. This one isn't.
&lt;/h2&gt;

&lt;p&gt;In most tools a field is either editable or it isn't — and "editable" usually means the client gets everything.&lt;/p&gt;

&lt;p&gt;Castor is per-capability. Each of these is an independent switch, with its own allowed range:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;text&lt;/li&gt;
&lt;li&gt;images&lt;/li&gt;
&lt;li&gt;links&lt;/li&gt;
&lt;li&gt;text colour&lt;/li&gt;
&lt;li&gt;section colours&lt;/li&gt;
&lt;li&gt;spacing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Any combination is valid. Set it per site, and a single page can override the site's defaults. You're not picking a tier — you're drawing a line exactly where you want it.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;The client may edit&lt;/th&gt;
&lt;th&gt;The client may never touch&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;The words, the photos&lt;/td&gt;
&lt;td&gt;The layout&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Links and buttons&lt;/td&gt;
&lt;td&gt;The structure&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Colours &lt;em&gt;you&lt;/em&gt; allow&lt;/td&gt;
&lt;td&gt;Anything off-brand&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Spacing &lt;em&gt;you&lt;/em&gt; allow&lt;/td&gt;
&lt;td&gt;The code&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  The part I'm actually proud of: the Guardian
&lt;/h2&gt;

&lt;p&gt;The permission switches are the UI. The enforcement is a separate, deterministic (no AI) policy engine I call the &lt;strong&gt;Guardian&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Every edit passes through it before it touches the draft. It validates against the per-capability permissions server-side — so even if the editor UI is wrong, or tampered with in the browser, an out-of-bounds edit still doesn't save.&lt;/p&gt;

&lt;p&gt;The rule I held myself to: &lt;strong&gt;never trust the client UI alone to prevent an out-of-bounds edit.&lt;/strong&gt; The line lives on the server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Draft → Publish → Rollback
&lt;/h2&gt;

&lt;p&gt;Nothing a client does is public until they explicitly publish.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Edits land in a private draft.&lt;/li&gt;
&lt;li&gt;Publishing snapshots the whole site.&lt;/li&gt;
&lt;li&gt;Rollback moves the live pointer to any past version — one click.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The client can experiment freely; the live site stays exactly as it was until someone presses Publish.&lt;/p&gt;

&lt;h2&gt;
  
  
  Already have a site? Import it.
&lt;/h2&gt;

&lt;p&gt;Drag a ZIP of HTML/CSS/JS onto the dashboard and it becomes editable. Imported pages render in a &lt;strong&gt;sandboxed iframe&lt;/strong&gt;, so their own JavaScript still runs — but can't reach cookies or another client's site.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it fits together
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;YOU (local)                    MongoDB Atlas         YOUR CLIENT (any browser)
  Admin dashboard  ─build/import─▶ shared database ◀─edit─  /edit/&amp;lt;slug&amp;gt;
  - set permissions per site                              • inline edit, in the page
  - master editor, full control                           • Draft → Publish
       │                                                  • can't break the layout
       └────────────── public site: your-app/&amp;lt;slug&amp;gt; ──────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One Next.js app, two modes. Site-building, importing, and structural editing run only locally; the deployed instance serves just the password-gated editor and the public sites. Both share one MongoDB Atlas database, so a site you build on your machine is instantly editable at its hosted link.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Content model:&lt;/strong&gt; &lt;code&gt;Site → Pages → Sections → Slots&lt;/code&gt;. A section is a typed block (&lt;code&gt;hero&lt;/code&gt;, &lt;code&gt;text&lt;/code&gt;, &lt;code&gt;features&lt;/code&gt;, &lt;code&gt;testimonials&lt;/code&gt;, &lt;code&gt;faq&lt;/code&gt;, &lt;code&gt;gallery&lt;/code&gt;, &lt;code&gt;form&lt;/code&gt;, &lt;code&gt;cta&lt;/code&gt;, &lt;code&gt;footer&lt;/code&gt;, or an imported page); a slot is one editable value.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stack
&lt;/h2&gt;

&lt;p&gt;Next.js 16 (App Router) · TypeScript · Tailwind · MongoDB Atlas · deployed on Vercel. The whole thing runs on free tiers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why AGPL, not "source-available"
&lt;/h2&gt;

&lt;p&gt;Because the whole pitch is trust.&lt;/p&gt;

&lt;p&gt;Use it, modify it, run it commercially for as many clients as you like — free. The one condition: anything you build on it, including a version you host as a service, stays open under the same licence. You can't take Castor closed-source.&lt;/p&gt;

&lt;p&gt;That's deliberate positioning, not just a licence checkbox: it competes with hosted page-builders on cost, and with closed source-available tools on trust.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it doesn't do (yet)
&lt;/h2&gt;

&lt;p&gt;It's early and does one thing on purpose — guarded content editing for content sites. So, honestly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Content sites, not apps.&lt;/strong&gt; It renders content from a database; it doesn't run your framework. Build your React/Next project first, then import the output.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Imported ZIP sites are frozen&lt;/strong&gt; — every word is editable, but they won't restructure or pick up renderer improvements.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Images are referenced by URL&lt;/strong&gt; — no built-in upload/host step yet.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One owner&lt;/strong&gt; — a single admin password, no team roles yet.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Undo/redo covers content&lt;/strong&gt;, not structural changes.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Live editor demo:&lt;/strong&gt; &lt;a href="https://castorcms.vercel.app" rel="noopener noreferrer"&gt;https://castorcms.vercel.app&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Code:&lt;/strong&gt; &lt;a href="https://github.com/emmi-dev12/castor-cms" rel="noopener noreferrer"&gt;https://github.com/emmi-dev12/castor-cms&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'd love feedback on the permission model specifically. If you build sites for clients: where would &lt;em&gt;you&lt;/em&gt; want to draw the line — and what's the first thing you'd try to break?&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fk6r3hicpuuayxfjfj2ji.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fk6r3hicpuuayxfjfj2ji.png" alt=" " width="799" height="335"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
