Back to blog
TutorialJun 28, 2026·12 min read

Building a SaaS app with Maya in under 1 hour

Step-by-step guide: from idea to a fully functional, deployed SaaS with auth, payments, and database — all generated by Maya.

Zero to SaaS in 60 Minutes

Building a Software-as-a-Service (SaaS) application traditionally takes weeks or months. You have to set up authentication, configure a database, integrate a payment gateway like Stripe, design the frontend, and deploy the infrastructure.

With Maya, Ajath's AI coding agent, this process is condensed into a single conversation. In this tutorial, we will build a complete "AI Image Upscaler" SaaS from scratch in under an hour.

Step 1: The Initial Prompt

The key to working effectively with Maya is providing a clear, comprehensive initial prompt. We start by describing the entire architecture:

"Build a Next.js SaaS app using the App Router. The app should be an AI Image Upscaler. It needs user authentication via Clerk. For the database, use PostgreSQL (Supabase) to store user profiles and their generation history. Integrate Stripe for a subscription model: users get 5 free upscales, and then need a $10/mo 'Pro' subscription for unlimited usage. Use Tailwind CSS for a modern, dark-mode UI."

Maya receives this and begins scaffolding the project. Within minutes, it has generated the package.json, installed the necessary dependencies (@clerk/nextjs, stripe, @supabase/supabase-js), and created the basic folder structure.

Step 2: Database Schema and Auth

Next, Maya will ask for your Supabase and Clerk API keys. Once provided, it generates the SQL schema for your database:

CREATE TABLE users (
  id UUID PRIMARY KEY,
  clerk_id TEXT UNIQUE NOT NULL,
  email TEXT NOT NULL,
  stripe_customer_id TEXT,
  subscription_status TEXT DEFAULT 'free',
  credits_used INTEGER DEFAULT 0
);

CREATE TABLE generations (
  id UUID PRIMARY KEY,
  user_id UUID REFERENCES users(id),
  original_image_url TEXT,
  upscaled_image_url TEXT,
  created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);

It then automatically creates the Clerk webhook handlers to sync user creation with your Supabase database.

Step 3: Integrating Stripe

Stripe integration is notoriously tricky, but Maya handles it gracefully. It generates the Stripe checkout session API route and the webhook handler to listen for checkout.session.completed and customer.subscription.deleted events, updating the subscription_status in the database accordingly.

Step 4: The Core Logic

For the actual image upscaling, we tell Maya to use a mock API for this tutorial (or you could provide an API key for a real service like Replicate). Maya builds the frontend form for image upload, the backend API route to handle the request, checks the user's credit balance, calls the upscaler API, decrements their credits (if on the free plan), and saves the result to the database.

Step 5: Deployment

Finally, we instruct Maya to deploy the application. It generates a vercel.json file, ensures all environment variables are correctly mapped, and initiates the deployment process.

In less than 60 minutes, we went from a blank canvas to a fully functioning, monetizable SaaS application. This is the power of AI-assisted development.


Build your next idea with Maya

Join 50,000+ developers shipping faster with Ajath.

Get started for free