You now know how to:
createAsyncThunk or Redux-SagaNow itβs time to share your work with the world! π In this lesson, weβll learn how to deploy your React application so anyone can access it online.
Before deployment, we need to generate an optimized version of your app.
From your project folder, run:
npm run build
This creates a dist (Vite) or build (CRA) folder containing:
Because development mode:
The production build: β Loads faster β Consumes less bandwidth β Runs efficiently on any browser
Weβll focus on Netlify and Vercel, two popular platforms that are:
Pick one:
| Platform | Best For | Notes |
|---|---|---|
| Netlify | Simple SPA hosting | Drag-and-drop deployment available |
| Vercel | React + Next.js ecosystems | Smooth with GitHub auto-deploy |
Both are excellent, so use whichever feels more convenient.
Run:
npm run build
Drag your dist or build folder into the window
π Your app is instantly live.
Push code to GitHub
Go to https://app.netlify.com/
New Site β Import from Git Repository
Select your repo
Build command:
npm run build
Publish directory:
dist (for Vite)build (for CRA)β Netlify auto-builds every time you push updates.
Install CLI (optional but useful):
npm install -g vercel
Run:
vercel
Follow the prompts β your app goes live.
Or:
β Vercel also auto-builds on every push.
Share your link with:
This is a major milestone β you now have a real production app online.
| Tip | Why It Matters |
|---|---|
Always run npm run build before deploying | Ensures optimized bundle |
| Use GitHub linking | Enables automatic redeploy on push |
| Verify environment variables if using APIs | Avoid key exposure |
| Test performance with Lighthouse | Identify speed improvements |
You just learned how to:
| Step | Outcome |
|---|---|
| Create production build | Optimized version ready to deploy |
| Deploy to Netlify or Vercel | Your app is now accessible on the web |
| Share project | Showcase your skills publicly |
This is a huge milestone. Deploying your app makes your learning real.