Building a SaaS with Codex
A step-by-step journey of building PromptSteps from idea to MVP with AI.
01Choosing the stack
⌁User prompt
Help me choose the best tech stack for a Next.js SaaS with user authentication, payments and a PostgreSQL database. I want something modern, scalable and developer friendly.
Assistant response
Here’s a proven, modern stack you can ship fast:
- Next.js 16 (App Router) — Frontend + API routes
- TypeScript — Type safety
- Tailwind CSS — Styling
- Neon Postgres — Database and authentication
- Drizzle ORM — Type-safe queries
- Vercel — Hosting and deployments
This stack is developer-friendly, scalable, and works especially well with AI tools.
02Designing the database
⌁User prompt
Design the initial database schema for a SaaS with users, conversations, messages and structured steps.
Assistant response
Start with a small relational core and keep authentication data separate:
create table conversations (
id uuid primary key,
owner_user_id uuid not null,
title text not null,
visibility text not null default 'private',
created_at timestamptz default now()
);
Give messages and steps their own tables so chronology stays intact while titles and visibility can be edited independently.
03Building authentication
⌁User prompt
How should email and password sign-in work with Neon Auth in Next.js?
Assistant response
Use Managed Better Auth through @neondatabase/auth. Keep sign-in in server actions, derive the current user from the server session, and never accept an owner ID from the browser.
04Creating the import flow
⌁User prompt
Turn a pasted transcript into steps without calling another AI API.
Assistant response
Treat every user prompt as a new step, attach following assistant messages until the next prompt, and generate a short title deterministically from the first meaningful line.
05Deploying to Vercel
⌁User prompt
What should I verify before deploying?
Assistant response
Run lint, type checking, unit tests, the production build, and inspect the extension manifest. Then deploy a preview and test the full import-to-publish journey.