cd d:\DVSgit init
git add .
git commit -m "Initial commit"
git branch -M main- Go to https://github.com/new
- Name:
blockchain-voting-system - Keep it Public
- Don't initialize with README
- Click "Create repository"
git remote add origin https://github.com/YOUR_USERNAME/blockchain-voting-system.git
git push -u origin mainnpm install -g @railway/clirailway loginBrowser opens → Click "Authorize" → Close browser
cd d:\DVS\backendrailway init- Select: "Create new Project"
- Enter project name:
voting-backend - Press Enter
railway add- Select: "PostgreSQL"
- Wait for deployment...
railway link- Select your GitHub repo
- Select service: voting-backend
railway variables set JWT_SECRET="my_super_secret_jwt_key_12345"
railway variables set SESSION_SECRET="my_super_secret_session_key_67890"
railway variables set NODE_ENV="production"railway upWait 2-3 minutes for build...
railway run npm run migrate
railway run node create-superadmin.jsrailway statusCopy the URL - looks like: https://voting-backend-production-xxxx.up.railway.app
- Go to https://railway.app/dashboard
- Click your project → Click service
- Settings → Generate Domain
- Copy the URL
npm install -g vercelcd d:\DVS\frontendecho REACT_APP_API_URL=https://YOUR_RAILWAY_URL/api > .env.productionReplace YOUR_RAILWAY_URL with actual Railway URL from Step 2.10
Example:
echo REACT_APP_API_URL=https://voting-backend-production-xxxx.up.railway.app/api > .env.productionvercel login- Choose: GitHub
- Browser opens → Authorize → Close browser
vercelAnswer the prompts:
- Set up and deploy? Y
- Which scope? [Your account] (press Enter)
- Link to existing project? N
- What's your project's name? voting-frontend (press Enter)
- In which directory is your code? ./ (press Enter)
- Want to override settings? N
Wait 2-3 minutes...
vercel --prodLook for: ✅ Production: https://voting-frontend-xxxx.vercel.app
Copy this URL!
Open: d:\DVS\backend\src\server.js
Find this line (around line 24):
origin: 'http://localhost:3000',Replace with:
origin: ['http://localhost:3000', 'https://voting-frontend-xxxx.vercel.app'],Use your actual Vercel URL!
cd d:\DVS
git add .
git commit -m "Update CORS for production"
git pushRailway will auto-redeploy in 2 minutes.
https://voting-frontend-xxxx.vercel.app
Open in browser:
https://your-railway-backend-url.up.railway.app/
Should show: "Blockchain Voting System Backend Running"
- Use superadmin credentials created earlier
- If you forgot, run:
railway run node create-superadmin.js- Frontend: https://voting-frontend-xxxx.vercel.app
- Backend: https://voting-backend-production-xxxx.up.railway.app
- Database: (Managed automatically by Railway)
- Blockchain: (Running on Railway)
cd d:\DVS
git add .
git commit -m "Your changes"
git pushRailway auto-deploys!
cd d:\DVS
git add .
git commit -m "Your changes"
git pushVercel auto-deploys!
cd d:\DVS\backend
railway logscd d:\DVS\frontend
vercel logsrailway restartvercel --prod --force- Dashboard: https://railway.app/dashboard
- Docs: https://docs.railway.app
- Dashboard: https://vercel.com/dashboard
- Docs: https://vercel.com/docs
Total Time: ~15 minutes
Total Cost: $0.00 (100% FREE) 🎉