Isomorphic web application starter running on Node.
- Client (frontend): React + Redux
- Server (backend): Express (web server) + MongoDB (object modelling using Mongoose)
The client consumes data from the server via a REST API.
- Automatically inject client-side changes to browser // Hot Module Replacement (HMR)
- Automatically restart server on server-side changes // nodemon
- Automatically run tests on code changes (+ display code coverage) // Jest
- Client and server side ES6 support // Babel.
- Production build script (minify and hash builds) // Webpack.
- Code quality (linting) // Prettier
- SASS
- Image loading / minification
- Clone/download repo
npm install
oryarn install
- Download and install MongoDB (Community Server).
- Rename
.env.example
to.env
and set properties to match your MongoDB URI and server URI.
Prerequisite - Make sure that MongoDB is running (mongod
).
npm run start-client-dev
- Build client continously (HMR enabled) serve @http://localhost:8080
npm run start-server-dev
- Restart server continously (nodemon enabled) serve @http://localhost:3000
npm run start-prod
- Builds client once (HMR disabled)
- Builds server once (nodemon disabled)
- App served @
http://localhost:3000
Command | Description |
---|---|
npm run build |
Build app (client + server) |
npm run build-client |
Build client (/dist/public/js/client.[hash].min.js ) |
npm run build-server |
Build server (/dist/server.min.js ) |
npm run clean-dist |
Clean dist, all files (client and server) |
npm run clean-dist-client |
Clean dist client files (/dist/public/* ) |
npm run clean-dist-server |
Clean dist server files (/dist/server.min.js ) |
npm run start-prod |
(see description above) |
npm run start-client-dev |
Build client continously (HMR enabled) serve @ http://localhost:8080 |
npm run start-server-dev |
Restart server continously (nodemon enabled) serve @ http://localhost:3000 |
npm run start-server-prod |
Start server once (nodemon disabled) serve @ http://localhost:3000 |
npm run test |
Run tests (once) |
npm run test-watch |
Run tests (continously), on source or test file changes. |
npm run lint |
Run prettier - JavaScript and SASS linter |
npm run start |
(alias of npm run start-server-prod ) |
Prerequisites
Make sure that Node and MongoDB are installed and running.
- Build app:
npm run build
- Copy / deploy
/dist/
to a folder on your server. - Run app:
npm run start-server-prod