This guide will walk you through deploying your backend to free hosting platforms.
Before deploying, ensure you have:
- ✅ GitHub account
- ✅ Redis Cloud account (already set up)
- ✅ All code committed to GitHub
- ✅
.envfile configured locally (DO NOT commit this!)
- ✅ Free tier available
- ✅ Auto-deploys from GitHub
- ✅ Easy environment variable management
- ✅ Good for Node.js apps
# Initialize git (if not already done)
git init
# Add all files
git add .
# Commit
git commit -m "Initial commit: Real-time DEX aggregator"
# Create repository on GitHub, then:
git remote add origin https://github.com/YOUR_USERNAME/YOUR_REPO_NAME.git
git branch -M main
git push -u origin main- Go to render.com
- Click "Get Started for Free"
- Sign up with GitHub (easiest option)
- Click "New +" → "Web Service"
- Connect your GitHub repository
- Select your
realtime-dex-aggregatorrepo - Configure:
- Name:
dex-aggregator(or your choice) - Region: Choose closest to you
- Branch:
main - Root Directory: Leave blank
- Runtime:
Node - Build Command:
npm install && npm run build - Start Command:
npm start - Instance Type:
Free
- Name:
In Render dashboard:
- Go to "Environment" tab
- Add these variables:
REDIS_URL:redis://default:YOUR_PASSWORD@redis-17448.c258.us-east-1-4.ec2.cloud.redislabs.com:17448NODE_ENV:production
- Click "Create Web Service"
- Wait for deployment (5-10 minutes)
- Your app will be live at:
https://YOUR_APP_NAME.onrender.com
# Test REST API
curl https://YOUR_APP_NAME.onrender.com/api/tokens?q=SOL
# Test in browser
https://YOUR_APP_NAME.onrender.com/api/tokens?q=SOL- ✅ Very simple setup
- ✅ Free $5/month credit
- ✅ Built-in Redis option
- ✅ Great developer experience
git init
git add .
git commit -m "Initial commit"
git remote add origin https://github.com/YOUR_USERNAME/YOUR_REPO_NAME.git
git push -u origin main- Go to railway.app
- Click "Login" → "Login with GitHub"
- Authorize Railway
- Click "New Project"
- Select "Deploy from GitHub repo"
- Choose your repository
- Railway will auto-detect Node.js
- Click on your service
- Go to "Variables" tab
- Add:
REDIS_URL: Your Redis connection stringPORT: Railway auto-assigns, but you can set to3000
- Railway automatically deploys
- Click "Settings" → "Generate Domain"
- Your app will be at:
https://YOUR_APP.up.railway.app
# Install Fly CLI
curl -L https://fly.io/install.sh | sh
# Login
fly auth login
# Launch app
fly launch
# Set environment variables
fly secrets set REDIS_URL="your-redis-url"
# Deploy
fly deploy# Replace with your actual URL
curl https://YOUR_APP.onrender.com/api/tokens?q=SOLExpected: JSON array of tokens
Open index.html and update the connection URL:
const socket = io('https://YOUR_APP.onrender.com');# Test 5 rapid requests
for i in {1..5}; do
curl https://YOUR_APP.onrender.com/api/tokens?q=SOL
echo "\n---\n"
doneRender:
- Dashboard → Your Service → "Logs" tab
Railway:
- Click your service → "Deployments" → View logs
After deployment, update your README.md:
## 🌐 Live Demo
**API Endpoint:** `https://YOUR_APP.onrender.com/api/tokens?q=SOL`
**WebSocket:** Connect to `https://YOUR_APP.onrender.com`Solution:
- Check logs for errors
- Verify
npm startrunsnode dist/server.js - Ensure
npm run buildcreatesdist/folder
Solution:
- Verify
REDIS_URLenvironment variable is set - Check Redis Cloud is accessible (not IP-restricted)
- Test connection locally first
Solution:
- Use
process.env.PORT || 3000in your code - Hosting platforms assign ports automatically
Solution:
- Ensure CORS is enabled
- Check WebSocket URL uses
https://nothttp:// - Verify Socket.io client version matches server
-
API Call (20 seconds)
- Show curl command
- Display JSON response
- Highlight response time
-
WebSocket Demo (30 seconds)
- Open 2-3 browser tabs with
index.html - Show real-time updates in all tabs simultaneously
- Open 2-3 browser tabs with
-
Architecture Explanation (40 seconds)
- Show diagram
- Explain: Client → API → Aggregator → Cache → External APIs
-
Code Walkthrough (30 seconds)
- Show
aggregator.tsmerging logic - Explain caching strategy
- Show
- Windows: OBS Studio (free)
- Mac: QuickTime or ScreenFlow
- Online: Loom (easiest)
- Record video
- Upload to YouTube (unlisted or public)
- Add link to README
Before submitting:
- Code pushed to GitHub with clean commits
- Deployed to free hosting (Render/Railway)
- Public URL added to README
- Environment variables configured
- API tested and working
- WebSocket tested with multiple tabs
- Demo video recorded and uploaded
- Postman collection created
- Unit tests written (≥10 tests)
- README documentation complete
Your backend is now live and accessible from anywhere in the world! 🌍
Next Steps:
- Share the URL with your interviewer
- Monitor logs for any issues
- Consider adding more features (rate limiting, authentication, etc.)