How I used ChatGPT to launch an enterprise-grade SaaS in 8 weeks

This Is Not A Drill!'s dashboard
This Is Not A Drill!'s dashboard

Back in January of this year, I set out to build an enterprise-grade B2B SaaS in under a month, with only two employees: ChatGPT 4, and me.

It took two months, not one. But I was able to build everything ... all by myself:

    • Brand graphics, visual themes
    • An interactive central dashboard
    • An OpenAPI3 API, complete with SDK key management
    • Two SDK’s for easy integration into any application
    • Full automated deployment with CI

Only once did I feel the need to reach out to a developer colleague about a blocking problem the AI couldn’t solve for me. That's a pretty good record.

This posting will highlight what worked and what didn't, in hopes you'll benefit when building your own SaaS.  The content is fairly technical, but as a solopreneur indie-hacker, that shouldn’t phase you. 😃


Since I began writing software way back in 1983, I’ve seen many platforms and languages come and go in popularity (looking at you, Java!). I’ve climbed the corporate ladder, hired and trained engineers and product managers, and launched many startups and startup products. But, for the past 15 years I’ve spent much less time hands-on and more time hand-holding (i.e., as a manager and leader). 

In other words, have I (shudder) become the pointy-haired boss who can no longer build anything themselves?

Is this me?

My Big Questions Are...

    • Am I too old, rusty, or jaded to build something brand new?
    • Is all the hype about what AI’s can do real?  (And if it is, why aren’t my engineering teams using it all day?)
    • Is the role of "builder" actually going to be largely replaced by an AI?

How I Began

My very first day with ChatGPT, I decided to go big or go home. I prompted ChatGPT to design my entire SaaS from the ground up.

Hacker tries for home run on the first hit... ha!

First try

To kick things off, I gave it the high level goal (build a system to solve a need I had at my last job) and asked it to describe what parts of the system are must-haves. Here's what I naively wrote that day:

Create an openapi-2.0 specification for an API used for end-user notifications. This API should allow the developer to fetch one or more notifications to be shown inside a web or mobile applications to users. the notifications are either always sent or sent according to a calendar controlled by the site operator. When notification data is requested by the application it can also pass a unique user id, and the service will not return a notification previously sent to that user and dismissed by that user. the application can make an API call to inform the API that a user dismissed the notification so that it is not returned by the API on future calls. Write typescript code that can support the above specification, using postgres as a data store and nestjs as the ORM.

ChatGPT returned an response that broke the big goal down into six or seven discrete component systems. I then cut and pasted (verbatim) each one of these into individual prompts, and added a request for much more detail: underpinnings, theory, fully coded prototypes, how-to use, how it works, etc.

This gave me mixed results. When you prompt the AI in this piecemeal fashion, because of its limited context window, it forgets whatever it suggested before. Thus, it can create system parts that overlap or conflict with each other, or worse, it'll just re-code in some brand new way, leaving you to interpret which of its answers is “best” or even, feasible.

After a day or so grinding on this approach, attempting to stand up this whole system lickety-split, I realized that the sum of the parts was actually a huge pile of spaghetti code, with no parts working well together. After all, as a "green-field" project, it should launch as unified whole. There shouldn't be any band-aids or migrations on a new baby project!

Spaghetti code, according to Dall-E. Yuck.

I decided to go back to the prompt-writing drawing board.

Second try

In the spirit of explain it to me like I’m five, I revisited every aspect of my initial prompt to ensure nothing was ambiguous, contradictory, subject to multiple interpretations, or not defined at all. This time around, I pasted a very concise, highly detailed product spec into the box.

And... BOOM chakalakka! ChatGPT churned out a way more holistic response, including just about every required subsystem.  With this output, I could stand up much more of my intended product right away. [I bet some PMs out there could stand to write their specs as clearly as an AI needs to actually auto-build from them!]

The Daily Grind From There

After that, my daily process evolved into many heady days of extending features, problem-solving what I already built, and working with the AI to come up with simpler solutions than its first pass. By relaxing some constraints in the original spec, I could usually find ways to reduce the build time. Every feature or function had a post-it note on my wall, and every day, 1 or 2 would come down as "done". Yay ChatGPT!

You can see more of these successful and unsuccessful prompts in this post.

Paul Klee | Runner at the Goal | The Guggenheim Museums and ...
A guy with more hair than I have removing post-its thanks to ChatGPT

Tips On Building a SaaS : ChatGPT as Your Coder

So, you want to roll out your own AI-built SaaS too?

The lists below are intended to help you craft prompts that will accelerate you the most. You can also see where I wasted far too much time trying to get the AI to do what it's not good at.

