This guide walks you through setting up Nounspace for local development, including database setup and seeding.
- Node.js v22.11.0 or later
- yarn package manager
- Git
- Docker (for local Supabase instance)
- Supabase CLI (install with
brew install supabase/tap/supabaseornpm install -g supabase)
# Clone the repository
git clone https://github.com/nounspace/nounspace.ts.git
cd nounspace.ts
# Install dependencies
yarn installStart the local Supabase instance (this will start Docker containers):
supabase startThis will:
- Start PostgreSQL database
- Start Supabase API server
- Start Supabase Studio (admin UI)
- Display connection credentials
Note: The first time you run supabase start, it will download Docker images and may take a few minutes.
After starting, you'll see output like:
API URL: http://localhost:54321
GraphQL URL: http://localhost:54321/graphql/v1
DB URL: postgresql://postgres:postgres@localhost:54322/postgres
Studio URL: http://localhost:54323
anon key: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
service_role key: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
- Supabase Studio: http://localhost:54323 (admin UI)
- API URL: http://localhost:54321
Create a .env.local file in the root directory:
cp .env.example .env.localConfigure the following in .env.local using the credentials from supabase start:
# Supabase Local (Required - use values from `supabase start` output)
NEXT_PUBLIC_SUPABASE_URL=http://localhost:54321
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-local-anon-key
SUPABASE_SERVICE_KEY=your-local-service-role-key
# Authentication (Required)
NEXT_PUBLIC_PRIVY_APP_ID=your-privy-app-id
# Farcaster (Required)
NEXT_PUBLIC_NEYNAR_API_KEY=your-neynar-api-key
# Community Override (Optional - for local testing)
NEXT_PUBLIC_TEST_COMMUNITY=nouns
# ImgBB (Optional - only needed for asset uploads during seeding)
NEXT_PUBLIC_IMGBB_API_KEY=your-imgbb-api-keyAfter running supabase start, the credentials are displayed in the terminal output. You can also get them anytime with:
supabase statusCopy the anon key and service_role key to your .env.local file.
With the local Supabase instance running, apply database migrations:
# Apply all migrations
supabase db resetThis will:
- Reset the database (clears all data)
- Run all migrations in
supabase/migrations/ - Run the seed SQL from
supabase/seed.sql
Note: supabase db reset is safe for local development - it resets your local database and applies all migrations and seeds.
Alternatively, if you want to apply migrations without resetting:
# Apply migrations only (without reset)
supabase migration upAfter migrations are complete, seed the database with community configs and navigation pages:
# Full seeding (uploads assets, seeds configs, uploads navPage spaces)
yarn seed
# Or use tsx directly
tsx scripts/seed.ts# Check if database is already seeded
yarn seed:check
# or
tsx scripts/seed.ts --check
# Skip asset upload (use existing URLs)
tsx scripts/seed.ts --skip-assets- Uploads Nouns assets to ImgBB (if
NEXT_PUBLIC_IMGBB_API_KEYis set) - Creates storage buckets (if needed)
- Creates navPage space registrations (home, explore pages)
- Seeds community configs (nouns, example, clanker)
- Uploads navPage space configs to Supabase Storage
yarn devThe app will be available at http://localhost:3000
By default, the app loads the community specified in NEXT_PUBLIC_TEST_COMMUNITY (or defaults to nouns).
To test a different community:
# Test 'example' community
NEXT_PUBLIC_TEST_COMMUNITY=example yarn dev
# Test 'clanker' community
NEXT_PUBLIC_TEST_COMMUNITY=clanker yarn devOr use localhost subdomains:
# Visit example.localhost:3000 (requires /etc/hosts setup)
# Or use a tool like localhost.run for subdomain support-
Check seeding status:
yarn seed:check
-
Visit the app:
- Open
http://localhost:3000 - You should see the Nouns community homepage
- Open
-
Check navigation:
- Home page should load (
/home) - Explore page should load (
/explore) - No 404 errors
- Home page should load (
Solution: Set NEXT_PUBLIC_TEST_COMMUNITY in your .env.local:
NEXT_PUBLIC_TEST_COMMUNITY=nounsPossible causes:
- Local Supabase not running - Run
supabase start - Database not seeded - Run
yarn seed - Wrong Supabase credentials - Verify in
.env.local(should use local values fromsupabase start) - Migrations not run - Run
supabase db reset
Solution:
# Check if seeded
yarn seed:check
# Re-seed if needed
yarn seedSolution: Ensure navPage spaces are uploaded:
# Re-run seeding (will skip existing data)
yarn seedSolution: The app requires a seeded database. Ensure:
- Migrations are run
- Database is seeded (
yarn seed) NEXT_PUBLIC_TEST_COMMUNITYis set
src/
├── app/ # Next.js App Router
│ ├── (spaces)/ # Space-related routes
│ ├── [navSlug]/ # Dynamic navigation pages (home, explore, etc.)
│ ├── api/ # API routes
│ ├── notifications/ # Notifications
│ ├── privacy/ # Privacy page
│ ├── pwa/ # PWA configuration
│ └── terms/ # Terms page
├── authenticators/ # Authentication system
├── common/ # Shared code
│ ├── components/ # UI components (atomic design)
│ ├── data/ # State management
│ ├── fidgets/ # Core fidget functionality
│ ├── lib/ # Utilities and helpers
│ └── providers/ # React context providers
├── constants/ # Application constants
├── contracts/ # Blockchain contract interfaces
├── fidgets/ # Mini-applications
├── pages/ # Legacy Next.js pages
└── styles/ # Global styles
Spaces are customizable hubs that users can personalize with themes, tabs, and fidgets.
Mini-applications that can be added to spaces to provide specific functionality.
Visual customization system that allows users to personalize their spaces.
The app uses Privy for authentication with Farcaster integration for social features.
- Make changes to the codebase
- Run linting with
yarn lint - Check types with
yarn check-types - Test changes with
yarn test - Create a PR following the Contributing guidelines
# Start Supabase
supabase start
# Check status
supabase status
# Stop Supabase
supabase stop
# Reset database (clears data, runs migrations + seed.sql)
supabase db reset
# View logs
supabase logs# Setup (one-time)
yarn install
cp .env.example .env.local
supabase start # Start local Supabase (Docker)
# Copy credentials from supabase start output to .env.local
supabase db reset # Run migrations and seed SQL
yarn seed # Seed community configs and navPage spaces
# Development (daily)
supabase start # Start Supabase if not running
yarn dev
# Check seeding
yarn seed:check
# Re-seed (if needed)
yarn seed
# Stop Supabase (when done)
supabase stop- Read the Architecture Overview to understand the system
- Check out Fidgets Overview to learn about available fidgets
- Review Component Architecture for UI development
- Check Configuration System for how configs work
- Review Project Structure to understand the codebase