This guide will help you deploy the SealGuard frontend application to Netlify with all necessary environment variables.
- Netlify Account: Sign up at netlify.com
- GitHub Repository: Your SealGuard code should be in a GitHub repository
- WalletConnect Project ID: Get one from Reown Cloud (formerly WalletConnect)
- Log into your Netlify dashboard
- Click "New site from Git"
- Choose GitHub and authorize Netlify
- Select your SealGuard repository
- Configure build settings:
- Build command:
cd src/frontend && npm run build - Publish directory:
src/frontend/dist - Node version: 18 (set in netlify.toml)
- Build command:
Go to your Netlify site settings → Environment variables and add the following:
# Web3 Configuration (REQUIRED)
NEXT_PUBLIC_REOWN_PROJECT_ID=your_reown_project_id_here
# Contract Addresses - Filecoin Calibration Testnet
NEXT_PUBLIC_REGISTRY_CONTRACT=0xcBB12aBDA134ac0444f2aa41E98EDD57f8D5631F
NEXT_PUBLIC_ACCESS_CONTROL_CONTRACT=0xF565086417Bf8ba76e4FaFC9F0088818eA027539
NEXT_PUBLIC_MULTISIG_CONTRACT=0xa6e75e7bFc73c44C16aaec914e340843a6A66Df8
# Network Configuration
NEXT_PUBLIC_DEFAULT_CHAIN_ID=314159
NEXT_PUBLIC_NETWORK_NAME=Filecoin Calibration
# Filecoin RPC (Optional - has fallback)
NEXT_PUBLIC_FILECOIN_CALIBRATION_RPC=https://api.calibration.node.glif.io/rpc/v1
# Application Settings
NEXT_PUBLIC_APP_NAME=SealGuard
NEXT_PUBLIC_APP_DESCRIPTION=Decentralized Document Verification Platform
NEXT_PUBLIC_APP_URL=https://your-site-name.netlify.app
# Feature Flags
NEXT_PUBLIC_ENABLE_ANALYTICS=true
NEXT_PUBLIC_ENABLE_ONRAMP=true
NEXT_PUBLIC_DEBUG_MODE=false
# IPFS Configuration
NEXT_PUBLIC_IPFS_GATEWAY=https://gateway.pinata.cloud/ipfs/
NEXT_PUBLIC_FILECOIN_RPC=https://api.node.glif.io# RPC URLs for other networks (if needed)
NEXT_PUBLIC_ETHEREUM_RPC=https://eth-mainnet.g.alchemy.com/v2/YOUR_API_KEY
NEXT_PUBLIC_SEPOLIA_RPC=https://eth-sepolia.g.alchemy.com/v2/YOUR_API_KEY
NEXT_PUBLIC_POLYGON_RPC=https://polygon-mainnet.g.alchemy.com/v2/YOUR_API_KEY
NEXT_PUBLIC_MUMBAI_RPC=https://polygon-mumbai.g.alchemy.com/v2/YOUR_API_KEY
# Contract Verification (Development only)
ETHERSCAN_API_KEY=your_etherscan_api_key
POLYGONSCAN_API_KEY=your_polygonscan_api_key- Go to Reown Cloud
- Create a new project
- Copy the Project ID
- Add it as
NEXT_PUBLIC_REOWN_PROJECT_IDin Netlify
- Replace
NEXT_PUBLIC_APP_URLwith your actual Netlify domain - Example:
https://sealguard-app.netlify.app
- In Netlify: Site settings → Domain management
- Add your custom domain if you have one
- Click "Deploy site" in Netlify
- Wait for the build to complete
- Check the deploy logs for any errors
- Visit your site URL to test
After deployment, test these features:
- Wallet Connection: Try connecting a wallet (MetaMask, WalletConnect)
- Network Switching: Ensure it connects to Filecoin Calibration
- Contract Interaction: Test document upload/verification
- IPFS Access: Verify file uploads work
-
Build Fails:
- Check Node.js version (should be 18)
- Verify all dependencies are in package.json
- Check build logs for specific errors
-
Wallet Connection Issues:
- Verify
NEXT_PUBLIC_REOWN_PROJECT_IDis correct - Check browser console for errors
- Ensure domain is added to Reown project settings
- Verify
-
Contract Interaction Fails:
- Verify contract addresses are correct
- Check network configuration
- Ensure RPC URLs are accessible
-
IPFS Upload Issues:
- Verify IPFS gateway URLs
- Check network connectivity
- Test with different IPFS providers if needed
If the build fails, try these alternative commands in Netlify:
npm ci && npm run build(if using package-lock.json)cd src/frontend && npm ci && npm run build
- All
NEXT_PUBLIC_variables are exposed to clients - Never include private keys or sensitive data
- Use your own API keys for production (Alchemy, Infura, etc.)
- The provided API keys are for demonstration only
- Monitor: Check Netlify analytics and logs
- Update: Keep dependencies updated
- Backup: Ensure your environment variables are documented
- Scale: Consider upgrading Netlify plan for production traffic
Need Help? Check the Netlify documentation or contact support if you encounter issues during deployment.