How to Build a Workflow Marketplace with Next.js and Supabase
What We're Building
A marketplace where developers can buy and sell automation workflows. Think "ThemeForest for n8n templates."
Tech stack: Next.js 14 (App Router), Supabase (PostgreSQL + Auth + Storage), Paddle (payments — works in Lebanon), Tailwind CSS + shadcn/ui.
This is exactly the stack behind FlowStore.
Database Schema
CREATE TABLE workflows (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
seller_id UUID REFERENCES profiles(id),
title TEXT NOT NULL,
slug TEXT UNIQUE NOT NULL,
description TEXT,
platform TEXT CHECK (platform IN ('n8n', 'make', 'zapier')),
price_cents INTEGER NOT NULL,
file_url TEXT,
status TEXT DEFAULT 'draft',
downloads INTEGER DEFAULT 0,
created_at TIMESTAMPTZ DEFAULT now()
ALTER TABLE workflows ENABLE ROW LEVEL SECURITY;
CREATE POLICY "Published workflows are public" ON workflows FOR SELECT USING (status = 'published');
CREATE POLICY "Sellers manage own workflows" ON workflows FOR ALL USING (seller_id = auth.uid()); ```
The key insight: Row Level Security (RLS) means your API is secure by default. No middleware auth checks needed for basic CRUD.
Authentication
Supabase Auth handles everything:
// Server component — no useEffect needed
const supabase = await createClient();
const { data: { user } } = await supabase.auth.getUser();
File Storage
Workflow JSON files go in Supabase Storage:
const { error } = await supabase.storage
.from('workflow-files')
.upload(`${userId}/${slug}.json`, fileContent);
Payments with Paddle
We use Paddle because Stripe doesn't support Lebanon. Paddle is a Merchant of Record — they handle taxes globally.
The webhook flow: Paddle payment → webhook to our API → create order → grant file access.
Launch Checklist
- Database schema + RLS policies
- Auth flow (signup, login, profile)
- Seller dashboard (upload, manage, analytics)
- Buyer flow (browse, purchase, download)
- Webhook handlers for payments
- SEO pages (landing, categories, search)
For a complete starting point, check out our SaaS Starter Kit with AI Integration — it includes auth, billing, database, and deployment configs ready to customize.
Related Articles
Walid Abed
Building AI-operated businesses from Beirut. Creator of Opsonaut.
Ready to automate?
Browse our ready-made workflow templates, prompt packs, and developer toolkits.
Browse ProductsGet weekly automation tips
Join 1,000+ developers and solopreneurs. No spam.
Related Articles
50 AI Prompts Every Business Needs in 2026
The 50 most effective AI prompts for marketing, sales, support, and operations — tested across 500+ businesses.
The Developer's Guide to n8n Workflow Templates
Everything developers need to know about building, using, and selling n8n workflow templates.
How to Automate Your Entire Business for Under $120/Month
A realistic cost breakdown for automating sales, marketing, support, and ops using AI and no-code tools.