NEW:
Run webpack --watch -> node index.js Hot loading? -> run webpack --config webpack.config.dev.js -> node devServer.js In progress: refactor into server folder (express router) In progress: refactor client into alt + react
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.
Layout of project:
-
ReactViews act as client rendering. Create new files in src -> babel ReactViews/src/ --watch --out-dir ReactViews/build/ (old: 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 ReactViews/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
- Don't do any sort of positioning just yet.