Two deployments, not one
Just like development, your frontend and backend deploy separately. Different platforms, different processes — but they connect the same way: the frontend makes HTTP requests to the backend’s URL.Deploy the frontend (React)
React builds to static files — HTML, CSS, and JavaScript. Any static hosting platform can serve them.Build for production
dist/ folder with your optimized app. That’s what gets deployed.
Vercel (recommended)
The easiest way to deploy a React app. Connects to your GitHub repo and deploys automatically on every push.Import your repository
Click “New Project” → select your repo → set the root directory to
frontend/.Netlify (alternative)
Same idea as Vercel. Connect GitHub, set build command tonpm run build, publish directory to dist/.
Both Vercel and Netlify have generous free tiers. For personal projects and portfolios, you won’t need to pay.
Deploy the backend (FastAPI)
Your Python backend needs a server that can run a process. This is different from static hosting — it’s running actual code.Railway (recommended)
Push your backend to GitHub
Make sure your
backend/ folder has a requirements.txt with all dependencies.Add environment variables
Add
DATABASE_URL, SECRET_KEY, ALLOWED_ORIGINS (set to your frontend’s production URL).Render (alternative)
Similar to Railway. Create a new “Web Service,” connect your GitHub repo, set the start command, add environment variables.Requirements file
Make sure yourrequirements.txt is complete:
Environment variables in production
This is where the.env pattern from the course pays off. In development, you read from .env files. In production, you set environment variables in your hosting platform’s dashboard.
- Frontend (Vercel)
- Backend (Railway)
The deployment checklist
Before deploying, verify:-
npm run buildcompletes without errors (frontend) -
requirements.txtincludes all Python packages (backend) - Environment variables are set in both platforms
-
ALLOWED_ORIGINSincludes your frontend’s production URL -
.envfiles are NOT committed to Git - Backend start command uses
--host 0.0.0.0(not localhost)
After deployment
Test your production app:- Open your frontend URL in a browser
- Open DevTools → Network tab
- Check that API requests go to your production backend URL
- Test all CRUD operations
- Check the Console for any errors
What’s next?
Your app is live on the internet. One more lesson — where to get help when you’re stuck.Get help
Join the community, ask questions, and keep learning