Slide notes from Desert Code Camp 2014. This talk focuses on using the MEAN Stack to build an app that uses Facebook authentication for access, demonstrates advanced permissions for reading an authenticated user's Facebook data, and generating a data visualization using the D3.js library and custom Angular directives.
5. The problem.
Participants competing in a challenge log meals, workouts and health data into a private Facebook group
Facebook newsfeed algorithm
No reporting
Don’t want to lose demographics
Can we use existing frameworks to make it
better without losing the parts that work well?
27. Aggregation : Quick Review
Pipeline for multiple stages of document transformations for producing aggregated results
Name Description
$project Reshapes a document stream. $project can rename, add, or remove fields as well as create
computed values and sub-documents.
$match Filters the document stream, and only allows matching documents to pass into the next
pipeline stage. $match uses standard MongoDB queries.
$limit Restricts the number of documents in an aggregation pipeline.
$skip Skips over a specified number of documents from the pipeline and returns the rest.
$unwind Takes an array of documents and returns them as a stream of documents.
$group Groups documents together for the purpose of calculating aggregate values based on a
collection of documents.
$sort Takes all input documents and returns them in a stream of sorted documents.
$geoNear Returns an ordered stream of documents based on proximity to a geospatial point.
36. Directives are just reusable pieces of code
Restrict where the
directive can be used
A/E/C
Scope refers to the type of isolated scope:
= two way data binding with the parent DOM object
@ one way data binding with the parent DOM object
& expression binding with the parent DOM object
37. link is basically
a controller
variables either specified
on declaration or use
defaults
40. Where do we go from here?
Add new
aggregation queries
to journals controller
Build new reports/d3
visualizations in
directives.js
Add directives to any page:
<d3-bars data="d3Data”></d3-bars>
41. The mistakes people I
make.
Request the right
Facebook
permissions
Setup your
Facebook
Developers Account
Make your Facebook app
public (at least for a few
minutes)
Facebook Graph
Explorer
Hardcode dummy
data first.
Don’t assume
.success(), wait for it
.then()