I Built a Full Digital Marketplace from Scratch with Laravel 12
There's a moment every developer knows well — you're paying 30–50% commission to a marketplace platform, watching your earnings get sliced before they even hit your wallet, and you think:
"I could build this."
So I did.
This is the story of Codorra — a fully functional digital goods marketplace built with Laravel 12, Inertia.js, React, and Stripe. Multi-role, multi-panel, with a review workflow, author payouts, refund management, and even an in-browser HTML documentation viewer.
Let me walk you through what I built, how it works, and how it stacks up against the platforms that inspired it.
What Is Codorra?
Codorra is a marketplace for digital products — think WordPress themes, UI kits, scripts, plugins. Authors upload items, reviewers quality-check them, buyers purchase and download instantly.
It's not a side project prototype. It has:
- Multi-role auth — Buyer, Author, Reviewer, Admin, Super Admin
-
Full review workflow — Items go through
pending → in_review → approved / rejected / changes_requested - Stripe Checkout — real payment processing with webhook handling
- Author wallet system — earnings ledger, 7-day hold period, tiered commission rates (50% → 70%)
- Payout requests — PayPal and bank transfer, processed by admin
- Refund management — buyer requests, author responds, admin decides
- In-browser documentation viewer — zip upload → extracted → served in a sandboxed iframe
- Coupon system — percentage and fixed discounts with expiry and usage limits
- Wishlist, reviews, ratings — the full buyer experience
- SEO — sitemap.xml, robots.txt, JSON-LD structured data on every product page
The Architecture
Laravel 12 (backend)
├── Storefront — Blade + Alpine.js (server-rendered, SEO-friendly)
├── Admin Panel — Inertia.js + React (SPA-like, fast)
├── Author Panel — Blade + Alpine.js
└── Reviewer Panel — Blade + Alpine.js
Database : MySQL
Storage : AWS S3 (production) / local (dev)
Payments : Stripe Checkout + Webhooks
Queue : Laravel Jobs for email notifications
Cache : Redis (sitemap, dashboard stats)
The split is intentional. The storefront is server-rendered Blade for SEO — Google needs to crawl product pages. The admin panel is Inertia + React because speed and interactivity matter more there than crawlability.
The Part That Surprised Me Most: The Review Workflow
Most marketplace clones stop at "upload and sell."
The hard part is quality control.
Every item submitted goes through a structured review pipeline:
draft
└─► pending_review
├─► in_review
│ ├─► approved (live on marketplace)
│ ├─► rejected (author notified with reason)
│ └─► changes_requested
│ └─► (author revises) ─► pending_review
└─► (auto-assigned to reviewer)
Reviewers get their own panel with a claim queue — they pick items to review, work through a scored checklist (code quality, file structure, documentation, licensing), and submit a decision with notes. Authors get email notifications at every stage.
Envato has a team of hundreds doing this manually. I built the tooling for one person to do it systematically.
The Wallet System (This Was Hard)
Author earnings aren't just price × commission_rate. There's real nuance here:
- Sales land in a pending balance — 7-day hold for refund protection
- After the hold period they move to available balance
- Current month earnings are locked — only previous months are withdrawable
- Refunds directly debit the author's wallet
- Commission rate increases with lifetime earnings — the more you sell, the more you keep
Author Levels by Lifetime Earnings
───────────────────────────────────────────────────
Standard │ 50% commission │ $0 lifetime
Silver │ 55% commission │ $500 lifetime
Gold │ 60% commission │ $2,000 lifetime
Platinum │ 65% commission │ $5,000 lifetime
Elite │ 70% commission │ $15,000 lifetime
Every transaction is logged in a wallet_transactions table. Full audit trail. Authors can see exactly where every dollar came from and where it went.
In-Browser Documentation Viewer
This is the feature I'm most proud of — and the one that took the longest.
Authors can upload a .zip of their HTML documentation alongside their item files. When a buyer (or any visitor) clicks "View Docs," they get a full in-browser documentation viewer — the zip is extracted server-side, cached, and displayed in a sandboxed iframe with a Codorra-branded header bar.
// Path traversal protection + PHP execution blocked
$realCache = realpath($cacheDir);
$realFile = realpath($cacheDir . '/' . $path);
abort_unless(str_starts_with($realFile, $realCache . DIRECTORY_SEPARATOR), 403);
abort_if(str_ends_with(strtolower($realFile), '.php'), 403);
No external doc hosting needed. No Notion links. No PDFs. The docs live inside Codorra, discoverable and indexed alongside the product.
How It Compares to the Big Three
Let me be honest about where established platforms win — and where an open, self-hosted approach has real advantages.
1. Envato Market (ThemeForest / CodeCanyon)
The giant. Millions of items, established buyer trust, massive organic traffic.
| Feature | Envato | Codorra |
|---|---|---|
| Commission to author | 12.5% – 37.5% (exclusive) | You define it |
| Review time | Days to weeks | Same day (your team) |
| Payout threshold | $50 | Configurable |
| Author dashboard | Functional but dated | Modern, real-time |
| Documentation viewer | Buyer downloads ZIP | In-browser HTML viewer |
| Self-hosted | No | Yes |
| White-label | No | Yes |
| Author tiers / levels | Basic | 5-tier commission system |
Envato's review queue is notoriously slow. Authors wait weeks for approval. A single bad review cycle can kill momentum for a product launch. With Codorra, reviewers can claim and decide same-day — the pipeline moves at whatever speed your team sets.
Envato wins on: Established traffic, buyer trust, sheer volume of buyers.
Codorra wins on: Speed, control, commission transparency, modern UX, self-ownership.
2. Gumroad
The creator-friendly one. Simple, no review process, anyone can sell anything.
| Feature | Gumroad | Codorra |
|---|---|---|
| Commission | 10% flat | You define it |
| Quality control | None | Structured review workflow |
| Payout | Instant (Stripe) | Scheduled payout requests |
| Multi-seller marketplace | Limited | Full multi-author |
| Reviews & ratings | Basic | Star ratings + comments |
| Coupon system | Yes | Yes |
| Refund workflow | Manual | Structured: buyer → author → admin |
| Author earnings tiers | No | 5-level commission tiers |
| Self-hosted | No | Yes |
Gumroad's strength is zero friction for individual creators. But for a curated marketplace where quality matters, having zero review process means buyers have no trust signal. Anyone can upload anything. That's great for creators, rough for buyers.
Gumroad wins on: Speed to market, creator simplicity, instant payouts.
Codorra wins on: Quality curation, structured refunds, earnings transparency, multi-author control.
3. Lemon Squeezy
The modern Gumroad. Beautiful UI, great developer experience, built-in global tax handling.
| Feature | Lemon Squeezy | Codorra |
|---|---|---|
| Commission | 5% + $0.50/transaction | You define it |
| Tax handling | Automatic (global VAT/GST) | Manual |
| Subscription products | Yes | Not yet |
| Multi-vendor marketplace | Limited | Full multi-author |
| Review workflow | None | Full staged workflow |
| Author levels / tiers | No | 5-tier commission system |
| Refund workflow | Basic | 3-party: buyer, author, admin |
| Self-hosted | No | Yes |
| White-label | No | Yes |
Lemon Squeezy's automatic global tax compliance is genuinely hard to replicate — they handle VAT, GST, and sales tax across 100+ countries automatically. That's the one area I'd call a real gap in a self-built solution. For a marketplace with international buyers, you'd need to layer in a service like TaxJar or Avalara.
But for a niche, curated marketplace? The multi-author workflow, commission tiers, and review pipeline are things LS simply doesn't offer at all.
Lemon Squeezy wins on: Tax compliance automation, subscription billing, polish.
Codorra wins on: Multi-author control, quality curation, self-hosted ownership, commission design.
The Honest Part
Building this took months. Here's what I'd tell anyone thinking about doing the same:
The payment integration is 10% of the work. Stripe is extremely well-documented. The hard parts are: refund workflow edge cases, wallet hold period logic, reviewer queue fairness, getting commission math right across all states (pending, held, refunded, partially refunded), and making sure debit/credit always balance.
Server-rendered vs. SPA is a real decision. I made the storefront Blade specifically because product pages need to rank on Google. An Inertia SPA without SSR would have hurt SEO badly. The admin panel doesn't need to rank — it just needs to be fast, so React made sense there.
The documentation viewer was a rabbit hole. Path traversal attacks, serving binary assets with correct MIME types, zip extraction caching, sandboxed iframes — what looked like a weekend feature took a full week of careful security work.
Multi-role auth is surprisingly complex. Not the auth itself — Laravel Sanctum handles that fine. The complexity is in the middleware layering, role-based redirects, making sure a buyer can't access author routes, a reviewer can't access admin routes, and so on. Every panel has its own middleware group.
Tech Stack
| Layer | Technology |
|---|---|
| Framework | Laravel 12 |
| Admin frontend | Inertia.js + React |
| Storefront / panels | Blade + Alpine.js |
| Styling | Tailwind CSS |
| Payments | Stripe Checkout + Webhooks |
| Storage | AWS S3 |
| Queue | Laravel Queue |
| Cache | Redis |
| Build tool | Vite |
What's Coming Next
- [ ] Subscription / membership products
- [ ] Automatic global tax (VAT/GST) handling
- [ ] Public API for authors
- [ ] Bundle / collection products
- [ ] Affiliate program
- [ ] Multiple storefronts / white-label tenancy
Should You Build Your Own?
If you're a solo creator selling a few products — use Gumroad or Lemon Squeezy. Don't build this yourself. The economics don't justify it at small scale.
The equation flips when you're running a curated, multi-author marketplace where you control quality, branding, commission structure, and the full buyer experience end-to-end. At that point, every percentage point of commission you're not paying to a SaaS platform goes back into the business.
The platform you run is the platform you own.
Built with Laravel 12 · React · Inertia.js · Stripe · Alpine.js · Tailwind CSS
Have questions about specific parts of the architecture? Drop them in the comments — happy to go deep on any of it.
Want to see it live? Check out Codorra — the marketplace built in this article.
Top comments (0)