DEV Community

Deepak Raaj
Deepak Raaj

Posted on

How I built a $0/mo AI SaaS using Next.js 14 and Google Gemini

I wanted to build an AI tool, but I didn't want to pay $20/mo for OpenAI. Here is how I built a "Client Email Generator" using Google's Gemini Flash model (which is free) and Vercel.
The Stack:

Next.js 14 (App Router)

Tailwind CSS (for the Agency UI)

Google Gemini API

Resend (for emailing)
Step 1: The AI Route

**_import { NextResponse } from 'next/server';
import { GoogleGenerativeAI } from '@google/generative-ai';

const genAI = new GoogleGenerativeAI(process.env.GEMINI_API_KEY || "");

export async function POST(request: Request) {
try {
const body = await request.json();
const { ticketText } = body;

const model = genAI.getGenerativeModel({ model: "gemini-2.5-flash" }); 

const prompt = `Rewrite this technical Jira ticket for a non-technical client: ${ticketText}`;

const result = await model.generateContent(prompt);
const response = await result.response;
const rewrittenText = response.text();

return NextResponse.json({ rewrittenText });
Enter fullscreen mode Exit fullscreen mode

} catch (error: any) {
console.error("❌ ERROR:", error);
return NextResponse.json({ error: error.message }, { status: 500 });
}
}
Explanation: This code takes the prompt and sends it to Google...

Step 2: The UI I used a "Navy & Teal" theme to make it look professional.

The Result: It works perfectly. I can paste a Jira ticket and get a client email instantly.

Want the Source Code? I am selling the entire project (Source Code + Repo + Setup Guide) as a "Starter Kit" for anyone who wants to launch their own AI SaaS.
Check it out here: https://indiemaker.com/listings/statussync-production-ready-ai-saas-nextjs-14-gemini-email-crm

Top comments (0)