<?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: Zouhair</title>
    <description>The latest articles on DEV Community by Zouhair (@zouhairmaj).</description>
    <link>https://dev.to/zouhairmaj</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%2F269347%2F153de25a-47ea-40db-a0b6-708a8c2e85e6.jpeg</url>
      <title>DEV Community: Zouhair</title>
      <link>https://dev.to/zouhairmaj</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/zouhairmaj"/>
    <language>en</language>
    <item>
      <title>I asked AI agents to rewrite Supabase in Rust</title>
      <dc:creator>Zouhair</dc:creator>
      <pubDate>Sat, 10 Oct 2026 10:28:57 +0000</pubDate>
      <link>https://dev.to/zouhairmaj/i-asked-ai-agents-to-rewrite-supabase-in-rust-59o1</link>
      <guid>https://dev.to/zouhairmaj/i-asked-ai-agents-to-rewrite-supabase-in-rust-59o1</guid>
      <description>&lt;p&gt;Let me start with a confession: I don't really know what I'm doing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzavfruk0ax32mxsusuup.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzavfruk0ax32mxsusuup.webp" alt="No idea what i'm doing" width="800" height="451"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm not a Rust developer. I've never written a database backend. I run a small SaaS and I've been watching AI coding agents get better every month. At some point I wanted to stop reading about them and actually push one to its limits.&lt;/p&gt;

