Skip to content
/ mern-template Public template

MERN boilerplate generator. Mongo, Express, React, Node web app.

License

Notifications You must be signed in to change notification settings

kaxi1993/mern-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mern-template

npm version codecov Known Vulnerabilities npm

mern-temlate is a cli tool for generating isomorphic and modular mongo, express, react and node web app. The project is based on the best practices and popular tools. This is not just a simple starter that generates only the folder structure, but a real example of a production ready web application.

Table of contents

Visualization

alt text

Installation

npx mern-template my-app

or

npm install mern-template -g
mern-template my-app

Run Project

cd my-app
npm install
npm start

or

cd my-app
docker-compose up

Project Structure

|__ bin
|__ client
|__ config
|__ public
|__ server
|.. docker-compose.yml
|.. Dockerfile
|.. Dockerfile-development
|.. jest.config.js
|.. package.json
|.. process.json
|.. project.config.js
|.. webpack.common.js
|.. webpack.dev.js
|.. webpack.prod.js

bin

bin folder contains file named www from where we start express server and connect to mongodb.

config

I use dotenv to load environment variables. If NODE_ENV is development or test, environment variables are loaded from config/.development and config/.test files relatively. In production it is better to enter all your environment variables from console. It isn't good idea to upload environment variables on github.

client

client folder contains react code. I use redux and redux-saga for state management, react-router-dom to handle client side routing and material-ui as a UI framework. I use scss preprocessor with bem methodology.

public

public folder contains static assets.

server

server side code has following structure:

|__ server
    |__ auth
    |__ tasks
    |__ users
    |.. app.js
    |.. db.js
    |.. routes.js

and each module looks like this:

|__ tasks
    |__ __tests__
    |.. index.js
    |.. task-controller.js
    |.. task-model.js
    |.. task-validation.js

I use jest for testing, joi for validation, passport-jwt for authentication, mongoose driver for mongodb and signale for logging.

License

Copyright (c) 2019 Lasha Kakhidze. This code is released under the MIT license.


About

MERN boilerplate generator. Mongo, Express, React, Node web app.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 3

  •  
  •  
  •  

Languages