Welcome to the PMF App Template
This is a production-ready multi-tenant application template with comprehensive authentication and role-based access control. The system supports multiple organizations, each with their own isolated data and user management, making it ideal for B2B SaaS applications.
The multi-tenancy structure operates on two levels: system-level and organization-level. At the system level, developers and platform maintainers have sysadmin privileges with full access across all organizations. At the organization level, each organization has its own admins who manage their team members and resources. Regular users belong to one or more organizations with either admin or member roles, determining their permissions within that organization's scope.
To access the platform, system administrators should use the Internal Login button, while organization admins and members use the standard Login button. Guest users can also access the platform with limited permissions as granted by organization or system administrators.
Run Local Environment
pnpm devInitialize Codebase
pnpm run initThis sets up SSH, creates Dokku apps, databases, runs migrations, creates admin user, and seeds test data.
Init Options
pnpm run init:ssh- Setup SSH keyspnpm run init:seed- Seed test datapnpm run init:sysadmin- Create sysadmin
Detailed documentation for each layer of the application:
Main Documentation
README.mdProject overview, quick start, and technology stack
Database Layer
src/lib/db/README.mdKysely setup, connection pooling, migrations, and type generation
- scripts/init/README.md (initialization)
- scripts/migrate/README.md (migrations)
- scripts/destroy/README.md (cleanup)