No description
Find a file
2017-01-22 23:07:04 -06:00
apis RESTful Representer no long global. 2016-04-09 15:25:40 -05:00
config A very extensive change to promises. For most everything. 2016-04-09 00:58:15 -05:00
controllers Update 2017-01-22 23:07:04 -06:00
emails Email updates. Fixing some minor bugs with collaborators. 2015-12-07 18:11:28 -05:00
lib RESTful Representer no long global. 2016-04-09 15:25:40 -05:00
models Making files work more smartly between collaborators. 2016-04-09 14:46:52 -05:00
public Existing subscription updates. 2016-04-09 15:07:51 -05:00
test No karma, but mocha is getting a bump. 2014-12-15 15:31:40 -06:00
views Remove oauth links. 2016-12-09 21:51:08 -06:00
.bowerrc The whole initial rewrite from Hackathon Starter 2.0 to MEAN Coffee Starter. 2014-04-18 16:14:42 -05:00
.gitignore Removing all compiled assets from being pushed, now that keeper is in place. 2015-03-07 08:47:40 -06:00
app.js RESTful Representer no long global. 2016-04-09 15:25:40 -05:00
bower.json update 2015-08-17 23:05:25 -05:00
cluster_app.js The whole initial rewrite from Hackathon Starter 2.0 to MEAN Coffee Starter. 2014-04-18 16:14:42 -05:00
Dockerfile Working towards promisification. 2016-04-08 22:04:10 -05:00
Gulpfile.js No more grunt. Updating to a newer version of node. 2016-04-08 01:14:25 -05:00
humans.txt boilerplate... 2014-12-10 15:10:27 -06:00
LICENSE License and read me update. 2014-04-18 17:58:05 -05:00
package.json Working towards promisification. 2016-04-08 22:04:10 -05:00
Procfile Added winston, logger is now a global. 2014-04-18 17:54:09 -05:00
README.md Readme update. 2015-02-05 19:02:58 -06:00
robots.txt boilerplate... 2014-12-10 15:10:27 -06:00
server.js Opsworks File. 2015-02-05 14:09:57 -06:00

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**

Useful Resources

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.