AgroVerse Deployment Checklist
1. Environment Configuration
# Frontend build
npm run build
# The dist/ folder will contain production assets
# Terminal 1: Start backend server
cd server
npm start
# Terminal 2: Test frontend build
npm run preview
Option A: Vercel (Frontend) + Railway/Render (Backend)
Push code to GitHub
Import project in Vercel
Build settings:
Build Command: npm run build
Output Directory: dist
Install Command: npm install
Environment Variables: (None needed for frontend - uses server proxy)
Deploy
Create new service
Connect GitHub repo
Root Directory: server
Build Command: npm install
Start Command: npm start
Add all environment variables from server/.env.example
Deploy
Update frontend API endpoint if needed (currently uses /api/* proxy)
Option B: Single VPS (DigitalOcean/AWS/GCP)
# Install Node.js 18+
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs
# Install MongoDB
# Follow: https://www.mongodb.com/docs/manual/administration/install-on-linux/
# Clone repo
git clone < your-repo>
cd FarmLedge
# Install dependencies
npm install
cd server && npm install && cd ..
# Configure environment
cp server/.env.example server/.env
nano server/.env # Edit with your values
# Build frontend
npm run build
# Setup PM2 for process management
sudo npm install -g pm2
# Start backend
cd server
pm2 start src/index.js --name " agroverse-api"
pm2 save
pm2 startup
# Serve frontend with nginx
sudo apt install nginx
# Configure nginx to serve dist/ folder
# And proxy /api/* to localhost:3001
Option C: Docker Deployment
# Create Dockerfile for backend
# Create docker-compose.yml for full stack
# Deploy to any container platform
Post-Deployment Verification
Common Issues & Solutions
TypeScript any types : Non-blocking, safe to ignore for MVP deployment
React Hook warnings : Fixed critical ones, remaining are optimization suggestions
Large bundle size : Consider code-splitting for optimization (not critical)
MongoDB connection errors : Check MONGODB_URI and network access
Blockchain RPC errors : Verify ARB_SEPOLIA_RPC_URL and relayer has ETH
Stripe webhook failures : Ensure webhook secret matches Stripe dashboard
Weather API errors : Verify OPENWEATHER_API_KEY is valid
Backend has CORS enabled for all origins (production should restrict this)
Update cors() in server/src/index.js for production domains
# Frontend build
npm run build
# Server start
cd server && npm start
# Check logs
pm2 logs agroverse-api
# Restart server
pm2 restart agroverse-api
Review logs in server/ directory
Check MongoDB connection in server logs
Verify blockchain state via /api/chain-info
Test APIs with Postman/curl