Getting Started
This guide will help you set up TinyKit SaaS locally and get it running in development mode.
Quick Start (60 seconds)
git clone <your-repo-url>
cd tinykit-saas-convex
pnpm install
pnpm run setup # Interactive setup + browser login
pnpm dev # You're running!The streamlined setup wizard uses smart defaults so you can start developing immediately. Additional configuration (Stripe, OAuth, Resend) can be done later via the Admin panel or pnpm run setup:credentials.
Prerequisites
Required:
- Node.js 22+ and pnpm (install from pnpm.io)
Created during setup:
- Convex account (free tier) - created via browser login during setup
Optional (configure later via Admin panel):
- Stripe account (for billing features) - stripe.com
- Resend account (for email features) - resend.com
- OAuth provider accounts (GitHub, Google)
Installation
1. Clone and Install
git clone <your-repo-url>
cd tinykit-saas-convex
pnpm install2. Run Setup Wizard (Recommended)
pnpm run setupThe streamlined wizard:
- Asks one question: "Ready to start?"
- Opens browser for Convex login/signup
- Applies smart defaults automatically
- Generates environment files with correct configuration
- Initializes database (you choose: development or production mode)
Smart Defaults Applied:
- Site URL:
http://localhost:3001 - Site Name:
TinyKit - Auth Methods: Email/Password only
- Billing/Analytics: Disabled until credentials added
3. Configure Additional Features
After the initial setup, configure additional features as needed:
Option A: Admin Panel (After signing in as admin)
The admin dashboard shows a setup banner with checklist items:
- Site Settings - Configure domain, name, support email
- Authentication - Add OAuth providers
- Billing - Connect Stripe
- Email - Connect Resend
Option B: Guided CLI Setup
pnpm run setup:credentials # All services
pnpm run setup:credentials --oauth # Just OAuth providers
pnpm run setup:credentials --stripe # Just Stripe
pnpm run setup:credentials --email # Just Resend4. Manual Configuration (Alternative)
If you prefer manual setup:
cp .env.local.example .env.local
# Edit .env.local manually
npx convex dev # Starts Convex backend only
pnpm dev:frontend # In another terminal, starts Next.js frontendNote:
npx convex devonly starts the Convex backend. Usepnpm devto start both frontend and backend together, or run them separately withpnpm dev:backendandpnpm dev:frontend.
See Environment Variables Reference for complete configuration.
Note: All secrets (Stripe keys, RESEND_API_KEY, OAuth secrets) must be set in Convex environment variables, not in
.env.local. The setup wizard handles this automatically.
5. Start Development Server
pnpm devThis will start:
- Next.js frontend on http://localhost:3001
- Convex backend (automatically configured)
- Stripe webhooks via Stripe Dashboard (if configured)
Initial Setup Tasks
1. Set Up Convex Environment Variables
Configure backend-only environment variables in Convex:
# Optional: Email system (password reset, notifications)
# Note: Application works without this - email features gracefully disabled
npx convex env set RESEND_API_KEY re_your_api_key_here
npx convex env set RESEND_TEST_MODE true
# Stripe backend configuration (for billing)
npx convex env set STRIPE_SECRET_KEY sk_test_...
npx convex env set STRIPE_WEBHOOK_SECRET whsec_...Note: Email configuration (support email, domain, site URL) is now managed through the database and configured via the admin panel under "Site Settings → Email Configuration".
2. Configure Email Settings (Database-Driven)
Email configuration is now stored in the database instead of environment variables. After running the setup wizard or seeding the database, you can configure email settings through:
- Admin Panel: Go to "Site Settings → Email Configuration"
- Initial Values: Default values are used from
siteDefaults.tsduring seeding - Runtime Updates: Changes take effect immediately without restarting the application
Required email settings:
- Support Email: Reply-to address for system emails
- Support Email Name: Display name in email headers
- Resend Domain: Your verified domain for sending emails
- Site URL: Base URL for email links
3. Configure Stripe Webhook
Set up a webhook endpoint in the Stripe Dashboard:
- Go to Stripe Dashboard > Developers > Webhooks
- Click "Add endpoint"
- Set the URL to your Convex site URL:
https://your-project.convex.site/stripe/webhook - Select all events and click "Add endpoint"
- Copy the Signing Secret and set it in Convex:
npx convex env set STRIPE_WEBHOOK_SECRET whsec_...
4. Seed Database (Optional)
Add sample data for development:
# Complete seeding with init + assets (includes products, teams, etc.)
pnpm run convex:seed
# Or run individually:
pnpm run convex:seed:init # Initialize basic seed data only
pnpm run convex:seed:assets # Upload seed assets onlyQuick Commands Reference
Setup & Configuration
pnpm run setup # Interactive setup wizard (recommended for first-time setup)
pnpm run convex:reset # Reset Convex deployment (use with caution)Development
pnpm dev # Start both frontend (localhost:3001) and Convex backend
pnpm dev:frontend # Next.js only with Turbopack
pnpm dev:backend # Convex backend onlyCode Quality - MUST pass before completing any task
pnpm lint # ESLint check - MUST pass
pnpm typecheck # TypeScript check - MUST pass
# Note: pnpm build is handled by deployment - not needed during developmentDatabase Operations
pnpm run convex:seed # Complete seeding with init + assets
pnpm run convex:seed:init # Initialize basic seed data only
pnpm run convex:seed:assets # Upload seed assets only
npx convex dashboard # Open Convex admin dashboardExternal Services
pnpm dev:email # Open Resend dashboardVerification Steps
- Frontend Access: Visit http://localhost:3001 - should show landing page
- Authentication: Try creating an account or signing in
- Database Connection: Check Convex dashboard shows tables
- Webhook Testing: Test Stripe webhook forwarding works
- Email System: Try password reset or team invitation flows
Next Steps
Once you have the application running:
- Review Features: Check out features documentation to understand capabilities
- Configure Services: Set up Stripe and Email systems
- Read Architecture: Understanding the technical architecture
- Development Workflow: Learn the development process
Need Help?
- Troubleshooting: Check troubleshooting.md for common issues
- API Reference: Review api-reference.md for development patterns
- Community Support: Join the Convex Discord