Deploying a React App as a Single Page App

React Log

In this tutorial, I am going to show you guys, How to make a react app and deploy it on GStatic for free

Step 1

Install the create-react-app command utility by Facebook, this will help you to make Robust React App

    npm i -g create-react-app 

Above command will install create-react-app globally on your system.

Step 2

Create a React Project to deploy

    create-react-app demo-app   

Above command will install all the dependency for your project and will provide a basic react project files.

Step 3

After to make necessary changes to your project, its time to build it.

    npm run build   

Above will build the project and will put the optimized source in new created ‘build’ directory

Step 4

Install GStatic Command Cli on you system, for detailed installation guide, visit here

    npm i -g yu-gstatic

Step 5

Authenticate your self with following command, for detailed Authentication guide, visit here

    gstatic login  

Or use gstatic signup if don’t have an account

Step 6

Change to the production directory, in our case its build

    cd build

Step 7

Upload your project with your desired domain name as SPA,

    gstatic up react-demo.gstatic.tech spa

react-demo.gstatic.tech

That’s it, You just deployed your react project for free at react-demo.gstatic.tech, Share your project with your friends.