Things ChatGPT is really good at :

  • Solving arcane compile-time bugs esp typescript lunacy.
  • Coding up things most people truly hate to code (for good reason):
    • Writing Regexes and data processors
    • CSS tricks
    • Polyfill hacks
    • Making layouts responsive
    • Engineering OAUTH (e.g. Google login) flows
    • Solving tricky web protocol problems
    • Writing all the typescript overhead that creates tables / glues your app to your db
    • Coding up controllers and service methods
  • Making standards-quality documents like OpenAPI-spec yaml files, as well as explaining how to automate technical docs creation on top of them
  • Dissecting weird platform requirements like how to use Caddyfiles for Railway. Sure, you could go googling that one half-baked doc some engineer at Railway published last March... but asking the AI to "just go do it" is so much faster.
  • Helping you dig up bug “root causes”, or at least, exhaustively detailing the best places to dig. (Amusingly, the AI guidance often involves simply adding console logging to the right places. Buy low, sell high, says the AI).
  • Being super patient at explaining certain coding fundamentals like closure or useCallbacks that don’t make a lot of sense unless you really grok functional programming or React internals.  But! you can tell it to explain things over and over in different ways until it finally clicks in your slow, meat-based CPU. (No human could have enough patience for my repeated dumb questions or aggro outbursts; but the AI does.)

Stuff ChatGPT is fairly good at :

Sometimes, the AI can be a bit smarmy. If you drop the phrase "best practice" into any prompt, you're sure to get a long lecture on "the right way". You have to sort through that to figure out what you should actually bother with or not. Or you can push back and say, I don't have time for all that, can you tell me what to do in 3 steps or less?

Anyhow, here's a list of its so-so outputs:

  • It'll suggest libraries or 3rd party solutions which may or may not be appropriate (takeaway: tell it clearly whether you want to "build or buy")
  • It'll warn you about what’s not really best practice or won’t scale (and scold you if you opt to take a shortcut!)
  • It'll proffer an upgrade path to best-practice-land from the crap job you coded up so far. It won't tell you if that's worth the time and effort. (Usually, it's not!)
💡
It's best to assume its first response will not be best practice. If you subsequently ask for the best practice, the AI will likely go way overboard, and you’ll have to reel it back into the realm of “one person is building this to ship by tomorrow, can you freakin' simplify this?” – at that point, it will do it.

Ways ChatGPT flails :

  • Remembering that some approaches it told you to try yesterday (or yesterweek) that didn't work back then, probably still won't work. I've read that this is due to OpenAI's "limited context windows", and even though Gemini (Google's AI) has a much bigger context window, compared to ChatGPT its coding responses are often pretty useless.
💡
Since January, the context windows have been growing. ChatGPT4o remembers fairly well what I told it this morning. By tomorrow, though, it still might forget all about it. 😿
  • Keeping up with the latest permutations of a particular library or platform that the AI suggested on its own. This results in outdated guidance, and a shitton of rabbit-holing. Make sure you specify you want only stable, modern tools. No freakin' Java please!
  • Developing any level of self-awareness that some of its answers are just patently wrong, almost silly wrong. Tip: Tell the AI it's wrong, and you get some slim human satisfaction that you know more than the trillion-parameter silicon brain.
  • Developing amnesia on the spot: e.g, ignoring request #1 of a 3-item request prompt (but, to its credit, if you point these things out, it does correct itself). Tip: Keep in mind asking for 3 items in one prompt seems to have only a 50/50 chance you'll get all three.
  • Telling you to use a complex library that is total overkill for your product, and then chasing its own tail for hours to make it work.
💡
For example, I spent a lot of time debugging a queue using tanstack react-query. The AI was only too happy to waste hours doggedly attempting to make things work via 50+ variations on how-to-use-said-library. ChatGPT never gets tired; it has no clue when to just cut its losses and fall back to “build what you need from scratch”.

Since ChatGPT can actually build something from scratch really fast, it's worth serious consideration. From now on, I won't give any open-source library more than 30 minutes of my time. If it's not working in half-an-hour, it might actually be faster to just have the AI code it fully by itself. Weird times!

So next time you reach for some glamorous but ginormous Apache project just to implement a simple queue, think twice. Maybe the AI can do what you need in 500 lines of well-tuned typescript you can actually reason about and debug yourself!

Conclusion

You too can build an enterprise-grade SaaS easily as fast or even faster. You'll need these things you might not already have. They're all free or nearly free.

  • A way to access ChatGPT 4o or 4, or pick your own AI (maybe via a multi-provider like Poe.com)
  • An account at Railway for deployments (or Adapatable) to host your infra
  • An account at Clerk to help you stand up auth and teams
  • An account at Umso or UnicornPlatform to rapidly build a marketing site for your SaaS
  • A NameCheap account (or pick some other DNS provider)
  • For marketing efforts, you may wish to check out Alignable.

Good luck!


Want to learn more about This Is Not A Drill! ? Just head on over to our home page.