Git Product home page Git Product logo

create-express-react-app's Introduction

Create Express React App

This is a project generator that allows to create your own web application based on Express.js and React. Every new project is created starting from a template using Webpack to create the client bundle that is served by Express.js on the backend. The goal of this package is to have a quick start when configuring a new project using this stack. The output project has a basic and mainly used set of configurations.

Getting Started

Installing

To globally install the package:

npm install -g create-express-react-app

Now to create a new my-project app just run:

create-express-react-app my-project

This will create a my-project folder in the current path that contains all the files of the basic structure of the app. Inside the new created folder install the dependencies:

cd my-project
npm install

Usage

The project template provides the following scripts to create production build and dev environment:

# Production build served by Express
npm run start

# Production build (no server running)
npm run build

# Dev build with webpack-dev-server serving the front-end
npm run dev

# Dev build with webpack-dev-server serving the front-end and live reloading on backend
npm run watch

# Dev build (no live reload and no server running)
npm run debug

# Run the server
npm run server

What’s Included?

  • Babel: configured with @babel/preset-react and @babel/preset-env to transpile ES2015 code using core-js@3 to handle polyfills.
  • Webpack: project build is available for development mode in webpack.dev.js and for production mode in webpack.prod.js; options shared between them are defined in webpack.common.js config file. Such configurations allow to import:
    • js file: import App from './src/App';
    • css module: import css from './App.css';
    • base64 images: import myImage from '../public/icon.png';
  • Webpack-dev-server: a development server to test the frontend is available with live reloading feature enabled. It implements a proxy for the API requests that are sent to the backend URL to the Express server.
  • Nodemon: the backend code is live reloaded upon any changes with nodemon tool.

License

This project is licensed under the MIT License - see the LICENSE file for details

Acknowledgments

create-express-react-app's People

Contributors

luca1388 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.