How dhvaniparghi2003/plura-production works
Project type and purpose
• From the README and file‐tree, this is a full-stack, multi-tenant SaaS application (Next.js 14 + Bun) offering an agency→sub-account website/funnel builder, project management, analytics, and Stripe-based billing.
• It supports role-based access (agency vs. sub-account), Stripe Connect for multivendor payments, and uses Prisma + MySQL as its primary datastore.
File structure
• Top level: configuration files (.env.example, tsconfig.json, bun.lockb, prisma/schema.prisma), Next.js config (next.config.js), Tailwind config, package.json.
• prisma/: database schema → Prisma client.
• src/app/: Next.js 14’s App Router with page.tsx, layout.tsx, nested folders for dynamic routing. Contains:
• Authentication routes under (main)/agency/(auth)
• Agency pages, sub-account pages, launchpads, funnels, kanban pipelines, media, settings, billing.
• src/app/api/: Route handlers (Stripe checkout, customer, subscription, webhook; UploadThing).
• src/lib/: Business logic and integrations (db.ts, queries.ts, Stripe client/actions, uploadthing, utils).
• src/providers/: React Context providers (editor, modal, theme).
• Middleware: global request middleware (e.g., for auth, multi-tenant resolution).
README for additional insights
• Tech stack: Next.js 14 / Bun runtime, Prisma + MySQL, Stripe Connect, Clerk (authentication), UploadThing, Tailwind CSS, Radix UI.
• Features: multi-vendor B2B2B, site & funnel builder, subscription billing, role‐based dashboards, real-time analytics, kanban board, notifications, file uploads.
Details to capture
• Multi-tenant routing + middleware enforcement
• Stripe Connect flow (Checkout Session → Webhook → DB)
• File upload flow through UploadThing
• Context providers’ roles (editor state, theme, modal)
• Static asset delivery via public/assets + CDN
• Prisma’s role as the single source of truth for data access