djizco / mern-boilerplate

A Full MERN Stack Boilerplate for Web Apps including a local authentication system. Uses React, Express.js, MongoDB, Redux, Passport.js, Webpack, Testing, and more.
MIT License
266 stars 94 forks source link
boilerplate bulma css eslint express jest mongodb mongoose nodejs passport ramda react redux webpack

MERN Boilerplate

MongoDB Express.js React.js Node.js

A Full MERN Stack Boilerplate for Web Apps. Includes a local authentication system using passport. User is given a simple profile with Full Name and Profile Picture. User is also able to reset password and username case.

NEW: For those of you who wish to separate the client and server into separate projects, I have created two repos that do just that! Check out MERN Client and MERN Server.

Requirements

Quick Start

Setup

npm install

# Install MongoDB
brew tap mongodb/brew
brew install mongodb-community

Start the database

brew services start mongodb-community

for Development

Start the client

npm run start:client

Start the server

npm run start:server

Or run client and server together

npm start

for Production

npm run build
npm start:server

Other Commands

npm start
npm test
npm run lint
npm run lint:fix
npm run test:verbose
npm run test:coverage
npm run test:watch-client
npm run test:watch-server

Setup Instructions

Note: This is now a github template project. This makes copying the contents of the project into a new repo very simple.

To setup your own project, you will need to copy the contents of this project into a new repo. You will need to update the content in these files to names of your project and yourself:

This is also a good time to go through the included libraries to add or remove features that you want.

After this you can commit the files into a new repository and push up to your github. You can now start updating files in your client to begin working on your own project!

Features

Code Structure

- client
  - api
  - assets
    - images
    - icons
  - components
    - pages
    - environment
  - hooks
  - store
    - actions
    - reducers
    - thunks
    - tests
  - styles
  - utils
- server
  - config
  - database
  - routes
- scripts

Technologies

React - View Library

Redux - State Manager

Webpack - Module Bundler

Express - Node Application Framework

MongoDB - Document Database

Mongoose - MongoDB Framework

Passport - Authentication Framework

React Notifications Component - Notification System

Material-UI - React Component Library

Bulma - CSS Framework

React Bulma Companion - Bulma Component Library

FontAwesome - Icons

Ramda - Functional Library

date-fns - Date Functions Library

SuperAgent - HTTP Request Library

ESLint - Code Linter

Jest - Testing Framework