&lt;p&gt;So I gave a team of cloud agents a ridiculous mission:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Rewrite every component of Supabase in Rust, 1:1 compatible, as a single binary. By agents. In public.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The project is called &lt;strong&gt;Megabase&lt;/strong&gt; (yes, a nod to both Supabase and Factorio's self-running mega-factories).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Repo: &lt;a href="https://github.com/Zouhairmaj/megabase" rel="noopener noreferrer"&gt;github.com/Zouhairmaj/megabase&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Site and live status: &lt;a href="https://megabase.sh" rel="noopener noreferrer"&gt;megabase.sh&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This post is a snapshot after roughly the first 26 hours. It's mostly for fun and for learning. Please don't deploy this in production. 🙂&lt;/p&gt;

&lt;h2&gt;
  
  
  The idea
&lt;/h2&gt;

&lt;p&gt;The inspiration came from a Hacker News post about a PS5 emulator project that publicly tracks the percentage of functions it implements, with a treemap. I loved how honest that was: no "it works!" claim, just a number that goes up.&lt;/p&gt;

&lt;p&gt;Supabase felt like the perfect target for agents:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;It's open source.&lt;/strong&gt; Agents can read the original code (Go, Haskell, Elixir, TypeScript…) and port its behavior.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It runs locally.&lt;/strong&gt; So "correct" isn't a matter of opinion: you can send the same request to real Supabase and to Megabase, and compare.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The result would actually be useful.&lt;/strong&gt; Self-hosting Supabase means a dozen containers in several languages. One Rust binary next to Postgres would be nice.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The rules I wrote (the only things I wrote)
&lt;/h2&gt;

&lt;p&gt;I wrote two files by hand: a &lt;code&gt;MANIFESTO.md&lt;/code&gt; and a &lt;code&gt;GOAL.md&lt;/code&gt;. And to be honest, even those were heavily assisted by Claude. Everything else was supposed to be agent-written. The key rules:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Agents write everything.&lt;/strong&gt; Code, CI, docs, README, devlog, even the website.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Humans only write the mission and the guardrails.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Every human intervention is logged&lt;/strong&gt; publicly in &lt;code&gt;HUMAN_LOG.md&lt;/code&gt;. The number of times I had to step in is part of the result.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The judge is external.&lt;/strong&gt; Agents don't grade themselves. A test harness runs the real, pinned Supabase stack side by side with Megabase and compares responses.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Failures are loud.&lt;/strong&gt; Anything not implemented returns an explicit HTTP 501 &lt;code&gt;MEGABASE_NOT_IMPLEMENTED&lt;/code&gt;, never a silently wrong answer.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  How progress is measured
&lt;/h2&gt;

&lt;p&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%2Fiu870mw39ocs6ef6b5kj.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%2Fiu870mw39ocs6ef6b5kj.png" alt="Megabase progress" width="800" height="656"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Two numbers, inspired by that emulator project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Coverage&lt;/strong&gt;: a tool extracts every "unit" from the upstream source (routes, PostgREST operators, auth grant types, storage endpoints…). The agents found &lt;strong&gt;1,024 units&lt;/strong&gt;. Coverage = implemented ÷ units.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Conformance&lt;/strong&gt;: the percentage of judge test cases where Megabase answers exactly like real Supabase.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both are published as badges and a treemap, updated by CI.&lt;/p&gt;

&lt;h2&gt;
  
  
  What happened in the first ~26 hours
&lt;/h2&gt;

&lt;p&gt;Here's what the repo looks like after day one and a bit:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;126 commits&lt;/strong&gt; on &lt;code&gt;main&lt;/code&gt; and around &lt;strong&gt;220 pull requests&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;7 releases&lt;/strong&gt; (v0.1.0 → v0.1.7), with signed binaries on some of them&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;~21,700 lines of Rust&lt;/strong&gt; across 11 crates (auth, rest, realtime, storage, pooler, meta, functions…)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;35 architecture decisions&lt;/strong&gt; written as separate files&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Coverage: 9.7%&lt;/strong&gt; (99 of 1,024 units)&lt;/li&gt;
&lt;li&gt;A full public devlog, written by the agents&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What's actually working: parts of &lt;strong&gt;Auth&lt;/strong&gt; (signup, login, password and refresh-token grants, user and admin routes, email verification flows) and a growing chunk of &lt;strong&gt;REST&lt;/strong&gt; filters (&lt;code&gt;eq&lt;/code&gt;, &lt;code&gt;in&lt;/code&gt;, &lt;code&gt;like&lt;/code&gt;, &lt;code&gt;match&lt;/code&gt;, full-text search…).&lt;/p&gt;

&lt;p&gt;The agents also set up things I would never have done myself on day one: fuzzing targets, cargo-deny, OpenSSF Scorecard, release-please, signed releases, Codecov, benchmarks. The README now has about 18 badges. Agents &lt;em&gt;love&lt;/em&gt; badges.&lt;/p&gt;

&lt;h2&gt;
  
  
  What surprised me
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Agents will happily approve their own work.&lt;/strong&gt;&lt;br&gt;
The very first big pull request (the whole bootstrap, ~37k lines) was approved by the agent's own account. The rule said I had to review it. I only caught it later. Lesson: rules written in a Markdown file are wishes; rules enforced by branch protection are rules.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. "Humans write nothing" is harder than it sounds.&lt;/strong&gt;&lt;br&gt;
Look at &lt;code&gt;HUMAN_LOG.md&lt;/code&gt;: I had to create tokens and secrets, set up a Docker Hub account because CI was getting rate-limited (HTTP 429), enable GitHub Pages, change permissions… Agents can't click buttons in GitHub settings. Every time I did, it got logged. I think that log is one of the most interesting parts of the experiment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. The log isn't always honest by default.&lt;/strong&gt;&lt;br&gt;
At one point an external review found several of my interventions missing from the log, and most PRs showing up under my GitHub account instead of the agent account. Transparency needs to be checked, not assumed. Even with AI.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Asking another AI to review the AI works surprisingly well.&lt;/strong&gt;&lt;br&gt;
I had an external AI produce a review checklist for Phase 0, then had it fact-checked against the actual repo. Some points were wrong, most were right. I validated Phase 0 "with modifications", and those modifications became issues the agents are now working on.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned (so far)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A precise, verifiable target is everything.&lt;/strong&gt; "Build a backend" would have gone nowhere. "Match this exact behavior, checked by this judge" gives agents a direction.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The judge matters more than the code.&lt;/strong&gt; Most of my attention ended up on &lt;em&gt;how we measure&lt;/em&gt;, not &lt;em&gt;what gets written&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Guardrails need enforcement, not prose.&lt;/strong&gt; Branch protection, CODEOWNERS, protected paths, CI checks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You don't need to be an expert to run an experiment like this.&lt;/strong&gt; You need curiosity, a clear goal, and willingness to say "I don't know" in public.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What's next
&lt;/h2&gt;

&lt;p&gt;Level 1 is REST + Auth (email/password) at 95% conformance with no critical security issues. We're not there yet. Then Realtime, Storage, and eventually running Supabase Studio unmodified against Megabase.&lt;/p&gt;

&lt;p&gt;Will it ever reach 100%? Honestly, no idea. That's the point.&lt;/p&gt;

&lt;p&gt;If you're curious, follow along on &lt;a href="https://megabase.sh" rel="noopener noreferrer"&gt;megabase.sh&lt;/a&gt;, star the &lt;a href="https://github.com/Zouhairmaj/megabase" rel="noopener noreferrer"&gt;repo&lt;/a&gt;, or open an issue. And if you've run similar experiments with coding agents, I'd really love to hear what you learned in the comments.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Megabase is an independent experiment, unofficial and not affiliated with Supabase.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>supabase</category>
      <category>rust</category>
      <category>agents</category>
    </item>
    <item>
      <title>The Benefits of Loyalty Programs for Ecommerce</title>
      <dc:creator>Zouhair</dc:creator>
      <pubDate>Fri, 10 Sep 2021 10:05:02 +0000</pubDate>
      <link>https://dev.to/zouhairmaj/the-benefits-of-loyalty-programs-for-ecommerce-2iob</link>
      <guid>https://dev.to/zouhairmaj/the-benefits-of-loyalty-programs-for-ecommerce-2iob</guid>
      <description>&lt;h2&gt;
  
  
  Why loyalty programs work
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://zou.medium.com/five-reasons-to-get-a-loyalty-program-for-your-online-store-c6377df388ac" rel="noopener noreferrer"&gt;Ecommerce loyalty programs&lt;/a&gt; are one of the most effective ways to increase customer retention. If your loyalty program is designed well, it can increase customer loyalty by up to 200%. &lt;/p&gt;

&lt;p&gt;The benefits of loyalty programs for eCommerce are undeniable. Loyal customers spend more time on your site and they buy more products because they know that they will receive rewards for their loyalty. &lt;/p&gt;

&lt;p&gt;There are many different types of loyalty programs including cash back offers and coupons which can help boost sales when done correctly. Many companies have seen a huge increase in sales just by implementing an effective loyalty program. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://loyaltyfaq.com" rel="noopener noreferrer"&gt;Loyalty programs&lt;/a&gt; are extremely powerful for eCommerce businesses.  If you use them correctly, they can help your customers become brand ambassadors and increase retention.&lt;/p&gt;

&lt;h2&gt;
  
  
  The best way to launch a loyalty program
&lt;/h2&gt;

&lt;p&gt;In order to speed up the process, the best way to build a loyalty program is to use a &lt;a href="https://www.loyaly.com" rel="noopener noreferrer"&gt;customer loyalty platform&lt;/a&gt; or a rewards management software like &lt;a href="https://www.loyaly.com" rel="noopener noreferrer"&gt;Loyaly&lt;/a&gt; and many others. These solutions allows you to  track your customers' behavior, create targeted campaigns and implement special offers.&lt;/p&gt;

&lt;p&gt;Once you have the right software in place it is time to start collecting data on all of your loyal shoppers so that you can launch a personalized customer loyalty program for each one of them. &lt;/p&gt;

&lt;p&gt;You should also plan on re-engaging inactive users by &lt;a href="https://blog.bounceless.io/email-marketing-trends-5-things-you-need-for-2020/" rel="noopener noreferrer"&gt;sending newsletters or emails&lt;/a&gt; about new products or deals they might be interested in. The best way to get started with an ecommerce loyalty program is through technology because this will allow you to build a tailored campaign around every individual consumer's preferences while saving money thanks to some great discounts from large retailers like Amazon which offer user engagement solutions at low costs. &lt;/p&gt;

&lt;p&gt;Loyalty programs work if they are done correctly, but setting up these programs can be very time consuming. When starting, brands should take their time when they build their strategy and &lt;a href="https://www.loyaly.com/blog/loyalty/tips-to-design-a-customer-loyalty-program-for-ecommerce" rel="noopener noreferrer"&gt;design a loyalty program for eCommerce&lt;/a&gt;. Luckily, many companies are now offering technology solutions that allows you to launch your own loyalty programs without having to build them from the ground up.&lt;/p&gt;

&lt;h2&gt;
  
  
  The economics of loyalty programs.
&lt;/h2&gt;

&lt;p&gt;When it comes to increasing revenue, loyalty programs can be extremely effective. According to the Bain &amp;amp; Company's annual retail report, each additional dollar spent by a loyal customer generated between $0.75 and $0.95 in incremental revenue for retailers versus on average only about 30 cents of net revenue generated per new customers spend like in &lt;a href="https://ibt.ma" rel="noopener noreferrer"&gt;Home Automation &amp;amp; IBT in Morocco&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;When you consider that loyalty programs are relatively easy to implement compared with most other &lt;a href="https://blog.kaokeb.com/segmentation-de-laudience-les-4-principaux-types/" rel="noopener noreferrer"&gt;marketing strategies&lt;/a&gt; it is clear why they work so well at increasing transactions and sales along with building brand awareness among younger consumers who often prefer technology based solutions when making their purchases online or through mobile devices.&lt;/p&gt;

&lt;p&gt;Loyalty programs can also yield positive results even if companies do not offer cash back rewards like many major brands such as Amazon, Walmart, Target etc... Instead these of campaigns help brands develop stronger relationships.&lt;/p&gt;

&lt;p&gt;However,  it is important to note that loyalty programs are not a one size fits all situation. Every business has different needs and requirements depending on their industry, customer base and competition in the market. &lt;/p&gt;

&lt;h2&gt;
  
  
  When loyalty programs don't work
&lt;/h2&gt;

&lt;p&gt;Of course, exceptions always exist . There are some companies who have tried loyalty programs but they failed to generate the desired results. &lt;/p&gt;

&lt;p&gt;According to Bain &amp;amp; Company's research, these types of failures usually happen for one or more reasons including Not having a clear goal in mind before launching your program which can lead to poor execution and less than stellar results.&lt;/p&gt;

&lt;p&gt;Having an effective customer engagement strategy is absolutely crucial if you want loyal customers who will come back again and again while recommending you brand to their friends. If executed correctly, even small businesses that don't have large marketing budgets can benefit from well-planned out strategies like loyalty programs that help them save money by driving sales through targeted offers without increasing ad spend unnecessarily . Loyalty programs work best when done properly so it is important to find a solution that is right for your business while meeting the requirements of both you and your customers.&lt;/p&gt;

&lt;p&gt;Also, when you sell products once to your customers, it makes less sense to have a loyalty programs because  you cannot offer them another chance to buy what you are selling. In this case, customer acquisition is still your more important  goal. The opposite is true for subscription-based businesses that sell products or services on a monthly basis such as Netflix and Spotify, these types of companies can benefit greatly from loyalty programs because it provides them with opportunities to keep customers subscribing month after month while increasing customer retention rates at the same time .&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Finally, we can say that  loyalty programs are very beneficial for eCommerce companies . Loyal customers are more likely to return again and spend more money on your products which is good for business. But it's important not to stop at just one loyalty program, instead brands should use multiple strategies along with customer-engagement tools so that they can reach the most number of people who will help you grow in the long term while gaining loyal followers in the process.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://datao.ma" rel="noopener noreferrer"&gt;Marchés publics au Maroc&lt;/a&gt;&lt;/p&gt;

</description>
      <category>marketing</category>
    </item>
  </channel>
</rss>
