Loading...
Loading...
Bootstrap a new SaaS from the SaaS Seeder Template: setup database, configure environment, create super admin user, and verify three-tier panel structure. Use when initializing a new multi-tenant SaaS project from this template.
npx skill4agent add peterbamuhigire/skills-web-dev saas-seeder| Environment | OS | Database | Web Root |
|---|---|---|---|
| Development | Windows 11 (WAMP) | MySQL 8.x | |
| Staging | Ubuntu VPS | MySQL 8.x | |
| Production | Debian VPS | MySQL 8.x | |
utf8mb4_unicode_cidatabase/migrations-production/docs/project-requirements/docs/project-requirements/
├── requirements.md # Detailed feature requirements
├── business-rules.md # Business logic and validation rules
├── user-types.md # User types and their permissions
├── workflows.md # Key user workflows and processes
└── ui-mockups/ # UI mockups or wireframes (optional)project-requirements/manuals//public/user-manuals.phpdatabase/schema/database/schema/
├── core-schema.sql # Main database schema
├── seed-data.sql # Sample/seed data (optional)
└── schema-diagram.png # Database diagram (optional)franchise_idutf8mb4_unicode_cidocs/project-requirements/database/schema/docs/plans/INDEX.mdreferences/architecture.md/public/ownerstaffdashboard.phpskeleton.php/public/adminpanel/super_admin/public/memberpanel/memberstudentcustomerpatient/public/define('SESSION_PREFIX', 'saas_app_'); // Change per SaaS
// ALWAYS use helpers
setSession('user_id', 123); // Sets $_SESSION['saas_app_user_id']
$userId = getSession('user_id'); // Gets $_SESSION['saas_app_user_id']
hasSession('user_id'); // Checks if existsschool_restaurant_clinic_Algorithm: Argon2ID + salt(32 chars) + pepper(64+ chars)
Hash: salt + Argon2ID(HMAC-SHA256(password, pepper) + salt)super-user-dev.phpdocs/seeder-template/migration.sqldocs/seeder-template/fix-collation-and-create-franchises.sqldocs/project-requirements/database/schema/public/super-user-dev.phppublic/dashboard.phppublic/skeleton.php.envreferences/workflow.md.envcomposer installreferences/php-tooling.md# Check existing tools
composer show | grep -E "(phpstan|phpunit|pest|php-cs-fixer)"
# Install essential tools
composer require --dev phpstan/phpstan
composer require --dev friendsofphp/php-cs-fixer
composer require --dev pestphp/pest --with-all-dependencies.\setup-database.ps1 # Windows PowerShell.\fix-database.ps1 # Creates franchises tablehttp://localhost:8000/super-user-dev.phphttp://localhost:8000/sign-in.phpsrc/config/session.phpsuper_adminownerstaff// CORRECT
$stmt = $db->prepare("SELECT * FROM students WHERE franchise_id = ?");
$stmt->execute([getSession('franchise_id')]);
// WRONG - data leakage!
$stmt = $db->prepare("SELECT * FROM students");RESOURCE_ACTIONINVOICE_CREATESTUDENT_DELETEREPORT_VIEWreferences/troubleshooting.mdsuper-user-dev.php.\fix-database.ps1.\fix-database.ps1✅ [Project Name] Initialized!
Requirements Loaded:
- ✅ Read from docs/project-requirements/
- ✅ Database schema reviewed from database/schema/
- ✅ User types customized: [list custom types]
- ✅ Session prefix set to: [prefix]_
Database Setup:
- ✅ Core schema applied
- ✅ Seed data loaded (if provided)
- ✅ Multi-tenant validation passed
PHP Development Tools Installed:
- ✅ PHPStan (level 8) - Static analysis
- ✅ PHP CS Fixer - PSR-12 formatting
- ✅ PHPUnit/Pest - Testing framework
- ✅ Configuration files created
- ✅ Composer scripts configured
Project Documentation:
- ✅ README.md updated for [Project Name]
- ✅ CLAUDE.md created with project-specific guidance
- ✅ Template docs archived/removed
Branding:
- ✅ Updated throughout application
- ✅ Landing page customized
- ✅ Login page branded
Next Steps:
1. Review updated CLAUDE.md for project-specific guidance
2. Create super admin at http://localhost:8000/super-user-dev.php
3. Login and verify three-tier panel structure
4. Run quality checks: composer quality
5. Begin implementing features from docs/project-requirements/
Development Commands:
- composer test # Run tests
- composer stan # Static analysis
- composer cs-fix # Format code (PSR-12)
- composer quality # Run all checks
References:
- Requirements: docs/project-requirements/
- Schema: database/schema/
- Development Guide: CLAUDE.mdsaas-seeder/
├── public/ # Web root
│ ├── index.php # Landing page with nav buttons
│ ├── sign-in.php # Login
│ ├── super-user-dev.php # Super admin creator
│ ├── dashboard.php # Franchise admin dashboard
│ ├── skeleton.php # Page template
│ ├── adminpanel/ # Super admin panel
│ ├── memberpanel/ # End user portal
│ └── assets/ # Shared CSS/JS
├── src/
│ ├── config/
│ │ ├── auth.php # Auth functions + access control
│ │ ├── session.php # Session prefix helpers
│ │ └── database.php # Database connection
│ └── Auth/ # Auth services, helpers, DTOs
├── docs/
│ ├── seeder-template/ # Template schemas
│ ├── PANEL-STRUCTURE.md # Architecture guide
│ └── project-requirements/ # ⭐ PUT PROJECT REQUIREMENTS HERE
│ ├── requirements.md
│ ├── business-rules.md
│ ├── user-types.md
│ └── workflows.md
├── database/
│ └── schema/ # ⭐ PUT DATABASE SCHEMAS HERE
│ ├── core-schema.sql
│ └── seed-data.sql
├── .env # Environment config
├── composer.json # Dependencies
├── setup-database.ps1 # Setup script
├── fix-database.ps1 # Fix script
└── CLAUDE.md # Development guidereferences/architecture.mdreferences/workflow.mdreferences/troubleshooting.mdreferences/php-tooling.md../../docs/PANEL-STRUCTURE.md../../CLAUDE.md../project-requirements/references/php-tooling.mdcomposer cs-fix # Format code (PSR-12)
composer stan # Static analysis
composer test # Run tests
composer quality # All checkscomposer quality && git commit -m "feat: description"references/php-tooling.mdsuper-user-dev.phpSESSION_PREFIXsaas_app_PASSWORD_PEPPERCOOKIE_ENCRYPTION_KEYAPP_ENV=production.env