Git Product home page Git Product logo

rotten-tube's Introduction

RottenTube

A group programming project in the course Distributed Systems COMP30220, University College Dublin. The aim of the project was to develop a system that utilises distributed technologies. For this project we chose to use REST and GraphQL. The project that we picked was to create a concept Rotten Tomatoes for YouTube channels.

Example usage of the site

Architecture

RottenTube is a 3 tier application. At the bottom is a MySQL server hosted on Amazon Web Services RDS. On top of that is a REST web service and a GraphQL server. Finally the consuming application is a prototype web app that speaks to both REST and GraphQL. In this project are 4 sub folders, each corresponding to the 4 previously mentioned tiers.

System Architecture

Team members

Files and folders

  • docs: Contains other documentation such as assignment description.
  • graphql: Contains code for the GraphQL server layer.
  • mysql: Contains any files we may need regarding the MySQL database, table definition, scripts, etc.
  • rest: Contains code for the REST API.
  • website: Code for the React front-end web app.
  • .gitignore: A file that tells Git what files we don't want to submit to the repository. For details see here.

rotten-tube's People

Contributors

jonrh avatar radha13 avatar brettji avatar zyifei avatar

Watchers

 avatar James Cloos avatar  avatar  avatar

rotten-tube's Issues

Update example data in database

The file dbtables.sql contains the the structure of the database tables along with some sample data.

  • You Suck at cooking and How to cook that is defined two times as an example data, make sure we only have one of each.
  • Most recent example data is missing rating. Some sample ratings would be very nice.
  • Example channel names and URLs are names to specific videos. Update with channel names and URLs instead.
  • Insert the newly cleaned up example data to the database. Me and @brettji previously used 0xDBE.

Set up AWS RDS MySQL

For the database of this project we'll use AWS RDS MySQL.

Table schema

  • ID, auto incrementing integer
  • name, string

Tasks

  • Create a AWS RDS MySQL instance
  • Figure out how authentication works
  • Create the table names
  • Insert 3 names into the table: "Jill", "Jón", and "Yifei"
  • Figure out how to use Node environment variables to store authentication credentials (so we don't commit them to the repository)
  • Fetch those 3 names from JavaScript code

Finish basic web app functionality

The web app is coming along decently although time is getting very tight. Some corner have been cut. Here are the things that remain to get the basic functionality running:

  • Fetch a list of videos in categories. I think it'd simply be best to do 3 manual/hard coded calls to fetch from the 3 categories.
  • Wire the results from the above call in the FrontPage component.
  • Once on a specific channel, fetch REST for that channel ID, then fetch all reviews for that channel ID.
  • Wire fetched data into React components
  • Write logic so we can post reviews for a channel.

Set up a development environment

I think WebStorm 11 might be the best fit for us. It's fresh of the press with ES2015 syntax support and we as UCD students get it for free.

Todo:

  • set up WebStorm and node.js on all 3 computers
  • create a ES6 Babel bootstrap project
  • bootstrap a React application that displays some text
  • create node.js projects with some ES6 code

Have the React app interact with the "name" API

Get the React web app to communicate with the REST and GraphQL API using the names resource. Each of the tasks below will involve some UI work as well. First we should start with REST as it's what I'm familiar with. After that do the same but for GraphQL.

Note that this issue depends on the following issues:

REST

  • Display a list of all names
  • Display one name for a given ID
  • Insert a name
  • Update a name
  • Delete a selected name

GraphQL

  • Display a list of all names
  • Display one name for a given ID
  • Insert a name
  • Update a name
  • Delete a selected name

Get a REST service in node.js going for names

To start with, get a REST web service going in node.js that exposes the name table. Basically a web service for the following:

  • GET List of names, /names
  • GET one name /names/1
  • POST one name /names
  • PUT update one name /names
  • DELETE to delete one /names

Another task would be to decide on what framework we want to work with. Express, Koa come to mind.

Add a new database.js method, updateRating()

Add a new method in database.js: updateRating(channelID, newRating). This method is called from the REST service after a new review has been posted to keep the rating in the channel table always up to date.

This method is technically not absolutely needed but very nice addition, other things should be prioritized.

Fix REST endpoint for reviews

Currently we have one REST endpoint for getting a list of reviews for a given channel ID. However it is hard coded to the value 1, see https://github.com/jonrh/rotten-tube/blob/master/rest/source/rest_server.js#L24

Another problem is we don't yet have a proper REST endpoint for submitting a review. What I had in mind was to have the payload be a JSON in the following shape:

{
    channelID: 1337
    name: "jonrh",
    rating: 7,
    review: "Decent channel, could be more funny though"
}

Todo:

  • Make a GET /reviews/:id REST endpoint and connect it to the getReviewsById() method
  • Make a POST /reviews REST endpoint and connect it to the postReview method in database.js

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.