Skip to content

Commit c469011

Browse files
author
Robert Herley
committed
readme & more cleanup
1 parent 8dee3ac commit c469011

File tree

4 files changed

+32
-29
lines changed

4 files changed

+32
-29
lines changed

README.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# simple-react-starter
2+
3+
⚛️ An extremely slim boilerplate for a React/Express project.
4+
5+
## Including:
6+
7+
- React 16
8+
- Express
9+
- Webpack 4 (+ Dev Server, Hot Reload)
10+
- Babel 7 (+ Plugins)
11+
- ESLint (+ precommit hooks w/ Husky)
12+
- Prettier
13+
- Simple Dockerfile
14+
15+
## How To Use
16+
17+
- For development, use the following scripts:
18+
- Launch Nodemon with ESLint for the Backend: `npm run dev:backend`
19+
- Launch Webpack Dev Server for Frontend: `npm run dev:frontend`
20+
- Or, launch both concurrently with: `npm run dev`
21+
- For production:
22+
- Lint and Build with `npm run build`
23+
- Serve the built files in `/dist` with `npm start`
24+
- Or, build the docker container

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
"version": "1.0.0",
44
"description": "A no-nonsense boilerplate for a react SPA.",
55
"scripts": {
6-
"start": "node server.js",
6+
"start": "NODE_ENV=production node server.js",
77
"dev": "concurrently -n 'F,B' -c 'magenta,blue' 'npm run dev:frontend' 'npm run dev:backend'",
88
"dev:frontend": "webpack-dev-server --mode development --hot",
9-
"dev:backend": "nodemon server.js --exec 'eslint . && node --no-deprecation'",
10-
"build": "webpack --mode production --display-error-details",
9+
"dev:backend": "nodemon server.js --exec 'npm run lint && node'",
10+
"build": "npm run lint && webpack --mode production --display-error-details",
1111
"precommit": "lint-staged",
1212
"lint": "eslint ."
1313
},
@@ -24,7 +24,7 @@
2424
"author": {
2525
"name": "Rob Herley",
2626
"email": "[email protected]",
27-
"url": "https://robherley.me"
27+
"url": "https://robherley.xyz"
2828
},
2929
"license": "ISC",
3030
"devDependencies": {
@@ -69,7 +69,7 @@
6969
"@babel/polyfill": "^7.0.0-beta.51"
7070
},
7171
"lint-staged": {
72-
"*.{js,json,css}": [
72+
"*.{js,jsx}": [
7373
"eslint --fix",
7474
"git add"
7575
]

server.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ app.use(morgan('dev')); // logging
1414
app.use(compression()); // gzip
1515
app.use(express.json()); // process post json
1616

17-
// Add API routes
18-
app.use(routes);
19-
2017
// Serve static folder
2118
app.use(express.static(path.join(__dirname, contentPath)));
2219

20+
// Add API routes
21+
app.use(routes);
22+
2323
app.listen(port, () => {
2424
// eslint-disable-next-line no-console
2525
console.log(`🌋 Listening on port: ${port}`);

todo.md

-21
This file was deleted.

0 commit comments

Comments
 (0)