Take your full-stack application from your computer to the internet for the world to use.
Deployment Options
Deploy Frontend
Deploy Backend
Connect Everything
CI/CD
Quiz
Deployment Options
Deploying your app is like opening a restaurant. You have been cooking amazing dishes in your kitchen (localhost). Now it is time to find a location (hosting provider), set up the dining area (frontend), the kitchen (backend), the pantry (database), and open the doors to the public. Each part needs its own setup, but once it all comes together, you are serving customers!
Different parts of your full-stack app can be deployed to different services:
Component
Popular Options
Free Tier?
Frontend (React)
Vercel, Netlify, GitHub Pages
Yes
Backend (Node/Express)
Railway, Render, Fly.io
Yes (limited)
Database
Supabase, PlanetScale, Railway
Yes (limited)
Full Stack
Railway, Render, DigitalOcean
Varies
For beginners, Vercel (frontend) + Railway (backend + database) is a great combination. Both have generous free tiers and are very beginner-friendly.
Deploy Frontend
Deploying a React frontend to Vercel takes less than 5 minutes:
Terminal — Deploy to Vercel
Environment Variables on Vercel
Vercel Dashboard — Environment Variables
Deploy Backend
Deploying a Node.js backend to Railway:
Steps — Deploy Backend to Railway
Update Database Config for Production
JavaScript — Database Config for Dev & Production
Connect Everything
Now your frontend and backend are deployed separately. You need to connect them:
CORS is critical! Without proper CORS configuration, your frontend cannot make API calls to your backend. The browser blocks cross-origin requests by default for security.
CI/CD is like an automatic assembly line in a factory. Instead of manually inspecting and shipping each product (deployment), the assembly line automatically tests every product (CI) and ships it if it passes all checks (CD). Every time you push code, tests run automatically, and if everything passes, it gets deployed.
CI (Continuous Integration) = Automatically run tests when code is pushed CD (Continuous Deployment) = Automatically deploy when tests pass
.github/workflows/ci.yml — GitHub Actions
Deployment Checklist
#
Task
Status
1
Environment variables set on hosting platform
Required
2
Database migrated / synced
Required
3
CORS configured for production domain
Required
4
HTTPS enabled (most hosts do this automatically)
Required
5
Security middleware (helmet, rate limiter) active
Recommended
6
Error logging set up
Recommended
7
CI/CD pipeline configured
Recommended
8
Custom domain connected
Optional
📝 Chapter 20 Quiz
1. Which platform is best for deploying a React frontend?
Railway
Vercel
SQLite Cloud
Docker Hub
2. Why would your deployed frontend fail to fetch data from your deployed backend?
Because they are on different hosting providers
Because the frontend needs a database too
CORS is not configured to allow the frontend domain
Because fetch() only works on localhost
3. How should you set environment variables in production?
Through the hosting platform's dashboard or settings
Commit the .env file to GitHub
Hard-code them in the source code
Email them to the server admin
4. What does CI/CD automate?
Writing code and fixing bugs
Creating Git branches
Database backups only
Testing code and deploying when tests pass
5. In a Vite/React app, what prefix must frontend environment variables have?
REACT_APP_
VITE_
PUBLIC_
No prefix needed
Congratulations! You Did It!
You have completed the Full Stack JavaScript course!
You now have the knowledge to build and deploy full-stack web applications. Here is what you have learned:
Frontend — HTML, CSS, JavaScript, React
Backend — Node.js, Express, REST APIs
Database — SQL, Sequelize ORM
Security — Authentication, JWT, Hashing
DevOps — Git, Docker, CI/CD, Deployment
The best way to learn is to build projects. Start with a personal project, contribute to open source, and never stop learning. You have got this!