This guide provides step-by-step instructions for deploying the IITian Academy Milestone Tracker to Render.com.
Before deploying, ensure you have:
- β GitHub Repository - Code pushed to GitHub
- β MongoDB Atlas Account - Database setup with connection string
- β Render Account - Free account at render.com
- β Admin API Key - Secure key for admin operations
-
Sign up/Login to MongoDB Atlas
-
Create a new cluster (free tier M0 is sufficient)
-
Create database user:
- Username:
tracker_user - Password: Generate strong password
- Roles: Read and write to any database
- Username:
-
Configure Network Access:
- Add IP:
0.0.0.0/0(allow from anywhere) - Or add Render's IP ranges for better security
- Add IP:
-
Get Connection String:
mongodb+srv://tracker_user:<password>@cluster0.xxxxx.mongodb.net/?retryWrites=true&w=majority
- Connect to cluster using MongoDB Compass or CLI
- Create database:
tracker_db - Create collection:
pages
Your repository should contain:
milestone-tracker/
βββ app/
β βββ __init__.py
β βββ main.py
β βββ models.py
β βββ database.py
β βββ auth.py
βββ static/
β βββ styles.css
β βββ dashboard.js
βββ templates/
β βββ dashboard.html
βββ backups/
βββ Dockerfile
βββ docker-compose.yml
βββ requirements.txt
βββ render.yaml
βββ README.md
Ensure your Dockerfile is optimized for Render:
FROM python:3.11-slim
WORKDIR /app
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
RUN apt-get update && apt-get install -y \
gcc \
curl \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
RUN mkdir -p /app/backups
COPY app/ /app/app/
COPY static/ /app/static/
COPY templates/ /app/templates/
RUN adduser --disabled-password --gecos '' appuser
RUN chown -R appuser:appuser /app
USER appuser
EXPOSE 8000
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8000/health || exit 1
CMD ["python", "-m", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]-
Login to Render
- Go to render.com
- Sign in with GitHub
-
Create New Web Service
- Click "New +" β "Web Service"
- Connect your GitHub repository
- Select the milestone-tracker repository
-
Configure Service
Name: iitian-milestone-tracker Environment: Docker Region: Oregon (or closest to your location) Branch: main Docker Context Directory: . Dockerfile Path: ./Dockerfile -
Set Environment Variables Click "Advanced" and add:
MONGODB_URI=mongodb+srv://tracker_user:<password>@cluster0.xxxxx.mongodb.net/?retryWrites=true&w=majority DATABASE_NAME=tracker_db ADMIN_API_KEY=your-secure-admin-api-key-here PORT=8000 HOST=0.0.0.0 PROJECT_NAME=IITian Academy Question Tracker MILESTONE_DEADLINE=2025-10-17 MILESTONE_CREATED=2025-10-13 TOTAL_QUESTIONS=480 MILESTONE_AMOUNT=30 -
Deploy
- Click "Create Web Service"
- Wait for build and deployment (5-10 minutes)
-
Ensure render.yaml exists in repository root:
services: - type: web name: iitian-milestone-tracker env: docker plan: free region: oregon branch: main dockerfilePath: ./Dockerfile envVars: - key: MONGODB_URI sync: false - key: DATABASE_NAME value: tracker_db - key: ADMIN_API_KEY generateValue: true - key: PORT value: 8000 - key: HOST value: 0.0.0.0 - key: PROJECT_NAME value: IITian Academy Question Tracker - key: MILESTONE_DEADLINE value: 2025-10-17 - key: MILESTONE_CREATED value: 2025-10-13 - key: TOTAL_QUESTIONS value: 480 - key: MILESTONE_AMOUNT value: 30 healthCheckPath: /health
-
Deploy from Blueprint
- In Render dashboard, click "New +" β "Blueprint"
- Connect repository and select render.yaml
- Review configuration and deploy
| Variable | Value | Description |
|---|---|---|
MONGODB_URI |
mongodb+srv://... |
MongoDB Atlas connection string |
DATABASE_NAME |
tracker_db |
Database name |
ADMIN_API_KEY |
your-secure-key |
Admin authentication key |
PORT |
8000 |
Server port (Render auto-detects) |
HOST |
0.0.0.0 |
Server host |
| Variable | Default | Description |
|---|---|---|
PROJECT_NAME |
IITian Academy Question Tracker |
Display name |
MILESTONE_DEADLINE |
2025-10-17 |
Project deadline |
MILESTONE_CREATED |
2025-10-13 |
Project start date |
TOTAL_QUESTIONS |
480 |
Total questions target |
MILESTONE_AMOUNT |
30 |
Milestone value |
- Navigate to your service in Render dashboard
- Go to Environment tab
- Add each variable:
- Key: Variable name
- Value: Variable value
- Click "Add"
- Save Changes - triggers automatic redeployment
-
View Logs
- Go to "Logs" tab in Render dashboard
- Look for successful startup messages:
Successfully connected to MongoDB Application started successfully Uvicorn running on http://0.0.0.0:8000
-
Test Health Check
- Visit:
https://your-app.onrender.com/health - Should return:
{"status": "healthy", ...}
- Visit:
-
Access Dashboard
- Visit:
https://your-app.onrender.com - Should load the milestone tracker dashboard
- Visit:
# Test public endpoints
curl https://your-app.onrender.com/api/progress
curl https://your-app.onrender.com/health
# Test admin endpoint (replace with your API key)
curl -X POST "https://your-app.onrender.com/api/backup" \
-H "X-API-Key: your-admin-api-key"- Purchase domain from registrar (GoDaddy, Namecheap, etc.)
- In Render dashboard:
- Go to service settings
- Click "Custom Domains"
- Add your domain:
tracker.yourdomain.com
- Configure DNS at your registrar:
- Add CNAME record:
trackerβyour-app.onrender.com
- Add CNAME record:
- Wait for SSL certificate (automatic)
-
Health Checks
- Render automatically monitors
/healthendpoint - Restarts service if health checks fail
- Render automatically monitors
-
View Metrics
- Go to "Metrics" tab in dashboard
- Monitor CPU, memory, and response times
-
Set Up Alerts
- Configure email notifications for failures
- Set up Slack/Discord webhooks if needed
-
Push to GitHub
- Make changes locally
- Commit and push to main branch
- Render automatically redeploys
-
Manual Redeploy
- In Render dashboard, click "Manual Deploy"
- Select latest commit or specific commit
-
Automatic Backups
- Application creates daily backups at 2 AM UTC
- Stored in
/backups/directory (ephemeral on Render)
-
External Backup Storage
- Consider adding AWS S3 or Google Cloud Storage
- Modify backup function to upload to cloud storage
β Build Failed
Solution:
- Check Dockerfile syntax
- Verify all files are committed to repository
- Review build logs for specific errors
β Database Connection Error
Solution:
- Verify MONGODB_URI is correct
- Check MongoDB Atlas network access (0.0.0.0/0)
- Ensure database user has proper permissions
β Environment Variables Not Working
Solution:
- Check spelling of variable names
- Ensure values don't have extra spaces
- Redeploy after adding variables
β Application Won't Start
Solution:
- Check logs for Python errors
- Verify all dependencies in requirements.txt
- Ensure PORT environment variable is set
-
Check Render Logs
- Detailed error messages in logs tab
- Look for Python tracebacks
-
Test Locally
- Run
docker build .to test build - Use
docker-compose upto test locally
- Run
-
Render Support
- Check Render documentation
- Contact Render support for platform issues
-
Environment Variables
- Never commit API keys to repository
- Use Render's environment variable encryption
-
API Key Management
- Generate strong, unique API keys
- Rotate keys regularly
- Monitor API usage
-
Database Security
- Use MongoDB Atlas with proper access controls
- Enable auditing and monitoring
- Regular security updates
-
HTTPS
- Render provides free SSL certificates
- Redirect HTTP to HTTPS (automatic)
- Free Tier: 750 hours/month, sleeps after 15 min inactivity
- Starter Plan: $7/month, no sleeping, more resources
- Standard Plan: $25/month, enhanced features
- Use Free Tier for development/demo
- Upgrade for Production if constant availability needed
- Monitor Usage in Render dashboard
- Optimize Docker Image to reduce build times
Your IITian Academy Milestone Tracker is now deployed on Render! π
Your URLs:
- Dashboard:
https://your-app.onrender.com - API Docs:
https://your-app.onrender.com/docs - Health Check:
https://your-app.onrender.com/health
Share the dashboard URL with your client for real-time project monitoring.
Need Help? Check the main README.md for additional configuration and usage instructions.