DEV Community

Chayti
Chayti

Posted on • Edited on

11

MERN stack project deployment steps to Netlify

If you are still having a lot of issues to deploy in firebase you can also deploy to netlify. Netlify deploy for a react project is far easy for you. Right? Follow this link: Just 3 steps:

Step-1: Go the public folder in your project. create a file called _redirects . Copy & paste the following the code inside the _redirects file, then save.

/* /index.html 200

Step-2: Create dist folder in the root directory for your project. [Root directory is the path where your package.json locates] giving the following command.

npm run build

Step-3: Sign in to netlify. Go to sites. Scroll down, drag & drop your dist folder.

Image description

Step-4: The last but most important part for working firebase authentication system properly : (if you don't have any authentication system in your project, then you can skip it.)

  • Go to Firebase Console
  • Click Authentication Menu > Settings tab
  • Scroll Down to Authorized domains
  • Click "Add domain" button, add your netlify deployed url and click "Add"

Image description

Bingo!! That's all!!!

Sentry blog image

How I fixed 20 seconds of lag for every user in just 20 minutes.

Our AI agent was running 10-20 seconds slower than it should, impacting both our own developers and our early adopters. See how I used Sentry Profiling to fix it in record time.

Read more

Top comments (1)

Collapse
 
sajalbiswas1 profile image
Sajal Biswas

Thank you

SurveyJS custom survey software

JavaScript Form Builder UI Component

Generate dynamic JSON-driven forms directly in your JavaScript app (Angular, React, Vue.js, jQuery) with a fully customizable drag-and-drop form builder. Easily integrate with any backend system and retain full ownership over your data, with no user or form submission limits.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay