This guide will help you set up the ScriptAI development environment on your local machine.
Before you begin, make sure you have the following installed:
-
Node.js 18.x or higher
- Download from nodejs.org
- Verify installation:
node --version
-
pnpm package manager
- Install:
npm install -g pnpm - Verify installation:
pnpm --version
- Install:
-
Git for version control
- Download from git-scm.com
- Verify installation:
git --version
-
VS Code with extensions:
- TypeScript and JavaScript Language Features
- Tailwind CSS IntelliSense
- Prettier - Code formatter
- ESLint
- GitLens
- Auto Rename Tag
-
Postman or Insomnia for API testing
-
Docker (optional, for local database)
# Fork the repository on GitHub first, then:
git clone https://github.com/YOUR_USERNAME/scriptai.git
cd scriptai
# Add upstream remote
git remote add upstream https://github.com/scriptaiapp/scriptai.git# Install all dependencies
pnpm install# Copy the example environment file
cp apps/web/env.example apps/web/.env.local
# Edit the file with your actual values
nano apps/web/.env.localRequired Variables:
NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key# Copy the example environment file
cp apps/api/env.example apps/api/.env
# Edit the file with your actual values
nano apps/api/.envRequired Variables:
PORT=8000
SUPABASE_URL=your_supabase_project_url
SUPABASE_SERVICE_KEY=your_supabase_service_role_key
GOOGLE_AI_STUDIO_API_KEY=your_google_ai_studio_api_key-
Create a Supabase Project
- Go to supabase.com
- Create a new project
- Note down your project URL and API keys
-
Database Schema
- The database schema will be set up automatically when you first run the application
- Or you can run the migration scripts manually
-
API Keys
- Anon Key: Used by the frontend for public operations
- Service Key: Used by the backend for admin operations
- Go to Google AI Studio
- Create an API key
- Add it to your backend environment variables
- OpenAI: For additional AI features
- ElevenLabs: For voice cloning
- Stripe: For payment processing
# Start all services
pnpm run dev
# Or start individual services
pnpm run dev --filter=web
pnpm run dev --filter=api- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/api
# Build all packages
pnpm run build
# Start production servers
pnpm run start# Run all tests
pnpm run test
# Run tests in watch mode
pnpm run test:watch
# Run E2E tests
pnpm run test:e2e
# Run tests for specific package
pnpm run test --filter=web# Generate coverage report
pnpm run test:coverage# Lint code
pnpm run lint
# Type checking
pnpm run type-check
# Format code
pnpm run format# Access Supabase dashboard
# Go to your project dashboard for database management
# Or use Supabase CLI (if installed)
supabase db reset
supabase db push# Kill process on port 3000
lsof -ti:3000 | xargs kill -9
# Or use different ports
pnpm run dev:new # Uses port 4000# Clear cache and reinstall
rm -rf node_modules
rm pnpm-lock.yaml
pnpm install- Make sure all required environment variables are set
- Check that file names are correct (
.env.localfor web,.envfor api) - Restart development servers after changing environment variables
# Run type checking
pnpm run type-check
# Check for missing types
pnpm install @types/node @types/react- Check existing issues on GitHub
- Search the documentation
- Ask in Discord: https://discord.gg/f6AG7kt7
- Create an issue with the "Question" template
Once your environment is set up:
- Read the Contributing Guide: CONTRIBUTING.md
- Check for Good First Issues: Look for issues labeled
good first issue - Join the Community: Connect with other contributors on Discord
- Start Contributing: Pick an issue and create a pull request
# Update your fork with upstream changes
git checkout main
git pull upstream main
git push origin mainHappy coding! 🎬
If you encounter any issues during setup, please don't hesitate to ask for help in our Discord community.