GithubHelp home page GithubHelp logo

djizco / mern-boilerplate Goto Github PK

View Code? Open in Web Editor NEW
257.0 6.0 91.0 337 KB

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.

License: MIT License

JavaScript 94.35% HTML 0.30% SCSS 4.04% Shell 0.84% CSS 0.48%
react redux webpack css bulma ramda passport mongodb eslint boilerplate

mern-boilerplate's Introduction

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

  • Operating System: MacOS or Linux
  • Node.js (I recommend installing with NVM)
  • Homebrew (to install MongoDB)

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:

  • package.json: name, version, description, repository, author, bugs, homepage
  • LICENSE: (update to your preferred license)
  • client/index.html: description and title
  • this README.md

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

  • Webpack conveniently bundles your code for you.
  • Babel lets you use ES6/7 features.
  • CSS pre-processor setup for LESS and SASS lets you keep your styles clean and organized.
  • ESLint helps you maintain a high level of code quality.
  • Jest gives you a robust testing framework to make sure your code works.

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

mern-boilerplate's People

Contributors

djizco avatar omers4 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

mern-boilerplate's Issues

Need to incorporate shortid for users

Not a bug. But how would I go about adding shortid to the mongodb. I need my users to have a stream key for my site which is generated on registration.

Bit of a beginner with Mern stack but willing to learn :)

I have this working in my site now but this looks like a better user profile option for me.

Thanks

Dependency issue - nom install

npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   react@"^16.14.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^17.0.1" from [email protected]
npm ERR! node_modules/react-notifications-component
npm ERR!   react-notifications-component@"^3.1.0" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.```

Dependency issue while running rpm install. 

useKeypress != useKeyPress

running yarn run dev in a current clone of master will fail due to
client/hooks/useKeypress.js
it should be renamed client/hooks/useKeyPress.js

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.