TeamMoodGitHub / Noah-Term-1

0 stars 0 forks source link

Week 1 - Core Idea, Initial Research, and Environment Set Up #1

Open farzaa opened 7 years ago

farzaa commented 7 years ago

Universities have a TON of events every week and it can be tough to actually figure out whats going on and when. Facebook Events has helped a ton with this, but we still have the problem where you need to subscribed to a bunch of pages and groups to actually figure out whats going on.

This web app would aggregate all the events from all these pages (using a cron job) to get them all in one place in a nicely formatted way. This way, at a glance you can see whats going on at your university.

During this week, Noah will begin the research phase where he will figure out things like:

Other then researching, Noah will begin creating some really basic scripts that do things like pull events from the Facebook API and try and see if everything is possible and if there will be any bumps in the road. The main point of this week is to predict nay problem we may encounter.

While doing this, Noah will also spend time this week setting up his environment based on the technologies he chose from the research phase.

Lastly, it will be worth it list out the basic features an MVP should have by the end of Term 1, this is something I will work with Noah on.

Tasks

noah-guillory commented 7 years ago

Backend Libraries

For this project, I will be using Node.js with express for the backend. I mainly decided on Node because it is what I am most familiar with and have the most experience in using. Being that the backend is also written in Javascript is a plus so I don't have to be working with 2 different languages for the whole app.

For authentication, I plan on using passport.js with the Facebook strategy to link user accounts with their Facebook accounts. Since we will be pulling all our info about events from the user's events having this close link to their accounts will make it much easier to get that data.

Frontend Libraries

For the frontend of this project, I have decided that I will use Angular 2. I really have always liked the way that Angular 2 wants to you structure your projects so that components and services should be organized into modules that are organized as features. This pattern makes lots of sense to me and the use of services to provide data to components is fantastic as well. Working with TypeScript is also a fantastic cherry on top.

I have went and made a prototype application in both Angular 2 and React and I have to say that I vastly preferred the development experience when I made the React prototype. Everything went a lot faster than when I made it in Angular so I am going to change my mind and say that I will go with React for this project instead :)

Databases

This is something that I am kinda in between with. I think I should just use the Firebase real time database for this app but I don't know if I really need it. I don't have very much good experience figuring out how to model data that goes into a database but here's the things that I think I need to keep track of in whatever database that I use:

My thinking with using the real time database is that I will be able to, by using the Facebook API webhooks, give a user a real time view of things that are going on. And also by using Firebase I get push notifications for free as well which could be used to notify users of pages that have new events and such (this may not be in the scope of what I will be doing in these 8 weeks but it is a future functionality to think about in the future).

Server-less computing and cron jobs

I have found that the Facebook API has a lot of built in goodies, one of which is webhooks. The basic way it works is that I can subscribe to say a user's events or a page's events and when a page or a user gets a new event I can configure a webhook to send a POST request to say a Cloud Function or a microservice which can then push these updates down back to the frontend.

Because of these webhooks I won't really have to worry about cron jobs to keep up-to-date with the events that the user wants to keep track of which makes my job a whole lot easier. Just to keep with using more Firebase functionality I could even have a Cloud Function that gets called by a webhook add a record to the Firebase real time database so that the user's events gets updated in real time.

Facebook API

The Facebook Graph API is pretty simple and straightforward to use once I understood what exactly they meant by a "Graph API". The term graph API is very literal in that the API is arranged to work as a graph that has nodes and edges. Nodes are things like Users, Photos, and Events that have fields that contain data about those nodes. Edges, as one would expect, are the connections between those nodes such as a User's friends or a Photo's comments.

All of the endpoints in the API are structured with nodes and edges in mind which actually makes it very easy to find what data you're trying to capture pretty easy because everything is pretty connected.

Prototypes

As mentioned in the frontend section, I made prototypes in both Angular and React. Here are both of them hosted online and the source code for them. Angular: Live | Source React: Live | Source

They both look fairly similar and have the same functionality.

The user can login with Facebook by clicking the Login button and see the events in a list by clicking Get Events.

As I said before and even by just looking at the source code you can see how much more simpler the React version looks and just kinda comes together.