PromptStack

SaaS dashboard

A multi-tenant subscription product: organizations with members and invitations, role-based access inside each organization, usage metering, and plan limits. Tenancy must be designed in from day one.

You can change every choice once the builder opens.
Core features for the MVP
  • Organizations, each with members and roles
  • Invitation flow for adding members by email
  • Every query scoped to the current organization, enforced on the server
  • Plans with limits, and enforcement when a limit is reached
  • Usage metering recorded per organization
  • Dashboard with the metrics the product is about
  • Organization switcher for users belonging to more than one
  • Audit log of administrative actions within an organization
Left for later
  • Self-service subscription upgrade and downgrade
  • Single sign-on for enterprise customers
  • Custom roles defined per organization
  • Public API with per-organization keys

Recommended stack

SectionRecommended
LanguageTypeScript
Frontend frameworkNext.js
UI and stylingTailwind CSSshadcn/ui
BackendNext.js server
API styletRPC
Database enginePostgreSQL
Database providerNeon
ORM and data accessDrizzle
CachingUpstash Redis
AuthenticationClerk
Authorization and rolesOrganization and team rolesRole-based access control
SecurityInput validationRate limitingCORS and CSRF protectionSecurity headers and CSPSecrets managementAudit logs
File storageAWS S3
Background jobs and cronInngest
Email and notificationsResend
PaymentsStripe
Hosting and deploymentVercel
CI/CDGitHub Actions
Monitoring and analyticsSentryPostHog
TestingVitestPlaywright
ExtrasAccessibility (WCAG)BackupsDocumentationCSV and Excel import/export

Data model draft

Organization

A customer account. The tenancy boundary for every other record.

  • id
  • name
  • slug
  • plan
  • createdAt
  • suspendedAt
  • Has many Memberships
  • Has many Invitations
  • Has many UsageRecords
User

A person, who may belong to several organizations.

  • id
  • authProviderId
  • email
  • fullName
  • createdAt
  • Has many Memberships
Membership

Links a user to an organization with a role.

  • id
  • organizationId
  • userId
  • role
  • joinedAt
  • Belongs to one Organization
  • Belongs to one User
Invitation

A pending invite to join an organization.

  • id
  • organizationId
  • email
  • role
  • tokenHash
  • expiresAt
  • acceptedAt
  • invitedById
  • Belongs to one Organization
  • Invited by one User
UsageRecord

A metered event counted against a plan limit.

  • id
  • organizationId
  • metric
  • quantity
  • recordedAt
  • Belongs to one Organization