React - create & deploy the project on MDB GO

How to deploy & host React app - tutorial & free hosting

This guide will take you step by step on how to create your project and deploy using MDB CLI.


Initialize and publish React project

Initialize

In order to initialize project we will use Create React App, for more option check React documentation

        
            
npx create-react-app my-react-app
cd my-react-app
npm start
        
        
    

Note: npx on the first line is not a typo — it’s a package runner tool that comes with npm 5.2+.

Note: If you've previously installed create-react-app globally via npm install -g create-react-app, we recommend you uninstall the package using npm uninstall -g create-react-app or yarn global remove create-react-app to ensure that npx always uses the latest version.

Now it's time to build your App. Once you are done we can move to deployment.

Publish

Once you finish building your project, use the following command do deploy it:

        
            
              $ mdb frontend publish
        
        
    

Note: Since frontend is a default value for publish command, you can run just mdb publish (instead of mdb frontend publish )

If you are publishing for the first time, CLI will ask you whether you want to use npm or yarn?

Once you successfully publish your project they will be stored for a future.

Once project is deployed you will see following message in a console:

        
            
Success Project built successfully
Sent 1.011 Mb
Your application is available at https://my-angular-app.mdbgo.io      
  
        
    

Video tutorial: