<?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: Rubens Bandeira</title>
    <description>The latest articles on DEV Community by Rubens Bandeira (@rubensbmelo).</description>
    <link>https://dev.to/rubensbmelo</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3962436%2F61bf2e76-2bea-40f9-8e3f-ced348455301.jpeg</url>
      <title>DEV Community: Rubens Bandeira</title>
      <link>https://dev.to/rubensbmelo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rubensbmelo"/>
    <language>en</language>
    <item>
      <title>How I Built a Multi-Tenant SaaS ERP Using React, FastAPI and MongoDB — As a Commercial Rep With No CS Degree</title>
      <dc:creator>Rubens Bandeira</dc:creator>
      <pubDate>Mon, 01 Jun 2026 10:04:55 +0000</pubDate>
      <link>https://dev.to/rubensbmelo/how-i-built-a-multi-tenant-saas-erp-using-react-fastapi-and-mongodb-as-a-commercial-rep-with-no-20j0</link>
      <guid>https://dev.to/rubensbmelo/how-i-built-a-multi-tenant-saas-erp-using-react-fastapi-and-mongodb-as-a-commercial-rep-with-no-20j0</guid>
      <description>&lt;p&gt;I wasn't always just a sales rep.&lt;/p&gt;

&lt;p&gt;At 14, I was teaching myself HTML from internet forums — building pages just to see if I could. At 17, I was deep in IRC communities, fascinated by how systems worked under the hood. Pure curiosity. I wanted to understand the mechanics of everything digital around me.&lt;/p&gt;

&lt;p&gt;For years I automated everything I could in Excel with macros and VBA. If there was a repetitive task, I built something to eliminate it. That instinct never left.&lt;/p&gt;

&lt;p&gt;But life took me in a different direction. I became a commercial representative in the packaging industry — selling corrugated cardboard, managing sales portfolios, negotiating contracts across three Brazilian states. Good career. Real expertise.&lt;/p&gt;

&lt;p&gt;Along the way, I also participated in the full implementation of &lt;strong&gt;Winthor ERP&lt;/strong&gt; (PC Sistemas) — covering accounting, inventory and sales modules. I didn't just use systems. I watched them being adopted, saw where users struggled, understood what made software succeed or fail in the real world.&lt;/p&gt;

&lt;p&gt;The tech curiosity stayed dormant.&lt;/p&gt;

&lt;p&gt;Until AI woke it back up.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem I Was Living Every Day
&lt;/h2&gt;

&lt;p&gt;My entire operation ran on spreadsheets.&lt;/p&gt;

&lt;p&gt;Orders, quotes, invoices, commissions, client health, product catalog — everything scattered across dozens of Excel files. Every month I'd spend hours manually calculating commissions, cross-referencing data, building reports for management.&lt;/p&gt;

&lt;p&gt;I knew exactly what the software needed to do. Fifteen years of living the problem gave me that clarity.&lt;/p&gt;

&lt;p&gt;I just needed the tools to finally build it.&lt;/p&gt;




&lt;h2&gt;
  
  
  How I Actually Build Software
&lt;/h2&gt;

&lt;p&gt;I want to be honest about this: I use &lt;strong&gt;Claude&lt;/strong&gt; and &lt;strong&gt;Cursor&lt;/strong&gt; as my primary development tools.&lt;/p&gt;

&lt;p&gt;I'm not the developer who memorizes syntax and builds from scratch in a blank file. I'm the developer who understands the problem deeply, architects the solution, and uses AI to accelerate the implementation.&lt;/p&gt;

&lt;p&gt;That teenage instinct for understanding systems? It turns out that's exactly what AI-assisted development requires. You can't just prompt your way to a production system. You need to think in architecture. You need to understand why things break. You need to know when the AI is confidently wrong.&lt;/p&gt;

&lt;p&gt;Fifteen years of business domain knowledge + ERP implementation experience + decades-old curiosity about how systems work + modern AI tools = RepFlow.&lt;/p&gt;

&lt;p&gt;Here's my stack:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Frontend:  React + Tailwind CSS → deployed on Vercel (repflow.cloud)
Backend:   FastAPI / Python → deployed on VPS (Hostinger)
Database:  MongoDB Atlas
Auth:      JWT + bcrypt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  The Architecture Decision That Changed Everything: Multi-Tenancy
&lt;/h2&gt;

&lt;p&gt;RepFlow isn't just for me — it's a SaaS for all commercial representatives. Every tenant needed complete data isolation from day one.&lt;/p&gt;

&lt;p&gt;My solution: a &lt;code&gt;tenant_id&lt;/code&gt; field on every single document in MongoDB.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Every API endpoint filters by tenant
&lt;/span&gt;&lt;span class="nd"&gt;@router.get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/orders&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_orders&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;current_user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;User&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Depends&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;get_current_user&lt;/span&gt;&lt;span class="p"&gt;)):&lt;/span&gt;
    &lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;tenant_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;current_user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tenant_id&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;to_list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Simple. Effective. Every query is automatically scoped to the tenant. No data leaks between clients.&lt;/p&gt;

