thelastapi
Get started free

Build a SaaS in a weekend: database, sign-in, payments, email, deploy

Build and deploy a full-stack SaaS in a single weekend using one API key for Postgres, sign-in, recurring payments, email, and hosting.

On this page 9 sections

You can build and launch a full-stack SaaS in a weekend by provisioning your database, sign-in, payments, email, and hosting under a single API key instead of stitching multiple service providers together. With the vibiz CLI, a single initialization command configures your serverless Postgres database, authentication, transactional mailbox, and deployment pipeline. You bypass days of dashboard configuration and secret management, giving you forty-eight hours to build your product logic and take your first customer payment.

Here is how to set up the foundation, connect your backend code, and deploy to production before Sunday night.

Why weekend SaaS projects stall before launch

Most weekend software projects do not fail on product design. They stall during plumbing.

To launch a typical subscription application, you normally have to open half a dozen accounts: one for your database, another for user authentication, a third for card processing, a fourth for transactional emails, and a fifth for web hosting. Each vendor demands identity verification, DNS configuration, separate API keys, custom client libraries, and individual credit card entries. By the time you coordinate production environment variables, local testing mocks, and webhook signing secrets across five browser tabs, the weekend is gone.

A unified backend platform changes this dynamic. As explained in one key for your whole app: the one-API stack for indie builders, you can configure your entire infrastructure through a single CLI and control it with a single environment secret: VIBIZ_APP_KEY.

Step 1: Provision your stack and local environment

Start by installing the CLI and logging in. When you log in, your browser prompts you to authorize your machine with a full-access key:

Terminal
vibiz login

Once authenticated, initialize your project in an empty folder. By default, initialization provisions hosting at <slug>.vibiz.app, a dedicated Postgres database, authentication, and privacy-friendly web analytics:

Terminal
vibiz init "Acme Form"

Next, generate your local development environment:

Terminal
vibiz dev

The vibiz dev command sets up an isolated development sandbox. It creates a development Postgres branch matching your production schema with zero customer rows, sets up local authentication that automatically trusts http://localhost:3000, provisions a development AI key, and writes these variables to .env.development.local. Your local tests never contaminate production tables or charge live cards.

Install the application package in your project:

Terminal
npm install --save-exact @vibiz/app@0.3.15

At server boot, initialize your environment using @vibiz/app:

TypeScript
import { vibiz } from '@vibiz/app';

// Loads DATABASE_URL, VIBIZ_AUTH_*, and webhook secrets into process.env
await vibiz.loadEnv();

Step 2: Configure sign-in and database access

The default project setup creates a Postgres database and auth routes. For social sign-in, you can enable Google or GitHub with a single terminal command:

Terminal
# Enable GitHub authentication
vibiz auth providers add github

# Enable Google authentication
vibiz auth providers add google

When running locally under vibiz dev, authentication handlers automatically permit local redirects.

Because await vibiz.loadEnv() pulls in DATABASE_URL, your application connects directly to Postgres using standard tools like Drizzle, Prisma, or plain SQL clients. When your app runs locally, DATABASE_URL routes to your development database branch. When running on production hosting, it connects to your live Postgres instance.

If you decide to deploy your front end elsewhere later, you can still keep these exact services by following use just one service from an app hosted anywhere.

Step 3: Add recurring payments and email

A weekend SaaS needs to charge customers. With thelastapi, you do not need to wait for external merchant onboarding; the platform acts as the merchant of record for card payments immediately.

Define your product tier

Add a monthly subscription to your billing catalog via the CLI:

Terminal
vibiz payments products add "Pro Plan" \
  --amount 1900 \
  --interval month \
  --lookup-key pro-monthly

Amounts are configured in cents, so --amount 1900 sets a $19.00 monthly subscription.

Create a checkout session

When a user clicks "Upgrade" inside your app, generate a hosted checkout URL and redirect them:

TypeScript
import { vibiz } from '@vibiz/app';

export async function handleUpgrade(userId: string) {
  const { url } = await vibiz.payments.checkout({
    lookup_key: 'pro-monthly',
    user: userId,
    success_url: 'https://acme-form.vibiz.app/dashboard?paid=true',
    cancel_url: 'https://acme-form.vibiz.app/pricing',
  });

  return url;
}

