1.5 KiB
1.5 KiB
AI SaaS Template
This is the default template for all new Kleap apps. It includes a complete Next.js 15 starter with everything configured.
⚡ Template Synchronization
After making changes to this template, you MUST sync it to Supabase:
# Sync only modified files
npm run sync-template
# Force update all files (even if unchanged)
npm run sync-template:force
📁 Template Structure
app/- Next.js 15 App Router pagescomponents/- React componentslib/- Utility functionspublic/- Static assetsAI_RULES.md- Instructions for the AI when working with this template
🚀 How It Works
- Template files are stored in Supabase with
app_id = -1 - When a new app is created, files are copied via SQL (DB-to-DB)
- Copy time: <1 second (vs 20-60 seconds with traditional method)
✏️ Making Changes
- Edit files in this directory
- Run
npm run sync-template - New apps will use the updated template
⚠️ Important Notes
- Changes only affect NEW apps, not existing ones
- The
.kleapignorefile controls which files are synced - Binary files (images, fonts) are automatically handled
- The sync script shows which files are added/updated/deleted
🔍 Verifying Sync
After syncing, the script will show:
- ✅ Unchanged files (already in sync)
- ➕ New files added
- 📝 Updated files
- ❌ Deleted files
🛠️ Troubleshooting
If sync fails:
- Check Supabase credentials in
.env.local - Ensure you have the migration applied (see CLAUDE.md)
- Check the console for detailed error messages