&lt;p&gt;If you're building a SaaS, architect for multi-tenancy from the first line of code. Adding it later is a nightmare.&lt;/p&gt;




&lt;h2&gt;
  
  
  What RepFlow Does Today
&lt;/h2&gt;

&lt;p&gt;After months of building — mostly evenings and weekends — RepFlow has:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Client Management&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Customer health scoring&lt;/li&gt;
&lt;li&gt;Automatic address lookup via ZIP code&lt;/li&gt;
&lt;li&gt;Market segment tagging
&lt;strong&gt;Operational Modules&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Orders with open balance tracking&lt;/li&gt;
&lt;li&gt;Full quote → order funnel&lt;/li&gt;
&lt;li&gt;Invoice management&lt;/li&gt;
&lt;li&gt;Commissions with bulk actions
&lt;strong&gt;Reports &amp;amp; Analytics&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;KPI dashboard&lt;/li&gt;
&lt;li&gt;Tonnage: portfolio vs. billed&lt;/li&gt;
&lt;li&gt;ABC Curve analysis&lt;/li&gt;
&lt;li&gt;Client activation tracking&lt;/li&gt;
&lt;li&gt;Revenue by period
&lt;strong&gt;Infrastructure&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Multi-tenant architecture (&lt;code&gt;tenant_id&lt;/code&gt; on everything)&lt;/li&gt;
&lt;li&gt;Super Admin panel&lt;/li&gt;
&lt;li&gt;In-app notifications&lt;/li&gt;
&lt;li&gt;PDF generation (orders, commissions, client reports)&lt;/li&gt;
&lt;li&gt;Security audit: 17 vulnerabilities identified and fixed&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Hardest Part: Security
&lt;/h2&gt;

&lt;p&gt;When I first deployed, I ran a security audit. Found 17 vulnerabilities.&lt;/p&gt;

&lt;p&gt;Things like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Missing rate limiting on auth endpoints&lt;/li&gt;
&lt;li&gt;JWT tokens with no expiration&lt;/li&gt;
&lt;li&gt;MongoDB injection possibilities&lt;/li&gt;
&lt;li&gt;Unprotected admin routes
The 14-year-old who used to dig into how systems worked — he came in useful here. Each vulnerability I researched, understood, and fixed. This part wasn't glamorous. But it taught me more about real production systems than any tutorial ever could.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What I Learned
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Domain knowledge is a superpower.&lt;/strong&gt;&lt;br&gt;
I didn't need to imagine what the software should do. I lived the problem for 15 years. That clarity accelerated everything — and no junior developer could replicate it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. AI doesn't replace understanding — it requires it.&lt;/strong&gt;&lt;br&gt;
If you don't understand what you're building, AI-assisted development produces working code that does the wrong thing. The curiosity to understand systems matters more than ever.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Ship early, fix constantly.&lt;/strong&gt;&lt;br&gt;
RepFlow went live before it was "ready." Real usage revealed problems no amount of planning would have caught.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Your past is not irrelevant.&lt;/strong&gt;&lt;br&gt;
Every macro I wrote in VBA, every HTML page I built at 14, every hour spent understanding how systems worked — it all compounded into this. Nothing was wasted.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Implementing software is different from using it.&lt;/strong&gt;&lt;br&gt;
I was part of a full ERP rollout covering accounting, inventory and sales. Watching real users adopt — and resist — a system taught me more about UX and product decisions than any design course. When I built RepFlow, I already knew which features would actually be used and which ones would be ignored.&lt;/p&gt;




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

&lt;p&gt;I'm currently building &lt;strong&gt;Cloudmetric&lt;/strong&gt; — an IoT monitoring system for short-term rentals. ESP32 sensors reading temperature and humidity every 2 minutes, LG ThinQ AC integration, real-time dashboard, Eco Score and ESG reporting for Airbnb hosts across Europe.&lt;/p&gt;

&lt;p&gt;I'm also moving to Lisbon to apply to &lt;strong&gt;42 Lisboa&lt;/strong&gt; — the peer-to-peer programming school with no teachers, no lectures, pure problem-solving. Feels like the right next chapter.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Point
&lt;/h2&gt;

&lt;p&gt;You don't need a CS degree to build real software.&lt;/p&gt;

&lt;p&gt;But you do need something most tutorials won't give you: a real problem you understand deeply, the patience to learn how systems actually work, and the honesty to fix what's broken.&lt;/p&gt;

&lt;p&gt;The curiosity that started at 14 — that's what got me here.&lt;/p&gt;

&lt;p&gt;RepFlow is live at &lt;strong&gt;&lt;a href="https://repflow.cloud" rel="noopener noreferrer"&gt;repflow.cloud&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Built with React · FastAPI · MongoDB · Claude · Cursor&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Follow me here on dev.to — next article: building Cloudmetric, an IoT system for Airbnb hosts in Europe.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>career</category>
      <category>react</category>
      <category>saas</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
