Skip to main content

Prompt Marketplace with Gamification

PromptStar

Community-driven marketplace for AI prompts with live theming, gamification system, and financial integrity. Built a full-stack creator economy with immutable audit logs, SERIALIZABLE transactions for financial operations, and real-time accent color adaptation.

TanStack StartReact 19PostgreSQLZodTailwind CSS v4bcryptjs
PromptStar preview

targetProblem Statement

Existing prompt sharing platforms have no real creator payout mechanism and weak moderation. A credit-based marketplace needs atomic transactions and a tamper-proof audit trail, or double-spends and disputed payouts are a matter of when, not if.

boltReal-world Impact

Engineered a production-grade marketplace with complete financial auditability. SERIALIZABLE transactions with row-level locking ensure zero double-spends. Append-only audit log tracks every admin action. Gamification drives creator engagement with XP-based levels and achievement badges.

account_treeSystem Architecture

Full-stack TanStack router with server functions for auth, purchases, and financial operations. PostgreSQL backend with hand-rolled migrations and SERIALIZABLE isolation for all monetary transactions. Real-time theme system persists accent color via React context and CSS custom properties.

┌──────────────────────────────────────────────────┐
│            PROMPTSTAR MARKETPLACE              │
└──────────────────────────────────────────────────┘
[User Marketplace] ──► [Browse / Search / Filter]
       │                        │
   [Buy Prompt]           [Creator Tools]
       │                        │
       └────────┬───────────────┘
                │
        [Financial Transaction]
                │
   [SERIALIZABLE + Row Locking]
                │
    ┌───────────┴──────────────┐
    │                          │
[Credit Debit]        [Author Payout]
  (Buyer)              (70% credit)
    │                        │
    └────────────┬───────────┘
                 │
        [Immutable Audit Log]
                 │
        [Admin Dashboard]
Auth EngineMarketplace CoreFinancial LedgerGamificationAdmin Dashboard

memoryAI / System Intelligence

An LLM recommends prompts based on user preferences, purchase history, and trending collections. Flagged content goes to a human moderator through the admin dashboard rather than being auto-removed.

psychologyKey Architectural Decisions

SERIALIZABLE Transactions for Financial Operations

All purchases, credit adjustments, and payouts run inside SERIALIZABLE transactions with explicit row-level locking (SELECT ... FOR UPDATE). This eliminates race conditions and double-spend vulnerabilities inherent in lower isolation levels.

Append-Only Audit Log

Every admin action writes to an immutable audit_logs table with database-enforced constraints (no UPDATE, no DELETE). Enables complete historical traceability for compliance audits and dispute resolution.

Real-Time Live Theming via CSS Custom Properties

Accent color is stored in a single --magenta custom property. Changing theme in Studio immediately repaints all text-magenta / bg-magenta / ring-magenta without full page reload or context flashing.

XP-Based Gamification with Badges

Earns XP passively: publish (+100), make sale (+500), receive save (+50), write review (+75). Levels unlock at 1k XP intervals. Badges reward milestones (First Star, Creator, Hot Streak, Top Seller). Displayed on profile card to drive engagement.