MarketplaceBuddy | Launch Your Own Digital Products Marketplace
MarketplaceBuddy Overview & Self-Hosted Marketplace Architecture
MarketplaceBuddy is a TypeScript and Next.js App Router application, engineered for operators and development agencies to launch a multi-vendor marketplace for templates, UI kits, plugins, and scripts under their own domain and commission rules. The package collapses an entire commerce platform — catalogue, moderation queue, ledger accounting, payouts, and delivery of licensed files — into one deployable unit backed by a single PostgreSQL database, eliminating the second service tier that typical marketplace stacks demand. In production workflows it functions as the full storefront, vendor onboarding pipeline, and financial back-office, deployable with a single Docker Compose command on any Linux host.
Technical Specifications & Deployment Matrix
| Engineering Metric | Deployment Specification |
|---|---|
| Base Technology / Framework | Next.js App Router, TypeScript, Tailwind CSS, Drizzle ORM |
| Runtime / Language Requirements | Docker Engine 24+, Compose v2 plugin; 2 vCPU / 2 GB RAM minimum, 20 GB disk; amd64 and arm64 images |
| Data Exchange / Communication Protocols | Stripe, PayPal, Razorpay APIs; built-in bank transfer; SMTP (Postmark, Resend, Mailgun, Amazon SES); signed webhook verification |
| Front-End / Engine Dependencies | ReactJS, JavaScript, HTML, CSS; optional Redis and Meilisearch accelerators |
| Database / Persistence Footprint | Single PostgreSQL instance; optional S3-compatible object storage (AWS S3, Cloudflare R2, Backblaze B2, MinIO) with server-disk default |
Immutable Financial Ledger & Marketplace Execution Pipeline
The engine treats money as an append-only ledger rather than a mutable balance column. Every sale, refund, adjustment, and payout is recorded as an immutable row, with balances derived by summation, and the database schema itself rejects update and delete operations on those tables so no bug or privileged account can rewrite the books.
Inbound orders follow one completion path regardless of gateway: card, wallet, or bank transfer all funnel through the same code under the same row lock, producing identical licence issuance, ledger entries, sequential invoices, and replay protection. Checkout supports members and guests, preserves a guest cart through sign-up, applies coupons and country tax rates, and optionally preselects a gateway by buyer country. Post-payment, delivery is instant: licence codes are generated, invoices are sequenced, and downloads are served through signed, expiring, revocable tokens rather than public URLs.
On the vendor side, authors apply through a public pitch page and review queue, submit products via a guided wizard covering details, pricing tiers, versions, and cover art, and publish versioned releases with changelogs where a pending update never replaces the live file until approved. A single setting toggles the entire platform between multi-vendor and single-vendor mode, short-circuiting author-facing code paths without any data migration when switching later.
Core Technical Capabilities of MarketplaceBuddy
- Compensating-entry refunds: Refunds post as new ledger rows rather than edits, with automatic commission clawback computed by the same accounting path, keeping derived author balances consistent without manual reconciliation.
- Archive-safe upload validation: Files pass extension and MIME allowlists, magic-number checks, and size limits; images are decoded and re-encoded to strip hidden payloads, and product archives are inspected via index without extraction, refusing entries that would escape their folder.
- Moderation with version diffs: The admin queue renders differences between submitted product versions and supports soft rejection with written feedback, so rejected authors retain their live listing while correcting the next submission.
- Verified commerce surface: Reviews require a verified purchase and support author replies; each product carries a public question-and-answer thread, support windows, framework tags, and technology-stack filtering reflected in shareable URLs.
- Hardened authentication: Email and password flows include verification, password reset, two-factor authentication, social sign-in, rate limiting, and account lockout, with stored HTML sanitised through an allowlist wherever it renders.
Production Implementation & Operational Resilience
Deployment targets a persistent Linux host rather than a serverless platform, because outbound email and scheduled cleanup jobs run inside the application process — a serverless runtime would serve pages but never dispatch mail. A first-boot wizard verifies database connectivity, schema state, storage, and the authentication origin that causes the most common misconfiguration, then the first administrator is created only after the environment passes. Outbound mail is validated by sending a real message, not by confirming a saved form. Migrations are transactional, lock-guarded against colliding instances, and safe to re-run, while an in-app updater surfaces new releases with changelogs.
Error handling and validation operate at every boundary: webhook payloads are signature-verified, uploads flow through the single validation path described above, and administrative plus financial actions are recorded in an immutable audit log. Configuration for mail, storage, payments, tax, uploads, and branding lives in admin settings rather than environment files, which reduces deployment drift between staging and production. A test suite of 534 unit tests and 88 browser tests covers checkout, refund, payout, and download paths end to end in a real browser against a real database.
Customisation boundaries are explicit. The entire visual identity derives from one design-token file — colours, typography, and spacing change in a single place and propagate across the light theme — while visitor-facing strings live in the interface or settings rather than scattered through the codebase. The full commented TypeScript source ships with the package, so secondary development follows the same patterns the test suite already exercises. For decoupled implementations outside this marketplace runtime, Edmy demonstrates a comparable Next.js 15 application architecture for learning platforms, and Agon offers an independent Next.js template path for agency storefronts; for administrative interfaces built separately from this codebase, Yoda provides a Bootstrap 5 dashboard template as a parallel solution.
Frequently Asked Questions
Does the host need Node.js or PostgreSQL pre-installed before deployment?
No. Node.js, PostgreSQL, and every dependency ship inside the production Docker image. The host requires only Docker Engine 24 or newer with the Compose v2 plugin, plus the specified CPU, RAM, and disk headroom for uploaded product files.
Can the application run on a serverless platform?
No. Background work such as outbound email and scheduled cleanups executes inside the application process. Serverless platforms would render pages but never dispatch mail, so a persistently running VPS or dedicated Linux host is required.
Is an approved payment gateway account required to launch the marketplace?
No. A manual bank-transfer gateway is built in and accepts orders with no third-party account at all. Stripe, PayPal, or Razorpay can be enabled later without reinstalling, each under its own per-transaction fees.
Does this version include automatic payouts and EU VAT reverse charge handling?
No. Withdrawals are request-based with a configurable minimum and clearing period, and tax support covers country rates with inclusive or exclusive pricing only; automatic payouts and EU VAT number validation are not included.
-
v1.0 Latest