Lovable

Build full-stack applications with Lovable AI, powered by Stack0 for email and file storage.

💕 Perfect Pairing

Lovable creates full-stack apps with Supabase. Add Stack0 for transactional emails and file uploads that Supabase doesn't handle as well.

Getting Started with Lovable + Stack0

1

Start Your Lovable Project

Describe your app to Lovable and let it generate the base application.

2

Add Stack0 Package

Tell Lovable to add @stack0/sdk to your project dependencies.

3

Set Environment Variable

Add STACK0_API_KEY to your Lovable project's environment variables.

Prompt Templates for Lovable

🚀 SaaS Starter with Email

Build a SaaS application with:
- User authentication (Supabase Auth)
- Dashboard with usage stats
- Settings page for profile

For email features, use Stack0 SDK (@stack0/sdk):
- Send welcome email on signup
- Send password reset emails
- Send notification emails

Stack0 setup:
```typescript
import { Stack0 } from '@stack0/sdk'
const stack0 = new Stack0({ apiKey: process.env.STACK0_API_KEY! })

// Send email
await stack0.mail.send({
  from: 'noreply@myapp.com',
  to: userEmail,
  subject: 'Welcome!',
  html: emailContent,
})
```

Add STACK0_API_KEY to environment variables.

📝 Blog with Image Uploads

Create a blog platform with:
- Post creation with rich text editor
- Image uploads for posts (use Stack0 CDN)
- Author profiles with avatars
- Comment system

For file uploads, use Stack0 CDN:
```typescript
import { Stack0 } from '@stack0/sdk'
const stack0 = new Stack0({ apiKey: process.env.STACK0_API_KEY! })

// Get upload URL
const { uploadUrl, cdnUrl } = await stack0.cdn.getUploadUrl({
  filename: file.name,
  mimeType: file.type,
})

// Upload file directly
await fetch(uploadUrl, { method: 'PUT', body: file })

// Use cdnUrl for image source
```

Add STACK0_API_KEY to environment variables.

🛒 E-commerce with Order Emails

Build an e-commerce store with:
- Product catalog
- Shopping cart
- Checkout flow
- Order confirmation

For order emails, use Stack0:
```typescript
import { Stack0 } from '@stack0/sdk'
const stack0 = new Stack0({ apiKey: process.env.STACK0_API_KEY! })

// Send order confirmation
await stack0.mail.send({
  from: 'orders@mystore.com',
  to: customerEmail,
  subject: `Order #${orderId} Confirmed`,
  html: orderConfirmationTemplate,
})

// Send shipping notification
await stack0.mail.send({
  from: 'shipping@mystore.com',
  to: customerEmail,
  subject: `Your order has shipped!`,
  html: shippingTemplate,
})
```

Add STACK0_API_KEY to environment variables.

📅 Booking System with Reminders

Create a booking/appointment system with:
- Calendar view for availability
- Booking form
- Confirmation emails
- Reminder emails before appointments

Use Stack0 for all emails:
```typescript
import { Stack0 } from '@stack0/sdk'
const stack0 = new Stack0({ apiKey: process.env.STACK0_API_KEY! })

// Booking confirmation
await stack0.mail.send({
  from: 'bookings@myapp.com',
  to: customerEmail,
  subject: 'Booking Confirmed',
  html: confirmationTemplate,
})

// Reminder (trigger with cron/scheduled function)
await stack0.mail.send({
  from: 'reminders@myapp.com',
  to: customerEmail,
  subject: 'Reminder: Your appointment is tomorrow',
  html: reminderTemplate,
})
```

Add STACK0_API_KEY to environment variables.

Example: Adding Email to Existing Lovable App

If you already have a Lovable app, use this prompt to add Stack0 email:

Lovable Chat Prompt
Add email functionality to my app using Stack0 SDK.
Install @stack0/sdk package.
Create a utility file for Stack0:
// lib/stack0.ts
import { Stack0 } from '@stack0/sdk'
export const stack0 = new Stack0({
apiKey: process.env.STACK0_API_KEY!
})
Create an API endpoint for sending emails:
// app/api/send-email/route.ts
import { stack0 } from '@/lib/stack0'
export async function POST(request: Request) {
const { to, subject, html } = await request.json()
const result = await stack0.mail.send({
from: 'noreply@myapp.com',
to,
subject,
html,
})
return Response.json(result)
}
Then call this endpoint from the frontend when I need to send emails.
Remember to add STACK0_API_KEY to environment variables.

Stack0 vs Supabase: When to Use Each

FeatureUse Stack0Use Supabase
Transactional Email✓ BetterLimited
Marketing Email✓ BetterNot supported
Image Processing✓ BetterBasic
File Storage✓ With CDN✓ Good
DatabaseNot supported✓ Better
AuthenticationNot supported✓ Better