Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Final Project Feedback #208

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// General comments that apply to the whole tree of docs pertains to logging. Remove all
// log statements in both server and frontend
var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
Expand Down Expand Up @@ -80,6 +82,7 @@ app.use(function(req, res) {
var mongoURI = process.env.MONGO_URI;
mongoose.connect(mongoURI);

// What happens for local deployment? Do you handle that -- getting a mongo connect error on local testing
var db = mongoose.connection;
db.on('error', console.error.bind(console, 'connection error:'));
db.once('open', function() {
Expand Down
2 changes: 2 additions & 0 deletions public/javascripts/d3Controller.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Very nice work on the d3 vizualizations

//Controller to show and create vizs based on data on a specific student
var d3Controller = function($scope, $http, $state) {

Expand Down
3 changes: 2 additions & 1 deletion public/javascripts/ngApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ springInitiative.config(function($stateProvider, $urlRouterProvider,
$locationProvider) {

$urlRouterProvider.otherwise('/');

// I love state provider
$stateProvider

/* Page views */
Expand Down Expand Up @@ -124,6 +124,7 @@ springInitiative.config(function($stateProvider, $urlRouterProvider,

});

// Include commenting please here
springInitiative.run(function($rootScope, $state, $http) {
$rootScope.$on('$stateChangeStart', function(event, next, current) {
$http.get('/user').then(function(data) {
Expand Down
2 changes: 2 additions & 0 deletions public/javascripts/studentControllers.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Nothing is commeneted...

//controller to deal with current student functions such as deleting, adding entries, etc.
var studentController = function($scope, $http, $state) {

Expand Down
1 change: 1 addition & 0 deletions public/views/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ <h2 class="form-signin-heading">Please sign in</h2>
<span ng-show="password_error" class="help-block">{{password_error}}</span>
</div>
<div class="alert alert-info" ng-show="verification_alert">
<!-- Haha href not working here, folks! -->
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
A verification email for {{email}} is now pending admin(s) and your approval.
</div>
Expand Down
3 changes: 2 additions & 1 deletion routes/entryRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ routes.GETcohortEntries = function(req, res) {
var engageContentList = [];
var engagePeerList = [];
var engageAdultList = [];


// What's the purpose of archived here?
Student.find({program:cohort, archived: false}, function(err, students){
var studentIds = students.map(function(student){return student._id;});
FormDB.find({_studentID:{$in:studentIds}}, function(err, forms) {
Expand Down
3 changes: 3 additions & 0 deletions routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
var path = require('path');
var routes = {};

// As a general note: each method in your API routes files should have documentation as to what it does
// and are the relevant requests and responces.

var userRoutes = require(path.join(__dirname, './userRoutes'));
var studentRoutes = require(path.join(__dirname, './studentRoutes'));
var entryRoutes = require(path.join(__dirname, './entryRoutes'));
Expand Down
3 changes: 3 additions & 0 deletions routes/userRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ var sendgrid = require('sendgrid')(process.env.SENDGRID_USERNAME,

var User = require(path.join(__dirname, '../models/user'));

// Is the password being encrypted appropriately here? bcrypt-nodejs and scrypf (verifyKdfSync etc.) not a bad library to accompish this
routes.POSTlogin = function(req, res, next) {
passport.authenticate('local', function(err, user, info) {
if (err)
Expand Down Expand Up @@ -39,6 +40,7 @@ routes.POSTregister = function(req, res, next) {
if (err) return res.status(403).send(err.message);

// Get admin emails
// I really like the use of smart mongoose syntax in filtering
User.find({isAdmin: true}, {email: 1, _id: 0}, function(err, admins) {
// send email verification to admins
var half = user.authToken.length / 2;
Expand All @@ -53,6 +55,7 @@ routes.POSTregister = function(req, res, next) {
email.addTo(admins[i].email);
}

// That was sweet. Sendgrid looks super interesting and easy touse
email.setFrom('[email protected]');
email.setSubject(user.email + ' wants to register for Spring Initiative\'s website.');
email.setHtml('<a target=_blank href=\"' + authenticationURL +
Expand Down