Installation
This guide walks you through setting up PromptRepo for local development. You’ll run Supabase locally using Docker, configure environment variables, and start the Next.js dev server.PromptRepo is designed for both local development and cloud deployment. This guide covers local setup.
Prerequisites
Before you begin, ensure you have the following installed:Node.js 20+
PromptRepo requires Node.js version 20 or higher.Check your version:If you need to install or upgrade Node.js, download it from nodejs.org or use a version manager like nvm.
Docker
Supabase Local Development requires Docker to run PostgreSQL, Auth, and other services.Install Docker:
- Mac: Docker Desktop for Mac
- Windows: Docker Desktop for Windows
- Linux: Docker Engine
Setup Steps
1. Clone the Repository
2. Start Supabase Local Development
Supabase Local runs PostgreSQL, Auth, Storage, and other services in Docker containers.Initialize Supabase
The first run downloads Docker images and applies migrations. This may take 2-5 minutes depending on your internet connection.
3. Configure Environment Variables
Add Supabase credentials
Copy the following template and replace the placeholder values with your keys from Step 2:
.env.local
SUPABASE_SERVICE_ROLE_KEY is required for the MCP server endpoint (
/api/mcp). This key bypasses Row-Level Security (RLS) and should never be exposed to the client.OAuth setup (optional)
If you want to test GitHub or Google OAuth locally:
- Create OAuth apps on GitHub or Google Cloud Console
- Set the callback URL to
http://127.0.0.1:54321/auth/v1/callback - Add the client ID and secret to
.env.local - Restart Supabase:
npx supabase stop && npx supabase start
4. Run Database Migrations
PromptRepo includes versioned SQL migrations insupabase/migrations/. These are automatically applied when you run npx supabase start, but you can verify them:
5. Start the Next.js Dev Server
Open the app
Navigate to http://localhost:3000 in your browser.
Verify the Installation
Sign up with email/password
- Go to http://localhost:3000/auth/login
- Click Sign Up
- Enter an email and password
- Click Sign Up
Confirm your email (Mailpit)
Supabase Local uses Mailpit to capture auth emails:
- Open http://localhost:54324 in a new tab
- You’ll see a confirmation email from Supabase
- Click the confirmation link in the email body
- You’ll be redirected to the PromptRepo dashboard at
http://localhost:3000
Mailpit is an email testing tool that captures all outbound emails from Supabase. It’s only available in local development.
Create a test prompt
- Click Create Prompt
- Fill in the form:
- Title: Test Prompt
- Content: Hello , welcome to PromptRepo!
- Click Create Prompt
Common Issues
Docker Not Running
Symptom:npx supabase start fails with “Cannot connect to Docker daemon”
Solution: Start Docker Desktop and wait for it to fully initialize, then retry npx supabase start.
Port Conflicts
Symptom:npx supabase start fails with “Port 54321 is already in use”
Solution: Another service is using Supabase’s default ports. Stop the conflicting service or run:
Missing Environment Variables
Symptom: Next.js throws “Missing environment variable” errors Solution: Ensure.env.local exists in the project root with all required variables (see Step 3).
Migrations Not Applied
Symptom: Database tables don’t exist or queries fail Solution: Runnpx supabase db reset to re-apply all migrations.
Next Steps
Now that PromptRepo is running locally, you can:Quickstart
Create your first prompt with dynamic variables
Architecture
Learn about the two-table versioning pattern and data model
MCP Server
Connect Claude Desktop or other AI agents to your local instance
Testing
Run the test suite with Vitest
Development Workflow
Running Tests
Linting
Building for Production
The production build runs type checking, linting, and creates an optimized bundle. Fix any errors before deploying.
Stopping Local Services
When you’re done developing:Ctrl+C.