Local Development Setup
This guide walks you through setting up Pawtograder for local development.Prerequisites
Before starting, ensure you have the following installed:| Requirement | Version | Notes |
|---|---|---|
| Node.js | v22 (recommended) | Use nvm for version management |
| Docker | Latest | Required for local Supabase. Can use Docker desktop to quickly setup a docker daemon for development. |
| Git | Latest | For cloning the repository |
Quick Start (Staging Backend)
The fastest way to get started is using our staging environment as a backend. This is ideal for frontend development that doesn’t require database changes.Steps
-
Clone the repository
-
Install dependencies
-
Configure environment
Edit
.env.localand fill in your own values if needed. -
Start the development server
-
Access the application
Open
https://localhost:3000in your browser. You’ll need to accept the self-signed certificate warning (HTTPS is required for camera/microphone access in the help queue).
Creating Test Accounts
In the staging environment, you can register with any email without confirmation:- Student account: Use any email (e.g.,
test@example.com) - Instructor account: Include “instructor” in your email (e.g.,
testinstructor@example.com)
Full Local Setup (Supabase)
For development requiring database changes, RLS policy modifications, or running E2E tests, you’ll need a local Supabase instance.Prerequisites
- Docker installed and running
- Node.js v22 or later
Setup Steps
-
Install dependencies
-
Start Supabase
This starts all Supabase services in Docker containers. First run may take several minutes to download images.
-
Initialize the database
This applies all migrations and seeds initial data.
-
Configure environment variables
After
supabase start, you’ll see output like:Update your.env.local: -
Build the application
-
Start Edge Functions
-
Start the development server
-
Seed test data (optional)
This creates a test class with students and assignments. Scroll up in the output to find “Login Credentials” with email/password pairs.
Local Services
Once Supabase is running, these services are available:| Service | URL | Description |
|---|---|---|
| API | http://127.0.0.1:54321 | Supabase REST API |
| Studio | http://localhost:54323 | Database management UI |
| Inbucket | http://localhost:54324 | Email testing interface |
| Application | https://localhost:3000 | Next.js frontend |
Supabase Studio
Access the Supabase dashboard athttp://localhost:54323 to:
- Browse and edit database tables
- View and manage auth users
- Test RLS policies
- Monitor realtime subscriptions
- Manage storage buckets
Email Testing
View captured emails athttp://localhost:54324. Useful for testing:
- Authentication flows (magic links, password reset)
- Notification emails
- Email verification
Development Commands
Daily Development
Database Operations
Testing
Seeding Data
Project Structure
Environment Variables
Required Variables
| Variable | Description |
|---|---|
NEXT_PUBLIC_SUPABASE_URL | Supabase API URL |
NEXT_PUBLIC_SUPABASE_ANON_KEY | Supabase anonymous key |
SUPABASE_URL | Supabase API URL (server-side) |
SUPABASE_SERVICE_ROLE_KEY | Supabase service role key (server-side only) |
Optional Variables
| Variable | Description |
|---|---|
ENABLE_SIGNUPS | Enable user registration UI (true/false) |
END_TO_END_SECRET | Secret for E2E test authentication |
Troubleshooting
Supabase won’t start
- Ensure Docker is running
- Check for port conflicts (54321, 54323, 54324)
- Try stopping and removing containers:
Database connection errors
- Verify Supabase is running:
npx supabase status - Check
.env.localhas correct URLs and keys - Ensure you ran
npx supabase db resetafter starting
TypeScript errors after schema changes
Regenerate types after any database changes:HTTPS certificate warnings
The dev server uses a self-signed certificate. This is expected:- Click “Advanced” → “Proceed to localhost”
- Or add an exception in your browser settings
Edge Functions not working
- Ensure functions are running:
npx supabase functions serve - Check the terminal for function errors
- Verify function URLs in your requests
Hot reload not working
- Check for file system watcher limits (Linux):
- Restart the dev server
Next Steps
- Read the Surveys Developer Guide for feature-specific documentation
- Join the development discussion on GitHub Issues