- Boostrap
- Jquery
- Underscore.js (client)
- Node.js
- Express
- Underscore.js (server)
- Body-parser
- MongoDB
- Mongoose
-
Clone or fork this repo
$ git clone git@github.com:henryfreel/node-seed.git
-
cd
into the new directory$ cd node-seed
-
If you haven't already, Install Node & NPM
- Standalone installer: https://nodejs.org/download/
- Homebrew: http://blog.teamtreehouse.com/install-node-js-npm-mac
-
Install Homebrew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
-
Install node
brew install node
-
Install all the necessary modules
$ npm install
-
Run either
node server.js
,npm start
, ornodemon
(docs). All three commands do the same thing, which is start your server :)
Install MongoDB, a popular noSQL database.
1 First we'll need to run brew update to update our brew packages.
brew update
2 Next we'll need to run brew install
for MongoDB
brew install mongodb
3 Then we'll need a directory for MongoDB to save data.
sudo mkdir -p /data/db
4 Finally we'll want to make sure we have permission to read and write to this directory.
sudo chown -R $USER /data/db
- At this point, if you haven't already created the database you're using, do so in the terminal. You'll need to start up MongoDB by running:
$ mongod
Note: If you already have an instance of MongoDB running, you'll get an error at this step. If that's the case, you can move on to the next step, since MongoDB is already running!
- In a separate terminal tab, create and connect to your database. Name it whatever you'd like.
$ mongo
$ use [new-datebase-name]
Note: In the server.js file you will need to change '/mongo-seed', in the line below, to whatever you name your database
mongoose.connect("mongodb://localhost/mongo-seed");
- That's it! You're ready to go :)
|node-seed
- README.md
- index.js
- package.json
|public
|scripts
- scripts.js
|styles
- styles.css
|views
- index.html