Comprehensive guide to developing with the SaaS boilerplate. This section covers all available commands, development tools, and workflow best practices.
Master all the development commands organized by category for efficient development workflow.
# Development server
pnpm dev # Start development server with Turbopack
pnpm build # Build for production with Turbopack
pnpm start # Start production server
# Code quality
pnpm lint # Run ESLint for code linting
pnpm lint:fix # Fix ESLint errors automatically
pnpm format # Check code formatting with Prettier
pnpm format:fix # Fix code formatting with Prettier
# Environment setup
pnpm init:env # Interactive environment configurationEssential tools and interfaces for efficient development workflow.
Drizzle Studio - Visual database interface
pnpm db:studio
# Opens at: http://localhost:4983Features:
Email Preview System
Testing emails:
# Trigger test emails in development
# Check terminal output for email content
# All emails are intercepted and loggedStripe Integration Tools
# Webhook testing (in separate terminal)
pnpm stripe:listen # Listen for local webhooks
pnpm stripe:forward # Forward webhooks to local serverStripe CLI Features:
TypeScript Strict Mode
ESLint Configuration
Prettier Integration
# Start the development server
pnpm dev
# Open database GUI (optional)
pnpm db:studio# Run relevant tests
pnpm test [pattern]
# Run E2E tests for user flows
pnpm test:e2e# Check code quality before commit
pnpm lint
pnpm type-check
pnpm format# 1. Update schema in src/db/models/
# 2. Generate migration
pnpm db:generate
# 3. Apply to development database
pnpm db:migrate# 1. Add service functions in packages/services/
# 2. Write unit tests
pnpm test services
# 3. Update facades if needed# 1. Create/update components
# 2. Add to pages with proper data access layer
# 3. Test UI components
pnpm test components# 1. Write E2E tests for complete user flows
# 2. Test with real data and services
pnpm test:e2eDatabase Issues:
# Check database connection
pnpm db:check
# View data visually
pnpm db:studio
# Reset data if corrupted
pnpm db:reset-seedBuild Issues:
# Clean build artifacts
pnpm clean
# Rebuild packages
pnpm build:packages
# Check TypeScript errors
pnpm type-checkTest Failures:
# Run specific test file
pnpm test path/to/file.test.ts
# Run with detailed output
pnpm test --reporter=verbose
# Generate coverage to find untested code
pnpm test:coverageConfiguration:
Files:
.env.development # Development environment variables
.env.local # Local overrides (not committed)Setup:
# Use test environment
NODE_ENV=test pnpm test
# Test database setup
pnpm db:migrate # With test DATABASE_URLFeatures:
Build Testing:
# Test production build locally
pnpm build
pnpm start
# Verify all features work in production modePerformance Checks:
# Analyze bundle size
pnpm build --analyze
# Test with production data structure
# Run full E2E test suite
pnpm test:e2ePackage Structure:
packages/
├── services/ # Business logic and API calls
├── ui/ # Shared UI components
├── shared/ # Common utilities
└── persistence/ # Database models and queries
Development Benefits:
Automatic Features:
Development Metrics:
Tools:
# Bundle analyzer
pnpm build --analyze
# Performance profiling
NODE_ENV=development pnpm dev --profileLayered Architecture: Follow the 5-layer pattern for consistent, maintainable code structure.
Before Each Commit:
# Run the quality trio
pnpm lint # Code quality
pnpm type-check # Type safety
pnpm test # FunctionalityDatabase Best Practices:
Testing Strategy:
Performance Tip: Use pnpm dev with Turbopack for the fastest development experience. Hot reload is optimized for large codebases.
Ready to build? This development guide provides everything you need to work efficiently with the SaaS boilerplate architecture and tools.