All Articles
March 15, 20262 min readbuild workflow marketplace

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

  1. Database schema + RLS policies
  2. Auth flow (signup, login, profile)
  3. Seller dashboard (upload, manage, analytics)
  4. Buyer flow (browse, purchase, download)
  5. Webhook handlers for payments
  6. 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.

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 Products

Get weekly automation tips

Join 1,000+ developers and solopreneurs. No spam.

Related Articles