
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
create-express-react
Advanced tools
Get started with create-react-app and your own express server for development and production.
First of all, you should install create-express-react via npm as a global package, this is the CLI to generate the template for you to get started.
npm install create-express-react -g
Once you have create-express-react, then run it to create the template. The command below will generate a folder named myApp in Desktop.
cd ~/Desktop
create-express-react myApp
Then you need to grab create-react-app by running:
cd ~/myApp
npm install
npm run setup
Finally, you can start your app:
npm start
There are a lot of pre-written npm scripts to help you speed up the development and deployment process.
npm run setupUsing official create-react-app to generate a folder root/frontend for all frontend development. Also adding the proxy setting in root/frontend/package.json to pass request to express server.
npm run startConcurrently starting webpack-dev-server for react running on port 3000, and express backend server on port 4000. HOC will be enabled for all react related code and also the server will be restarted by nodemon if there is any change made for the backend code.
npm run test-serverRunning server tests via Jest, which are in root/server/__test__
npm run test-reactRunning react tests via Jest. There is no test file by default, you may create a folder /root/frontend/__test__ and put all test files there.
npm run lintRun ESLint on all backend code. The config files can be found in root/.eslintrc and root/.eslintignore. Please note that the linting for react will be auto-enabled when you run npm run start
npm run buildBuild all the server side code into root/dist, then build react and move all built files (index.html, javascript, css, images, etc.) to root/dist/public for production
npm run deployDeploy the server via pm2, you can find the config file in root/deploy.json.
There are also some helper npm scripts, see more details in root/package.json.
For Development, the webpack-dev-server is running on port 3000 serving react app, and the backend express server is running on port 4000. All of the requests sent by frontend app will be passed to express server via proxy.
Web App <--- Webpack-dev-server <---> Proxy <---> Express Server
For Production, all the frontend code will be compiled and moved into a static directory inside express server. Now there is just one express server running, which is serving both the frontend app and backend endpoints.
Endpoints <--- Express Server ---> Web App
TBD
root/frontend?Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
We use SemVer for versioning. For the versions available, see the tags on this repository.
This project is licensed under the MIT License.
FAQs
create template for create-react-app and express
We found that create-express-react demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.