4
6 Comments

The Tech Stack for my AI SaaS

Building an AI startup is hard. There are a myriad of things you must plan for, build, and think about. Here's my journey on how I arrived on the tech stack for ChatDB.

For context, ChatDB.ai is a platform where you can query database with natural language and AI. Things that were most important to me when choosing a tech stack were:

  • Iteration Speed
  • User Experience
  • Performance
  • Support / Simplicity

Next.js deployed to Vercel for the frontend

In the initial MVP, I chose Next.js for the frontend because of the tooling, developer experience and my iteration speed. Next.js comes built in with Edge / Serverless functions, SEO, and many helpful abstractions such as blob storage, redis, and preview links for your PRs.

Additionally, Vercel has many templates for AI apps to help you get started on your way. Here is a couple example templates you can work from:

  • Chat with PDF
  • ChatBot UI
  • StableDiffusion / Replicate Examples

For ChatDB, when I need to build things like dynamic open graph images, shareable links, or custom domains, Vercel has a solution and guide for how to do it at an affordable or free cost.

The most important thing here is

Choose a platform and framework that you have experience with and can ship as fast as possible. Bonus, if it can take care of things you would otherwise build from scratch.

Fastify for APIs

For the ChatDB APIs that do things like query the database, preview the tables etc, I built the API in Fastify. Fastify is a lightweight Node.js HTTP framework that is similar to Express.js. I chose Fastify as it was easy to implement things like:

  • Auth
  • Rate Limiting
  • CORS

Rate limiting is very important for most SaaS and especially for ChatDB as you want to protect user's databases as well as the infrastructure of the product.

FastAPI and Langchain for AI APIs

For the AI APIs, I am using Langchain which is a framework for building AI chains, agents, and tools. Since Langchain is in Python, I needed to write the API in Python. FastAPI is amazing and handles many things out of the box that an AI startup would need:

  • Serialization
  • Validation
  • Rate Limiting
  • Async Requests
  • Performance

FastAPI uses Pydantic under the hook to serialize, parse, and validate API requests which is huge! Langchain also leverages the Pydantic model.

Hope this is helpful and be sure to let me know if you have any questions! For more info on AI startups and frameworks, checkout ChatDB.ai!

on November 6, 2023
  1. 1

    While not necessarily part of the "tech stack", I wanted to know what SEO tools you've decided to use?

    1. 1

      I mainly work out of Google Search Console!

  2. 1

    I am also wandering where did you deploy the Fastly and the backend app?

    1. 1

      Render! It has been great so far!

  3. 1

    That's very interesting, may I ask what's the purpose of Fastify on top of FastAPI, wouldn't the latter be enough?

    1. 1

      Mainly because when I transitioned from Vercel Edge / Serverless, I wrote everything in JS to begin with, so when I transitioned to Fastify it was just easier :)

Trending on Indie Hackers
I spent $0 on marketing and got 1,200 website visitors - Here's my exact playbook User Avatar 58 comments Veo 3.1 vs Sora 2: AI Video Generation in 2025 🎬🤖 User Avatar 27 comments Codenhack Beta — Full Access + Referral User Avatar 21 comments I built eSIMKitStore — helping travelers stay online with instant QR-based eSIMs 🌍 User Avatar 20 comments 🚀 Get Your Brand Featured on FaceSeek User Avatar 18 comments Day 6 - Slow days as a solo founder User Avatar 16 comments