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 - 1 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. Set up your Repository

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

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

The clone it to your local working directory.

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

// sst.config.ts
export default $config({
  app(input) {
    return {
      name: "cfs-template",
      removal: input?.stage === "production" ? "retain" : "remove",
      protect: ["production"].includes(input?.stage),
      home: "aws",
    };
  },
  async run() {
    const infra = await import("./infra");
    return {
      url: infra.frontend.url,
      api: infra.api.url,
    };
  },
});

2. Install the dependencies

Install the dependencies:

bun install

Install sst

bun sst install

3. Environment Variables

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

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:

# 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>

4. Start your development environment

1

Set AWS Profile

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

export AWS_PROFILE=<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