Git Product home page Git Product logo

node-react-starterkit's Introduction

React Node Starter Kit

This is a Starter template for react and node application

Initializing

Install both node and react dependencies with following npm command

  npm run install-all

npm i && cd client && npm i --force

  • First it installs node modules for server
  • change directory to client
  • Installs node modules for client

Run development server

To run a development version of this application run the following npm command (Both fronend and backend)

  npm run start-mon

concurrently --names "Server,client" -c "bgGreen.bold,bgBlue.bold" "nodemon server/src/index.js" "cd client && npm start"

  • Uses concurently package to run server and client at the same time
  • --names "Server,client" names for our process
  • -c "bgGreen.bold,bgBlue.bold" colors to differentiate
  • "nodemon server/src/index.js" "cd client && npm start" commands to run in concurently

To run only server

To start the server without fronend

  npm run dev

nodemon server/src/index.js

  • starts server with nodemon

Only build generation

To run a production version of this application first run the build command which will generate a publish folder in root

  npm run build

cd client && npm run build

  • Changes to client directory
  • Runs npm run build inside client to generate publish folder in parent (i.e same level as server)

Build and deploy zip generation

The following command build the frontend applocation and creates a deploy folder and deploy.zip in parent folder (app level)

Logo

  npm run build-deploy

cd client && npm run build && cd .. && npm run create-zip

  • Changes to client directory
  • Runs npm run build inside client to generate publish folder in parent (i.e same level as server)
  • changes to parent directory (server)
  • runs create-zip custom script to generate deploy folder and deploy.zip in parent filder ( same level as app)

starting application

To start the application after build is done run the following command

  npm start

Dependency commands and scripts

The folowing scripts and commands are not directly used by user but they are used by our main scripts

create-zip

To run a task in gulpfile which will create a deploy folder and generates deploy.zip

  npm run create-zip

Logo

  • Executes gulp createDeploy command to run createDeploy task

  • Gulpfile contains the above script to perform the operations

node-react-starterkit's People

Contributors

sbendalam avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.