This guide will walk you through the process of setting up your own Agentic SaaS business using our starter template.

Having a properly configured development environment is crucial for building, testing, and deploying your Agentic SaaS efficiently.

The template comes with example agents you can use as a baseline for your own custom AI solution.

What prerequisites do you need?

  • Code Editor (Cursor AI, Windsurf, VSCode, etc)
  • MacOS or Linux Based OS
  • Node.js 20+
  • Package Manager (Bun, Yarn, NPM, PNPM, etc)
  • Dedicated Development AWS Account with AWS SSO
  • Github Account
  • Stripe Account
  • Clerk Account
  • Unkey Account
  • Cloudflare Account

Head over to account setups for help with prerequisites.

Time to Complete: 30 mins - 2 hrs

Building your own Agentic SaaS requires an intermediate level of experience with programming and cloud development. If you need help getting started or have questions, join the Community where you can get more access to more support and resources to get you up to speed.

1. Create a new project directory

mkdir my-ai-saas
cd my-ai-saas

2. Set up your Repository

Create a new repository from the Full-Stack Template: FS Template

# Clone FS Template
cd my-ai-saas
gh repo clone <your-repo-name>

The repository will have a .env.template file that you can use to set your environment variables. Change the .env.template file to .env.local and update the variables:

Also update the sst.config.ts file with your app name.

// sst.config.ts
export default $config({
  app(input) {
    return {
      name: "<YOUR-APP-NAME>",
      removal: input?.stage === "prod" ? "retain" : "remove",
      
      home: "aws",
      providers: { aws: {
        region: "us-east-1",
      }, "aws-native": {
        region: "us-east-1",
      }, 
      cloudflare: {
        version: "5.42.0",
        apiToken: process.env.CLOUDFLARE_API_TOKEN,
      }
    },
    };
  },
  ... rest of the config
});

Environment Variables

SST uses SNAKE_CASE for environment variables. For more information, see the SST Environment Variables documentation.

# AWS/SST Configuration
AwsProfile=<your-aws-profile>

# Authentication
ClerkSecretKey=<your-clerk-secret-key>
ClerkPublishableKey=<your-clerk-publishable-key>
ClerkSignInUrl=/sign-in
ClerkSignUpUrl=/sign-up

# AI Services
OpenaiApiKey=<your-openai-api-key>

# Payments
StripeSecretKey=<your-stripe-secret-key>
StripePublishableKey=<your-stripe-publishable-key>
StripeWebhookSecret=<your-stripe-webhook-secret>
PriceId=<your-stripe-price-id>

# Domain Configuration
BaseDomain=<your-domain.com>
CloudflareApiToken=<your-cloudflare-api-token>

# API Keys
UnkeyRootKey=<your-unkey-root-key>
UnkeyApiId=<your-unkey-api-id>

If you find this template helpful, please consider giving it a star on GitHub!

Install the dependencies:

bun install

3. Start your development environment

1

Set AWS Profile

Export your AWS profile for the account you want to deploy to:

export AwsProfile=<your-aws-profile>
2

Load Environment Secrets

Load your development environment secrets:

bun sst secrets load .env.dev --stage dev
3

Start Development Environment

Start the development environment:

bun run dev

This will start both your API and frontend in development mode. The first deployment may take a few minutes as it creates DNS records.

4

Access Your Application

Your application will be available at:

Sign up through the frontend to start testing your AI agent.

Next Steps