Installation

Welcome to React! React helps you build modern web applications.

For getting started an React application you needs two things as Prerequisites.

Prerequisites

Before you begin, make sure your development environment includes Node and an npm package manager.

  1. Node.js

    Install Node.js using downloaded file

    To check your node version, run node -v in a terminal/console window.

  2. Npm package manager

    CLI (command line interface), and React apps depend on features and functionality provided by libraries that are available as npm packages. To download and install npm packages, you must have an npm package manager.

    This Quick Start uses the npm client command line interface, which is installed with Node.js by default. To check that you have the npm client installed, run npm -v in a terminal/console window.

    For better understanding React we suggest you to once go through official documentation of React from reactjs.org

React setup

If you want Cuba theme setup then directly follow next Cuba setup section

Create Initial application

Run the npm command create-react-app and provide the name my-app, as shown here:

npx create-react-app my-app

The create-react-app command prompts you for information about features to include in the initial app project. Accept the defaults by pressing the Enter or Return key.

Serve Application

Go to the workspace folder (my-app).

cd my-app

Launch the server by using the npm command npm start

npm start

Build Application

Build you application for host on server using below command:

npm run build

It will create one dist file in your theme folder. Make zip of dist folder. so here you are ready to upload your theme on server.

If you’re using Apache HTTP Server, you need to create a .htaccess file in the public folder by pastng below code

Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.html [QSA,L]

Now upload your dist folder on public folder

Cuba setup

If you have already download and install node.js then ignore prerequisites accordingly.

Node.js

Download latest version of node.js from nodejs.org.

Install Node.js using downloaded file

To check your node version, run node -v in a terminal/console window.

Cuba Theme Setup
  1. Download and extract an Cuba themes from themeforest
  2. Extract it and then go in to theme folder.
    cd theme
  3. Import all dependency by installing npm command
    npm install
  4. Now you are in stage to successfully run Cuba using below command:
    npm start