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:3. Set Up Environment
Create.env.local in the frontend directory:
.env.local:
4. Set Up Database
Create PostgreSQL database:5. Get Test ETH
For Base Sepolia:- Go to Base Sepolia Faucet
- Connect your wallet
- Request test ETH
6. Deploy Contracts (Optional)
For local contract testing:.env.local.
7. Start Development Server
Project Structure
Development Workflow
Frontend Development
Contract Development
Testing
Run all tests:Common Issues
MetaMask not connecting
MetaMask not connecting
- Ensure you’re on the right network (Base Sepolia for testing)
- Reset MetaMask: Settings → Advanced → Reset Account
- Check console for errors
Database connection errors
Database connection errors
- Verify PostgreSQL is running
- Check DATABASE_URL format
- Ensure database exists:
createdb shield
Contract calls failing
Contract calls failing
- Verify contract address in .env
- Ensure you have test ETH
- Check you’re on the right network
IPFS upload failing
IPFS upload failing
- Verify PINATA_JWT is set
- Check JWT hasn’t expired
- Ensure file size under limit
Build errors
Build errors
- Clear
.nextcache: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
- Read about Environment Variables
- Learn the API Reference
- Deploy to Vercel

