Open-source SaaS starter for generating professional AI headshots using Astria, Next.js, and Supabase.
https://github.com/davidbmar/headshots-starter-clone · private · shipped
A full-stack application template that allows users to upload sample photos, train a custom AI model via Astria, and generate professional headshots. It includes authentication, database management, webhook handling for async AI tasks, and optional email notifications and billing integration.
git clone https://github.com/davidbmar/headshots-starter-clone.git cd headshots-starter-clone npm install npm run dev
flowchart TD
User[User Browser] -->|Upload Images| NextJS[Next.js App]
NextJS -->|Auth Check| SupabaseAuth[Supabase Auth]
NextJS -->|Store Images| VercelBlob[Vercel Blob Storage]
NextJS -->|Trigger Training| Astria[Astria AI API]
Astria -->|Webhook: Train Complete| WebhookTrain[Train Webhook Route]
WebhookTrain -->|Update Status| SupabaseDB[Supabase Database]
WebhookTrain -->|Send Email| Resend[Resend Email Service]
User -->|View Results| NextJS
NextJS -->|Fetch Data| SupabaseDB
Built with Next.js (App Router) for the frontend and API routes, Supabase for PostgreSQL database and Authentication, Astria for AI model training/inference, Vercel Blob for image storage, and Tailwind/Shadcn for UI. It uses webhooks to handle long-running AI training jobs asynchronously.
sequenceDiagram
participant U as User
participant N as Next.js API
participant S as Supabase
participant V as Vercel Blob
participant A as Astria AI
U->>N: POST /train-model (images)
N->>S: Verify User Session
S-->>N: User Valid
N->>V: Upload Images
V-->>N: Image URLs
N->>A: POST /tunes (Train Model)
A-->>N: Tune ID & Status
N->>S: Save Model Record (pending)
N-->>U: Training Started
Note over A, N: Async Processing...
A->>N: POST /astria/train-webhook
N->>S: Update Model Status (completed)
N->>S: Generate Prompts/Images
N-->>A: 200 OK
Fork the repository, deploy to Vercel using the provided button to set up Supabase integrations automatically, configure environment variables (Astria API Key, Webhook Secret), and customize the UI/branding for your specific SaaS offering.