| apis | ||
| config | ||
| controllers | ||
| emails | ||
| lib | ||
| models | ||
| public | ||
| test | ||
| views | ||
| .bowerrc | ||
| .gitignore | ||
| app.js | ||
| bower.json | ||
| cluster_app.js | ||
| Dockerfile | ||
| Gulpfile.js | ||
| humans.txt | ||
| LICENSE | ||
| package.json | ||
| Procfile | ||
| README.md | ||
| robots.txt | ||
| server.js | ||
GeoDocs
- Based on the MEAN Coffee Starter.
Features
- Users
- Map
- Stash
- Collaboration
Minimum Browsers Requirements based on libraries: IE9+, and latest for Chrome, Firefox, and Safari.
Development Needs
- NodeJS >0.10.x installed. I recommend a node version system such as NVM.
- Bower and Grunt packages installed globally via NPM, and accessible via command line.
- MongoDB >2.6 installed.
Obtaining API Keys
- Visit [Google Cloud Console](https://cloud.google.com/console/project)
- Click **CREATE PROJECT** button
- Enter *Project Name*, then click **CREATE**
- Then select *APIs & auth* from the sidebar and click on *Credentials* tab
- Click **CREATE NEW CLIENT ID** button
- **Application Type**: Web Application
- **Authorized Javascript origins**: http://localhost:3000
- **Authorized redirect URI**: http://localhost:3000/auth/google/callback
- Copy and paste *Client ID* and *Client secret* keys into `config/oauth_keys.js`
❗ Note: When you ready to deploy to production don't forget to
add your new url to Authorized Javascript origins and Authorized redirect URI,
e.g. http://my-awesome-app.herokuapp.com and
http://my-awesome-app.herokuapp.com/auth/google/callback respectively.
The same goes for other providers.
- Sign in at [LinkedIn Developer Network](http://developer.linkedin.com/)
- From the account name dropdown menu select **API Keys**
- *It may ask you to sign in once again*
- Click **+ Add New Application** button
- Fill out all *required* fields
- For **Default Scope** make sure *at least* the following is checked:
- `r_fullprofile`
- `r_emailaddress`
- `r_network`
- Finish by clicking **Add Application** button
- Copy and paste *API Key* and *Secret Key* keys into `config/oauth_keys.js`
- *API Key* is your **clientID**
- *Secret Key* is your **clientSecret**
Recommended Libraries and Tools
- Server (or both)
- Node Inspector - Node.js debugger based on Chrome Developer Tools.
- Filesize.js - Pretty file sizes, e.g.
filesize(265318); // "265.32 kB". - Numeral.js - Library for formatting and manipulating numbers.
- Moment.js - Date parsing library.
- Node-UUID - RFC 4122 UUID Generator
- Client
- Font Awesome Icons
- selectize.js - Similar to Chosen, Select 2, et al. Textbox/Select hybrid.
Useful Resources
- CoffeeScript - Main coffeescript site.
- Jade Syntax Documentation by Example - Even better than official Jade docs.
- JS to CoffeeScript converter - When moving over to CoffeeScript, this can be very useful.
- HTML to Jade converter - When sniping html snippets, this can be a time saver.
- JavascriptOO - A directory of JavaScript libraries with examples, CDN links, statistics, and videos.
- JS Recipes - JavaScript tutorials for backend and frontend development.
Recommended Design Resources
- Bootsnipp - Code snippets for Bootstrap.
- UIBox - Curated HTML, CSS, JS, UI components.
- Bootstrap Zero - Free Bootstrap templates themes.
- Colors - A nicer color palette for the web.
- Creative Button Styles - awesome button styles.
- Creative Link Effects - Beautiful link effects in CSS.
- Medium Scroll Effect - Fade in/out header background image as you scroll.
Mongoose Cheatsheet
Find all users:
User.find(function(err, users) {
console.log(users);
});
Find a user by email:
var userEmail = 'example@gmail.com';
User.findOne({ email: userEmail }, function(err, user) {
console.log(user);
});
Find 5 most recent user accounts:
User
.find()
.sort({ _id: -1 })
.limit(5)
.slaveOk()
.lean()
.exec(function(err, users) {
console.log(users);
});
Get total count of a field from all documents:
Let's suppose that each user has a votes field and you would like to count the total number of votes in your database accross all users. One very inefficient way would be to loop through each document and manually accumulate the count. Or you could use MongoDB Aggregation Framework instead:
User.aggregate({ $group: { _id: null, total: { $sum: '$votes' } } }, function(err, votesCount) {
console.log(votesCount.total);
});
License
Commercial License is Copyright (c) 2014 by Citadel Software
Any use of this code other than indicated by a Citadel Software Representative is explicitely not allowed. No permissions are granted to any person(s) obtaining this software through any means other than indicated by contract with Citadel Software.
All utilized software herein is licensed in such a manner that this license complies with those.