<?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>Forem: Rodrigo Borges</title>
    <description>The latest articles on Forem by Rodrigo Borges (@rodrigo_borges_ebd4dfc2c0).</description>
    <link>https://forem.com/rodrigo_borges_ebd4dfc2c0</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%2F3586065%2F75fe2154-b994-4b68-956c-bcfb63ea1804.png</url>
      <title>Forem: Rodrigo Borges</title>
      <link>https://forem.com/rodrigo_borges_ebd4dfc2c0</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/rodrigo_borges_ebd4dfc2c0"/>
    <language>en</language>
    <item>
      <title>I finally launched my first Open Source project: FacilPHP 🚀</title>
      <dc:creator>Rodrigo Borges</dc:creator>
      <pubDate>Tue, 24 Mar 2026 16:41:17 +0000</pubDate>
      <link>https://forem.com/rodrigo_borges_ebd4dfc2c0/i-finally-launched-my-first-open-source-project-facilphp-58hk</link>
      <guid>https://forem.com/rodrigo_borges_ebd4dfc2c0/i-finally-launched-my-first-open-source-project-facilphp-58hk</guid>
      <description>&lt;p&gt;Hey dev community!&lt;/p&gt;

&lt;p&gt;I’ve been writing code for a long time, but I always kept my tools and side projects to myself. Recently, I got tired of that. I wanted to build something small, useful, and put it out there.&lt;/p&gt;

&lt;p&gt;Today, I’m finally pushing the "public" button on my first-ever open-source project: &lt;strong&gt;FacilPHP&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It’s a micro-framework focused insanely hard on DX (Developer Experience) and speed to market. &lt;/p&gt;

&lt;h2&gt;
  
  
  The "Why" behind FacilPHP
&lt;/h2&gt;

&lt;p&gt;I love big frameworks, but sometimes I just want to validate a Micro-SaaS idea or build a prototype in a weekend. I didn't want to spend an hour setting up routes, configuring ORMs, or fighting CORS headers just to get "Hello World" from a database endpoint.&lt;/p&gt;

&lt;p&gt;I wanted the vibe of &lt;strong&gt;file-based routing&lt;/strong&gt; (like Next.js) but in PHP, combined with a super simple database layer (inspired by &lt;code&gt;better-sqlite3&lt;/code&gt; in JS).&lt;/p&gt;

&lt;p&gt;So, I built it. It’s barebones on purpose.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why you might care
&lt;/h2&gt;

&lt;p&gt;If you like skipping boilerplate and jumping straight into code, this is for you.&lt;/p&gt;

&lt;p&gt;Here is how straightforward it is:&lt;/p&gt;

&lt;h3&gt;
  
  
  📁 1. File-Based Routing
&lt;/h3&gt;

&lt;p&gt;Want an endpoint at &lt;code&gt;/api/products&lt;/code&gt;? Just create a file at &lt;code&gt;routes/api/products.php&lt;/code&gt;. Done. No route files to maintain.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class="c1"&gt;// routes/api/products.php&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Facil\Http\Response&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s1"&gt;'GET'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;Response&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="s1"&gt;'message'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'It just works.'&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Need dynamic parameters like &lt;code&gt;/users/42&lt;/code&gt;? Name your file &lt;code&gt;routes/users/[id].php&lt;/code&gt;. The ID comes straight into your closure.&lt;/p&gt;

&lt;h3&gt;
  
  
  🗄️ 2. A true MicroORM (focused on SQLite)
&lt;/h3&gt;

&lt;p&gt;Writing raw SQL is tedious. Setting up a huge ORM with complex models is overkill for prototypes.&lt;/p&gt;

&lt;p&gt;FacilPHP has a fluent Query Builder. It's all about method chaining to get stuff done fast, with total security against SQL injection.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Insert data&lt;/span&gt;
&lt;span class="nv"&gt;$newId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Query&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;table&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'users'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;insert&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
    &lt;span class="s1"&gt;'name'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'Digo'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s1"&gt;'email'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'digo@example.com'&lt;/span&gt;
&lt;span class="p"&gt;]);&lt;/span&gt;

&lt;span class="c1"&gt;// Fetch with relationships (N+1 solved automatically)&lt;/span&gt;
&lt;span class="nv"&gt;$users&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Query&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;table&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'users'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'is_active'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;with&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'posts'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'user_id'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And pagination? One method call.&lt;/p&gt;

&lt;h3&gt;
  
  
  🛡️ 3. "Batteries Included" (The essentials)
&lt;/h3&gt;

&lt;p&gt;Prototypes still need security. FacilPHP handles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;.env Loader:&lt;/strong&gt; Keep secrets secure.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CSRF &amp;amp; Security Headers:&lt;/strong&gt; Clickjacking and XSS protection by default.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Validation:&lt;/strong&gt; Clean pipe syntax, including &lt;strong&gt;CPF/CNPJ&lt;/strong&gt; (Brazilian standard) out of the box.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Auth:&lt;/strong&gt; Simple session-based authentication ready to go.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Check it out
&lt;/h2&gt;

&lt;p&gt;Since this is my first open-source contribution, I know it’s not perfect. It’s far from it. It needs tests, optimizations, and community feedback.&lt;/p&gt;

&lt;p&gt;If you are looking to hack together an idea quickly this weekend, give it a try.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Repo:&lt;/strong&gt; &lt;a href="https://github.com/rodrigocborges/facilphp" rel="noopener noreferrer"&gt;github.com/rodrigocborges/facilphp&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Documentation:&lt;/strong&gt; &lt;a href="https://rodrigocborges.github.io/facilphp/" rel="noopener noreferrer"&gt;rodrigocborges.github.io/facilphp/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Any feedback, bug reports, or contributions are welcome.&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;




&lt;p&gt;Developed by &lt;a href="https://rodrigoborges.dev" rel="noopener noreferrer"&gt;Rodrigo Borges&lt;/a&gt;&lt;/p&gt;

</description>
      <category>php</category>
      <category>webdev</category>
      <category>opensource</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