Verify subscriptions and listen for webhooks

You can check whether an active customer has a subscription at any time:

TypeScript
const isPro = await vibiz.payments.hasActive(session.userId, 'pro-monthly');

For server-side state synchronization, payment events are dispatched automatically to your webhook endpoint. On thelastapi hosting, webhooks default to /api/vibiz/webhook. Inside your route handler, verify signatures using the runtime client:

TypeScript
import { vibiz } from '@vibiz/app';

export async function POST(req: Request) {
  try {
    const event = await vibiz.webhooks.receive(req);

    if (event.type === 'payment.succeeded') {
      // Provision access in your database
    }

    return new Response('ok', { status: 200 });
  } catch (err) {
    return new Response('Invalid signature', { status: 400 });
  }
}

Send transactional emails

Every project includes transactional email out of the box, sending from <mailbox>@<slug>.vibiz.app:

TypeScript
await vibiz.email.send({
  to: 'ana@example.com',
  subject: 'Your Acme Form account is ready',
  text: 'Welcome to Acme Form. Click here to get started.',
});

Step 4: Test in development and deploy live

Before publishing your SaaS to the web, verify your checkout flow inside the local sandbox. The development environment uses test mode:

Terminal
# Simulate a completed test checkout
vibiz payments simulate payment --amount 1900

When you are ready to publish your site, run:

Terminal
vibiz deploy -m "Launch v1.0"

The CLI uploads your files and serves them live at https://acme-form.vibiz.app. SSL certificates configure automatically.

If you make a mistake, you can inspect deployment history and instantly roll back:

Terminal
vibiz versions
vibiz rollback

To attach a custom domain you already own:

Terminal
vibiz domains add app.example.com

Once your DNS records match, HTTPS provisions automatically.

Default safety caps and operational limits

Launching a side project should never leave you vulnerable to unexpected runaway costs. As detailed in the cheapest stack for a side project in 2026, every account operates under strict prepaid billing controls:

Protection / ResourceDefault limitConfigured via
Account trial credit$2 free creditsProvided on signup
Daily account spend cap$5 / dayvibiz billing limit <dollars>
Project daily AI budget$1 / dayvibiz ai budget <dollars>
Outbound app emails50 / day per projectProject defaults
File storage limit50 MB per fileFree during beta

You can top up your balance, view burn rate, and enable auto-recharge directly in the terminal:

Terminal
vibiz billing
vibiz billing top-up 25
vibiz billing auto-recharge on --threshold 5 --amount 25

If your project ever hits 80% or 100% of any daily ceiling, you receive an automatic notification email containing a direct link to raise the limit. You never wake up to an surprise bill.

You keep full data portability

Building quickly on an integrated stack should not lock you in. You can inspect your permissions in Keys and environments, and you can pull your full data footprint at any time.

The CLI includes an export command that packages your application into standard files:

Terminal
vibiz export --code --db

This downloads your live deployment code, an environment guide, and a complete PostgreSQL snapshot (.sql.gz). You can restore that snapshot into any external Postgres database using standard tools (gunzip -c ... | psql "$DATABASE_URL"). Read the complete details on the Export docs page.

Start building this weekend

Building a SaaS over two days does not require shortcuts that compromise your security or force you to rewrite your app later. Run vibiz init, build your product logic with standard Postgres and @vibiz/app, and take live card payments on your first day.

Create your account at thelastapi.dev/start for your next weekend project.

Frequently asked questions

Do I need separate accounts for Postgres, payments, and transactional email?

No. thelastapi provisions your database, sign-in, card payments, email, and hosting under a single account and environment key.

How does local development work without touching live data?

Running `vibiz dev` generates an isolated development sandbox with an empty Postgres branch matching your schema, test sign-in origins, and test-mode payments.

Can I take live card payments right after creating a project?

Yes. Because thelastapi acts as the merchant, your checkout sessions work immediately without waiting for third-party payment account approvals.

What happens if my app receives unexpected traffic or loops API calls?

Your account is protected by an automated daily safety cap of $5 by default, which blocks unexpected overages until you choose to raise it.