A simple boilerplate for creating Web Applications involving React, Express, Node, and MongoDB
-
Install Node.js
-
Install MongoDB
brew install mongodb
(If you have Homebrew) -
Copy the Project Repo into your own directory
git clone [email protected]:alexander-lee/MERN-boilerplate-lite.git
-
Install all the Dependencies
npm install
-
Install Gulp globally
npm install -global gulp-cli
-
Start the Node Server
npm start
orgulp
-
Create a Directory for MongoDB to live in (Create the folder data/db at your root).
mkdir -p /data/db
-
Make sure your directory has the right permissions
chmod 0755 /data/db && sudo chown $USER /data/db
-
Create a Database (if you didn't make one yet)
mongo
use sampledb
-
Add your Database to the configuration file (config.js)
-
Before you start the Node Server, start your Mongo Process
mongod --dbpath /data/db
- /bin holds the Server Script (Don't Touch)
- /public holds static/public files
- /client is your Front-End (Client-side) React Components
- /models holds all of your MongoDB models
- /routes holds all of our Backend Routing
- /styles is where you write your Sass (SCSS) files
- /views is where you write your .ejs files (Including CDN scripts)