Skip to main content

Local Setup

Get SHIELD running locally for development and testing.

Prerequisites

  • Node.js 18+ (recommend using nvm)
  • npm 9+ or pnpm
  • Git
  • PostgreSQL 14+ (local or cloud)
  • MetaMask or other wallet with test ETH

Quick Start

1. Clone the Repository

2. Install Dependencies

Root dependencies:
Frontend dependencies:
Contract dependencies:

3. Set Up Environment

Create .env.local in the frontend directory:
Edit .env.local:

4. Set Up Database

Create PostgreSQL database:
Run migrations:
Or manually create tables (see Database Schema docs).

5. Get Test ETH

For Base Sepolia:
  1. Go to Base Sepolia Faucet
  2. Connect your wallet
  3. Request test ETH

6. Deploy Contracts (Optional)

For local contract testing:
In another terminal:
Copy the deployed contract address to your .env.local.

7. Start Development Server

Open http://localhost:3000.

Project Structure

Development Workflow

Frontend Development

Contract Development

Testing

Run all tests:

Common Issues

  • Ensure you’re on the right network (Base Sepolia for testing)
  • Reset MetaMask: Settings → Advanced → Reset Account
  • Check console for errors
  • Verify PostgreSQL is running
  • Check DATABASE_URL format
  • Ensure database exists: createdb shield
  • Verify contract address in .env
  • Ensure you have test ETH
  • Check you’re on the right network
  • Verify PINATA_JWT is set
  • Check JWT hasn’t expired
  • Ensure file size under limit
  • Clear .next cache: rm -rf .next
  • Reinstall dependencies: rm -rf node_modules && npm install
  • Check Node version: node --version

IDE Setup

VS Code Extensions

Recommended extensions:
  • ESLint - JavaScript/TypeScript linting
  • Prettier - Code formatting
  • Solidity - Solidity syntax highlighting
  • Tailwind CSS IntelliSense - CSS autocomplete

Settings

Add to .vscode/settings.json:

Next Steps