This guide walks you through deploying CoinLabs to Render.com, a free hosting platform that supports both frontend and backend applications.
- ✅ Supports FastAPI backend with persistent processes (essential for your simulator)
- ✅ Hosts React/Vite frontend with automatic builds
- ✅ Free tier with generous limits
- ✅ Easy environment variable management
- ✅ GitHub integration for auto-deploy on push
- ✅ One dashboard for both frontend and backend
- GitHub account (push your repo if not already there)
- Render account (sign up at https://render.com with GitHub)
- Supabase project set up (you already have this)
Make sure your CoinLabs repo is on GitHub:
cd /Users/andresalonso/Desktop/Projects/CoinLabs
git add .
git commit -m "Ready for Render deployment"
git push origin master- Go to https://dashboard.render.com
- Click "New +" → "Web Service"
- Connect your GitHub repository (select AXAStudio/CoinLabs)
- Configure:
- Name:
coinlabs-api(or your choice) - Environment: Python 3
- Root Directory:
backend - Build Command:
pip install -r requirements.txt - Start Command:
uvicorn app.main:app --host 0.0.0.0 --port 8000 - Plan: Free
- Name:
In the Web Service dashboard, go to Environment and add:
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_ANON_KEY=your_anon_key_here
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key_here
ENV=PRODUCTION
Get these values from your .env file.
- Click "Create Web Service"
- Wait for deployment (3-5 minutes)
- Your backend URL will be like:
https://coinlabs-api.onrender.com
Save this URL — you'll need it for the frontend.
- Click "New +" → "Web Service"
- Configure:
- Name:
coinlabs-web(or your choice) - Environment: Node
- Root Directory:
frontend - Build Command:
npm run build - Start Command:
npm run preview - Plan: Free
- Name:
- Click "Create Web Service"
- Wait for deployment (3-5 minutes)
- Your frontend URL will be like:
https://coinlabs-web.onrender.com
In the Web Service dashboard, go to Environment and add:
VITE_SUPABASE_URL=https://your-project.supabase.co
VITE_SUPABASE_PUBLISHABLE_KEY=your_publishable_key_here
These env vars will be available during the build and at runtime.
Using a Web Service with npm run preview is more reliable for monorepo setups because:
- Avoids path resolution issues with Static Site's root directory handling
- Serves the built files correctly
- Simpler environment variable management
- Still uses the free tier
Previous Note: Static Site Option (Not Recommended)
If you prefer a Static Site deployment, you can use it, but be aware:
- Requires careful
rootDirconfiguration - Path resolution can be tricky in monorepos
- We recommend using Web Service for reliability
Once both are deployed, update your frontend to use the production backend URL.
- Open your deployed frontend
- Go to Settings
- Change API Base URL to your Render backend URL
- Example:
https://coinlabs-api.onrender.com - Save settings (this persists in localStorage)
Edit frontend/src/pages/Dashboard.tsx to set the default API URL:
const apiUrl = localStorage.getItem('apiUrl') || 'https://coinlabs-api.onrender.com';And in frontend/src/pages/Auth.tsx similarly.
- Visit your frontend URL:
https://coinlabs-web.onrender.com(or whatever you named it) - Try to sign up / log in
- Add a crypto asset
- Check the browser console (F12) for any errors
- Check the Render logs (Dashboard → Service → Logs) for backend issues
- Make sure you updated the backend routing (should have
/cryptoprefix) - Check the backend logs on Render dashboard
- Restart the service: Dashboard → Service → Manual Deploy
- Check that the frontend Build Command ran successfully
- Verify the Publish Directory is set to
dist - Clear browser cache and refresh
- Confirm Supabase env vars are set in both backend AND frontend
- Check that SUPABASE_URL and SUPABASE_PUBLISHABLE_KEY are correct
- Verify CORS: Backend has
allow_origins=["*"]which should work
- Check backend logs for errors in
start_simulation() - Render free tier has 750 free hours/month — shared among all services
- If simulator uses heavy CPU, consider upgrading to paid plan
- Verify backend has the
/crypto/portfolioroute - Check that
apiUrlin frontend settings points to correct backend URL - Look at backend logs for routing errors
SUPABASE_URL=your_project.supabase.co
SUPABASE_ANON_KEY=your_key
SUPABASE_SERVICE_ROLE_KEY=your_key (keep private!)
ENV=PRODUCTION
VITE_SUPABASE_URL=your_project.supabase.co
VITE_SUPABASE_PUBLISHABLE_KEY=your_publishable_key
Once deployed:
- Push changes to GitHub
- Render automatically redeploys
- For frontend: Static site rebuilds, Web Service rebuilds and restarts
- For backend: Automatically rebuilds and restarts
- Backend Logs: Dashboard → Service → Logs
- Frontend Logs: Dashboard → Service → Logs (for build) or browser console (runtime)
- Error Messages: Check Render dashboard and browser DevTools (F12)
- 750 free hours/month (shared across all services)
- 1 free PostgreSQL database
- Services spin down after 15 minutes of inactivity (cold start when accessed)
- No bandwidth limits
For production use, consider upgrading to Starter Plan ($7/month per service).
- ✅ Deploy backend
- ✅ Deploy frontend
- ✅ Connect frontend to backend API URL
- ✅ Test login and crypto features
- Share your live URL!
For more help, visit: https://render.com/docs