Merge remote-tracking branch 'origin/master'
* origin/master: Specified npm versions instead of latest (*) Update README.md Update Project Strcuture Add more client-side/Node libs, todo, screencast Conflicts: README.md
This commit is contained in:
33
README.md
33
README.md
@ -1,5 +1,5 @@
|
||||

|
||||
Hackathon Starter
|
||||
Hackathon Starter [](https://david-dm.org/sahat/hackathon-starter)
|
||||
=================
|
||||
A kickstarter for **Node.js** web applications.
|
||||
|
||||
@ -31,7 +31,7 @@ Features
|
||||
--------
|
||||
- **Local Authentication** using Email and Password
|
||||
- **OAuth 2.0 Authentication** via Twitter, Facebook, Google or GitHub
|
||||
- Error and Success flash notifications
|
||||
- Sweet Error and Success flash notifications with animations by *animate.css*
|
||||
- MVC Project Structure
|
||||
- LESS stylesheets (auto-compiled via Express middleware)
|
||||
- Bootstrap 3 + Flat UI + iOS7 Theme
|
||||
@ -39,7 +39,7 @@ Features
|
||||
- **Account Management**
|
||||
- Profile Details
|
||||
- Change Password
|
||||
- Link OAuth 2.0 strategies
|
||||
- Link multipleOAuth 2.0 strategies to one account
|
||||
- Delete Account
|
||||
- **API Examples**: Facebook, Foursquare, Last.fm, Tumblr, Twitter, and more.
|
||||
|
||||
@ -52,6 +52,7 @@ Prerequisites
|
||||
**Note**: If you are new to Node.js or Express framework,
|
||||
I highly recommend watching [Node.js and Express 101](http://www.youtube.com/watch?v=BN0JlMZCtNU) screencast that teaches Node and Express from scratch.
|
||||
|
||||
|
||||
Getting Started
|
||||
---------------
|
||||
|
||||
@ -75,7 +76,7 @@ node app.js
|
||||
> **Note**: I strongly recommend installing nodemon `sudo npm install -g nodemon`.
|
||||
> It will monitor for any changes in your node.js
|
||||
> application and automatically restart the server. Once installed, instead of `node app.js` use `nodemon app.js`.
|
||||
> It's a big time saver in the long run.
|
||||
> It is a big time saver in the long run.
|
||||
|
||||
Next up, if you want to use any of the APIs or OAuth2 authentication methods, you will need to obtain
|
||||
appropriate credentials: Client ID, Client Secret, API Key, or Username & Password. You will
|
||||
@ -111,6 +112,29 @@ Obtaining API Keys
|
||||
|
||||
*TODO: Add Twitter and GitHub instructions.*
|
||||
|
||||
Project Structure
|
||||
-----------------
|
||||
|
||||
| Name | Description |
|
||||
| ------------- |:-------------:|
|
||||
| **config**/passport.js | Passport Local and OAuth strategies + Passport middleware. |
|
||||
| **config**/secrets.js | Your API keys, tokens, passwords and database URL. |
|
||||
| **controllers**/api.js | Controller for /api route and all api examples. |
|
||||
| **controllers**/contact.js | Controller for contact form. |
|
||||
| **controllers**/home.js | Controller for home page (index).
|
||||
| **controllers**/user.js | Controller for user account management page. |
|
||||
| **models**/User.js | Mongoose schema and model for User. |
|
||||
| **public/*** | Static assets, i.e. fonts, css, js, img. |
|
||||
| **views/account** | Templates relating to user account. |
|
||||
| **views/api** | Templates relating to API Examples. |
|
||||
| **views**/layout.jade | Base template. |
|
||||
| **views**/home.jade | Home page template. |
|
||||
|
||||
|
||||
**Note:** There is no difference how you name or structure your views. You could place all your templates in a top-level `views` directory without having a nested folder structure, if that makes things easier for you. Just don't forget to update `extends ../layout` and corresponding `res.render()` method in controllers. For smaller apps, I find having a flat folder structure to be easier to work with.
|
||||
|
||||
**Note 2:** Although your main template - **layout.jade** only knows about `/css/styles.css` file, you should be editing **styles.less** stylesheet. Express will automatically generate **styles.css** whenever there are changes in LESS file. This is done via [less-middleware](https://github.com/emberfeather/less.js-middleware) node.js library.
|
||||
|
||||
Useful Tools
|
||||
------------
|
||||
[HTML to Jade converter](http://html2jade.aaron-powell.com)
|
||||
@ -151,6 +175,7 @@ TODO
|
||||
----
|
||||
- Pages that require login, should automatically redirect to last attempted URL on successful sign-in.
|
||||
- Add more API examples.
|
||||
- Mocha tests.
|
||||
|
||||
Contributing
|
||||
------------
|
||||
|
51
package.json
51
package.json
@ -2,31 +2,30 @@
|
||||
"name": "hackathon-starter",
|
||||
"version": "0.0.0",
|
||||
"dependencies": {
|
||||
"async": "*",
|
||||
"bcrypt": "*",
|
||||
"cheerio": "*",
|
||||
"connect-flash": "*",
|
||||
"express": "*",
|
||||
"express-validator": "*",
|
||||
"less-middleware": "*",
|
||||
"request": "*",
|
||||
"jade": "*",
|
||||
"mongoose": "*",
|
||||
"underscore": "*",
|
||||
"passport": "*",
|
||||
"passport-oauth": "*",
|
||||
"passport-local": "*",
|
||||
"passport-github": "*",
|
||||
"passport-facebook": "*",
|
||||
"passport-twitter": "*",
|
||||
"passport-google-oauth": "*",
|
||||
|
||||
"lastfm": "*",
|
||||
"github-api": "*",
|
||||
"sendgrid": "*",
|
||||
"tumblr.js": "*",
|
||||
"twit": "*",
|
||||
"fbgraph": "*",
|
||||
"node-foursquare": "*"
|
||||
"async": "~0.2.10",
|
||||
"bcrypt": "~0.7.7",
|
||||
"cheerio": "~0.13.1",
|
||||
"connect-flash": "~0.1.1",
|
||||
"express": "~3.4.8",
|
||||
"express-validator": "~1.0.1",
|
||||
"fbgraph": "~0.2.8",
|
||||
"github-api": "~0.7.0",
|
||||
"jade": "~1.1.5",
|
||||
"lastfm": "~0.9.0",
|
||||
"less-middleware": "~0.1.15",
|
||||
"mongoose": "~3.8.5",
|
||||
"node-foursquare": "~0.2.0",
|
||||
"passport": "~0.2.0",
|
||||
"passport-facebook": "~1.0.2",
|
||||
"passport-github": "~0.1.5",
|
||||
"passport-google-oauth": "~0.1.5",
|
||||
"passport-local": "~0.1.6",
|
||||
"passport-oauth": "~1.0.0",
|
||||
"passport-twitter": "~1.0.2",
|
||||
"request": "~2.33.0",
|
||||
"sendgrid": "~0.4.6",
|
||||
"tumblr.js": "~0.0.4",
|
||||
"twit": "~1.1.12",
|
||||
"underscore": "~1.5.2"
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user