Prerequisites
Before getting started with AI Studio development, ensure you have the following installed:- Node.js 20+ - Download here
- pnpm 8+ - Install via
npm install -g pnpm - PostgreSQL - Local installation or Supabase account
- Git - Download here
Quick Start
Get AI Studio running locally in under 5 minutes.Set up environment variables
Copy the example environment file:Update
.env.local with your credentials. See the Environment Variables guide for details.Initialize the database
Push the database schema to your PostgreSQL instance:This creates all necessary tables using Drizzle ORM.
Configure Trigger.dev (Background Jobs)
- Create a free account at cloud.trigger.dev
- Get your DEV secret key from the API Keys page
- Add it to
.env.local:
Start development servers
AI Studio requires two servers running simultaneously:Terminal 1 - Next.js development server:Terminal 2 - Trigger.dev background job processor:Your application will be available at http://localhost:3000
Available Commands
AI Studio provides several npm scripts for development and database management:Development
Database Operations
Email Development
emails/ directory.
Background Jobs
Project Structure
Understanding the codebase organization:Development Workflow
File Naming Conventions
- Components & Routes: kebab-case (e.g.,
project-detail-content.tsx) - Hooks:
use-*.tsoruse-*.tsxpattern - API Routes:
route.tsin App Router directories - Server Actions:
actions.tsin feature directories
Coding Standards
- TypeScript: All code should be TypeScript (
.tsor.tsx) - Linting: Run
pnpm lintbefore committing - Styling: Use Tailwind CSS utility classes
- Components: Follow existing shadcn/ui patterns
Commit Guidelines
AI Studio follows Conventional Commits:Troubleshooting
Port Already in Use
If port 3000 is already in use:Database Connection Issues
- Verify your
DATABASE_URLin.env.local - Check PostgreSQL is running:
psql -U postgres -c "SELECT version();" - For Supabase, ensure you’re using the Transaction pooler URL (port 6543)
Trigger.dev Not Starting
- Ensure
TRIGGER_SECRET_KEYis set in.env.local - Verify you’re using the DEV key (starts with
tr_dev_) - Check your account at cloud.trigger.dev
Module Not Found Errors
Next Steps
Environment Variables
Configure all required environment variables for local development
Database Setup
Learn about database schema, migrations, and Drizzle ORM
API Reference
Explore available API endpoints and server actions
Deployment
Deploy AI Studio to production environments