Need help with react-expressjs?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

tahnik
211 Stars 74 Forks MIT License 54 Commits 5 Opened issues

Description

Simple and compact boilerplate for ReactJS project with expressJS

Services available

!
?

Need anything else?

Contributors list

# 149,454
React
react-r...
Redux
Electro...
41 commits
# 375,389
HTML
React
react-r...
Redux
2 commits
# 260,776
OCaml
React N...
React
reasonm...
1 commit
# 172,591
Express
React
Babel
CSS
1 commit
# 147,732
CSS
React
HTML
Redux
1 commit

Behold the ReactJS + ExpressJS Boilerplate

I wrote an article about this repo which explains the structure.

This is a boilerplate to use ReactJS, ExpressJS, Redux and React Router v4 in a project.

  • ReactJS - The state based framework for your Views
  • React Router v4 - For routing to different paths
  • Redux - Redux manages your state
  • Babel - The compiler to compile your JS files with es6, es7, JSX syntax to regular javascript
  • Webpack - The module binder which takes all your JS files from different directories and compiles them into a single app.bundle.js (you can change the filename of course) so you can include it in a HTML page
  • ExpressJS - The node framework to serve your views to the world when they hit the server at example.com or example.com/awesome.html

Installation

Node Version: v9.0.0^

Just clone this repo or download the zip file.

cd
into the directory and run
npm install

Developing App with Hot Reload

To develop your own react application, you can take advantage of React Hot Loader and Webpack Dev Server. To develop app with hot reload:

npm run dev

Now you can access your react application on http://localhost:8080

Production build and Deploy

To make a production build of your project, run the following commands

npm run build

This will create create two files:

index.js
in
server/public/js
and
server.js
in
server/bin
.

server.js
will be used for serving the application on port 3000 and
index.js
is the actual react app itself.

Finally run

npm start

The you will be able to access this app from http://localhost:3000.

To get a distributable tarball of your application, run this command

npm pack

Remember that you have to run

npm run build
before doing this. This will create a tar.gz file in your root folder. The contents in this file is deployable. All you need to do is copy the contents inside package folder inside this tar.gz file to your server and run the app with something like pm2.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.