Directions and how things work:
Step 1: in command line -> sudo npm install (this will create the node_modules folder)
Step 2: You'll need to install MongoDB on your mac. There is an installer. Should be easy.
Step 3: After installing, run in command line -> sudo mongod -> Keep this terminal open as that initiates the database.
Step 4: Create config.json with MONGO_DB, NODE_ENV, PORT Example:
{ "MONGO_DB" : "mongodb://localhost/test", "NODE_ENV" : "development", "PORT" : "3000"
}
Layout of project:
-
ReactViews act as client rendering. Create new files in src. jsx src build --watch to link into build.
-
Models include all mongoose models that will be used in index.js
-
node index.js to run server. will be in localhost:3000
-
templates are used server side to render views. The specific one I'm using is called handlebars (.hbs) (instead of html)
-
public folder includes libs, imgs, stylesheets.
To style project:
- First style individual components in client/src.
- Create a site wide styling if needed in public/styles. -> you can link this style to the whole website by going into templates/layouts/main.hbs and adding the style link there