<?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: ning3739</title>
    <description>The latest articles on Forem by ning3739 (@ning3739).</description>
    <link>https://forem.com/ning3739</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%2F3718650%2F63c042b1-c552-42d2-9de7-505c04ad0307.jpg</url>
      <title>Forem: ning3739</title>
      <link>https://forem.com/ning3739</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/ning3739"/>
    <language>en</language>
    <item>
      <title>From repetitive FastAPI setups to a modular CLI generator</title>
      <dc:creator>ning3739</dc:creator>
      <pubDate>Mon, 19 Jan 2026 03:02:24 +0000</pubDate>
      <link>https://forem.com/ning3739/from-repetitive-fastapi-setups-to-a-modular-cli-generator-41pf</link>
      <guid>https://forem.com/ning3739/from-repetitive-fastapi-setups-to-a-modular-cli-generator-41pf</guid>
      <description>&lt;p&gt;I’ve been building FastAPI projects in production for a while, and I kept running into the same problem every time I started a new service:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;setting up database connections (PostgreSQL / MySQL / SQLite)&lt;/li&gt;
&lt;li&gt;implementing JWT authentication&lt;/li&gt;
&lt;li&gt;wiring up Redis for caching&lt;/li&gt;
&lt;li&gt;configuring Celery for background tasks&lt;/li&gt;
&lt;li&gt;writing Docker &amp;amp; Docker Compose configs&lt;/li&gt;
&lt;li&gt;setting up Alembic migrations&lt;/li&gt;
&lt;li&gt;configuring pytest (async, fixtures, etc.)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You know the drill.&lt;/p&gt;

&lt;p&gt;After doing this repeatedly, I decided to extract everything into a reusable, &lt;strong&gt;interactive CLI tool&lt;/strong&gt; called &lt;strong&gt;Forge&lt;/strong&gt;, which generates a FastAPI project based on the features you actually need.&lt;/p&gt;




&lt;h3&gt;
  
  
  How it works
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;ningfastforge
forge init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The CLI walks you through a series of prompts, and based on your choices, it generates a complete project with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ A clean, production-oriented FastAPI project structure&lt;/li&gt;
&lt;li&gt;✅ Database setup (PostgreSQL / MySQL / SQLite) using SQLModel or SQLAlchemy&lt;/li&gt;
&lt;li&gt;✅ JWT authentication (basic or full flow with email verification)&lt;/li&gt;
&lt;li&gt;✅ Redis integration for caching&lt;/li&gt;
&lt;li&gt;✅ Celery configuration for background tasks&lt;/li&gt;
&lt;li&gt;✅ Docker &amp;amp; Docker Compose ready to use&lt;/li&gt;
&lt;li&gt;✅ Alembic migrations&lt;/li&gt;
&lt;li&gt;✅ pytest setup with async support&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  What makes this different from other templates?
&lt;/h3&gt;

&lt;p&gt;The generator is &lt;strong&gt;modular&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Don’t need Redis? Skip it.&lt;/li&gt;
&lt;li&gt;No authentication required? Skip it.&lt;/li&gt;
&lt;li&gt;Only want a simple API with a database? That’s fine too.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Forge only generates the files and configuration for the features you select, instead of forcing a one-size-fits-all template.&lt;/p&gt;




&lt;h3&gt;
  
  
  Links
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/ning3739/forge" rel="noopener noreferrer"&gt;https://github.com/ning3739/forge&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;PyPI: &lt;a href="https://pypi.org/project/ningfastforge/" rel="noopener noreferrer"&gt;https://pypi.org/project/ningfastforge/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Documentation: &lt;a href="https://ningfastforge.readthedocs.io/" rel="noopener noreferrer"&gt;https://ningfastforge.readthedocs.io/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;I’d love to get feedback from other FastAPI users:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How do you usually bootstrap new FastAPI projects?&lt;/li&gt;
&lt;li&gt;What parts do you find most annoying to set up repeatedly?&lt;/li&gt;
&lt;li&gt;Are there features you’d expect from a tool like this but don’t see yet?&lt;/li&gt;
&lt;/ul&gt;

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




</description>
      <category>fastapi</category>
      <category>backend</category>
      <category>python</category>
      <category>devtool</category>
    </item>
  </channel>
</rss>
