Tailwind CSS SaaS Starter Kit with AI Integration - AIStarterKit
A full‑stack Next.js and Tailwind CSS template for building AI‑driven SaaS applications. Includes authentication, Stripe, dashboards and AI APIs.
By AIStarterKit aistarterkit/ai-saas-starter-kit-nextjs 46 stars
Introduction
AIStarterKit is an open‑source starter template for building AI‑driven SaaS applications with Next.js 16 and Tailwind CSS v4. It includes ready‑made pages such as authentication, dashboard, pricing and blog, and integrates Stripe, NextAuth, Drizzle ORM and several AI APIs (OpenAI, AI SDK). The project is licensed under the MIT License.
What this project offers
- A full‑stack Next.js application ready for production.
- Tailwind CSS styling with dark‑mode support.
- Integrated AI features (text, image, code, video and email generation).
- Payment handling through Stripe.
- Authentication with NextAuth.
- Database utilities via Drizzle ORM.
- Example SaaS pages (dashboard, pricing, blog, error pages).
Main features
- AI text, image, code, video and email generation.
- Stripe payment integration.
- NextAuth authentication flow.
- Pre‑built dashboard and other SaaS pages.
- Dark‑mode UI built with Tailwind CSS.
Technology stack
- Framework: Next.js 16.4.6 (App Router)
- Styling: Tailwind CSS v4
- Language: TypeScript 5, React 19
- AI SDK:
@ai-sdk/openai,@ai-sdk/react,ai - Authentication: NextAuth 5 (beta)
- Payments: Stripe (CLI helper script included)
- Database: Drizzle ORM with PostgreSQL (
pg)
Requirements
- Node.js 18 or newer
- npm (the project uses npm lockfile)
Installation
- Download the source – obtain the ZIP file from the release page and extract it to a folder, e.g.
ai-saas-starter-kit. - Open a terminal in the extracted folder.
cd path/to/ai-saas-starter-kit
- Install dependencies
npm install
- Create environment file – copy the example file and edit the variables for your environment.
cp .env.example .env
# edit .env with your editor
- Run the development server (optional, to verify the setup)
npm run dev
The app will be available at http://localhost:3000.
- Build the production version
npm run build
This runs next build and creates an optimized output in the .next directory.
- Start the production server
npm start
The server serves the built files from .next on port 3000 by default.
Additional scripts
npm run lint– runs ESLint.npm run db:push– pushes Drizzle ORM schema to the database.npm run db:generate– generates Drizzle client code.npm run db:migrate– runs database migrations.npm run stripe:listen– starts Stripe webhook listener (stripe listen --forward-to localhost:3000/api/webhooks/stripe).
Configuration
- Environment variables are defined in
.env. Typical variables include database connection strings, Stripe secret keys, and OpenAI API keys. - Tailwind configuration is in
tailwind.config.cjs(generated by the Tailwind package). - Next.js settings are in
next.config.ts, where remote image patterns are declared.
Customizing the project
- Styling – edit Tailwind classes in any component under
src/componentsor adjust the Tailwind config. - Pages – add or modify routes in
src/app. The App Router uses file‑system routing. - AI integrations – the AI helper functions live in
src/lib/ai; replace or extend them to call other models. - Database – schema files are under
src/lib/drizzle; run the provided Drizzle scripts after changes.
Project structure
LICENSE
README.md
ai-starter-kit.png
eslint.config.mjs
next.config.ts
package-lock.json
package.json
postcss.config.mjs
public/
images/...
src/
app/
api/
layout.tsx
not-found.tsx
providers/
globals.css
(site)/
(generator)/
assets/
homepage/
pricing/
stars.tsx
components/
copy-to-clipboard.tsx
generator/
gradient-blob.tsx
layout/
sections/
ui/
context/
right-sidebar.ts
hooks/
use-click-outside.ts
icons/
icons.tsx
lib/
ai/
utils.ts
zod/
tsconfig.json
Tips
- Run
npm run lintfrequently to keep code quality high. - Use the
stripe:listenscript while developing payment flows to capture webhook events locally. - When changing the database schema, run
npm run db:pushthennpm run db:migrateto keep the database in sync. - The project supports dark mode out of the box; toggle it via the
next-themesprovider insrc/app/providers.
License and attribution
The project is released under the MIT License. See the LICENSE file for full terms.
Original repository: https://github.com/aistarterkit/ai-saas-starter-kit-nextjs
When redistributing, keep the license file and credit the original author as required by the MIT license.
Use this prompt with an AI coding assistant (Claude Code, Cursor, Copilot, ChatGPT and similar).
- Download the ZIP and extract it where your new project will live.
- Download the ZIP and extract it next to your project, so the assistant can read both.
- Fill in the bracketed parts under “About my project”.
- Paste the prompt into your assistant and review each change it proposes.
# Start a new project with AIStarterKit ## Your task You are a senior frontend engineer. We are building a new project using AIStarterKit, a starter template built with Tailwind CSS 4, as the starting point. Keep its design and turn the demo into a clean, real codebase that I can maintain. ## About my project - What I'm building and for whom: [describe it] - Pages I need: [list them] - Stack: [keep it as it is, with its own build, or name one: Vite / Laravel / Next.js / Astro] - Brand: [name, colours, fonts, logo] # AIStarterKit — project brief ## Source project AIStarterKit is a full‑stack starter template for building AI‑driven SaaS applications with Next.js 16 and Tailwind CSS v4. It provides authentication, Stripe integration, dashboards, and AI API helpers. Repository: https://github.com/aistarterkit/ai-saas-starter-kit-nextjs, license MIT (see LICENSE, author credited in the repository). ## Files that matter - **Pages / entry points** (App Router): - `src/app/layout.tsx` – root layout, wraps all pages, includes providers and global CSS. - `src/app/page.tsx` – home page (landing page) shown at `/`. - `src/app/dashboard/page.tsx` – main dashboard view. - `src/app/auth/login/page.tsx` – login page. - `src/app/pricing/page.tsx` – pricing page. - `src/app/blog/page.tsx` – blog listing page. - `src/app/not-found.tsx` – custom 404 page. - **Stylesheets** - `src/app/globals.css` – imports Tailwind base, components, utilities and any global styles. - **Scripts** - `package.json` scripts: `dev`, `build`, `start`, `lint`, `db:push`, `db:generate`, `db:migrate`, `stripe:listen`. - **Images & fonts** - `public/images/**` – hero images, logos, icons, dashboard assets, etc. - **Partial / source templates** - `src/components/` – UI components (layout, sections, UI primitives, generator widgets). - `src/app/providers/` – context providers for theme, auth, etc. - **Configuration files** - `next.config.ts` – Next.js configuration (remote image patterns). - `postcss.config.mjs` – PostCSS config loading Tailwind. - `tailwind.config.cjs` (implicitly via dev dependencies) – Tailwind v4 configuration. - `tsconfig.json` – TypeScript compiler options. - `eslint.config.mjs` – ESLint configuration. ## Setup and build The project requires a build step. ```bash # Install dependencies npm install # Development server npm run dev # Production build npm run build # creates .next output # Start production server npm run start ``` Only the scripts listed in `package.json` are available. ## How it is put together - **Layout**: `src/app/layout.tsx` defines the HTML skeleton, includes the `<html>` tag with `className` for dark mode (`next-themes`), and wraps children with providers (`SessionProvider`, `ThemeProvider`, etc.). All pages inherit this layout. - **Repeated elements**: Header, footer, and side navigation components live in `src/components/layout/` and are imported by the layout or individual pages. - **Libraries**: - React 19 and Next.js 16 for rendering and routing. - Tailwind CSS v4 for styling; utility classes are used throughout components. - `next-themes` enables dark mode toggling; dark mode classes are applied via `className="dark"` on the root. - `next-auth` handles authentication; session data is accessed via `useSession`. - `@ai-sdk/react` and `ai` provide AI helpers used in generator components. - `stripe` integration is accessed through server‑side API routes under `src/app/api/`. - `drizzle-kit` scripts manage the PostgreSQL schema (`db:push`, `db:generate`, `db:migrate`). - **Theme values**: Colors, fonts, and spacing are defined in Tailwind’s configuration (generated by the dev dependency `tailwindcss`). Dark mode is configured via Tailwind’s `dark:` variant and the `next-themes` provider. - **JavaScript initialisation**: No explicit manual init scripts are required; components that need interactivity (e.g., copy‑to‑clipboard, lightbox, sticky bottom) use React hooks (`use-click-outside`, `use-stick-to-bottom`). The `fslightbox-react` component loads its own lightbox script when rendered. ## Watch out for 1. **Tailwind v4 vs older docs** – class names follow v4 syntax; older Tailwind tutorials may reference v3 utilities that differ. 2. **Global CSS** – `globals.css` imports Tailwind’s base styles; adding custom global selectors may unintentionally override Tailwind utilities. 3. **Dark‑mode class** – the root `<html>` receives the `dark` class from `next-themes`; ensure custom components respect the `dark:` variant or they will appear unchanged. 4. **Server‑only code** – API routes under `src/app/api/` run only on the server; importing them in client components will cause runtime errors. 5. **Duplicate library loading** – `fslightbox-react` includes its own lightbox script; avoid loading a separate lightbox library from a CDN in pages. 6. **Environment variables** – many features (auth, Stripe, OpenAI) require `.env` values; missing variables cause build‑time failures. ## Verify - [ ] Home page (`/`) renders with hero image and dark‑mode toggle. - [ ] Dashboard page loads without console errors and shows AI generator sections. - [ ] Authentication flow works (login page renders, session provider initializes). - [ ] Stripe webhook route is reachable (`npm run stripe:listen` starts the listener). - [ ] AI components import from `@ai-sdk/react` without TypeScript errors. - [ ] Tailwind styling applies correctly (no missing utility classes, dark mode colors switch). - [ ] No duplicate script tags appear in the rendered HTML (e.g., only one lightbox script). - [ ] Production build (`npm run build`) completes and `npm run start` serves the app without runtime errors. # How to work ## Step 1 — Get it running as it is Start from the downloaded ZIP or a clone of the repository. Install the dependencies and start the dev server with the exact commands in "Setup and build" above. Confirm it runs without console errors before changing anything. ## Step 2 — Plan the project with me List the pages and sections of AIStarterKit to keep, rename or remove for my project, the folder structure you propose for my stack, and where the repeated parts will live. Wait for my OK. ## Step 3 — Build it - Keep the pages I need, remove the rest, and replace the sample content with real content. - Extract repeated parts (header, navigation, footer) into shared partials or components. - Put my brand name, colours and fonts where AIStarterKit defines its theme (see "How it is put together" above), not as one-off overrides. - Keep Tailwind CSS's markup patterns and class conventions so the design stays consistent, and don't change its major version unless I ask. - Keep dark mode working on every page you touch. ## Step 4 — Polish and launch - Remove demo content and every CSS/JS file nothing uses any more; optimise images. - Check phone, tablet and desktop widths, labels, alt text, keyboard focus and colour contrast. - Run the production build and tell me which folder to deploy. - Keep the license file and credit the author of AIStarterKit. ## Ground rules Work in small steps and show me each change. Use only the libraries already in the project unless I agree to add one.





