Giter Club home page Giter Club logo

week-06-projects's Introduction

Week 06 Projects

Backend Starter Code

You can use this backend starter code for your own projects that require a node/express/sequelize backend server.

Project 01: Build a Poll app

In class we designed and implemented a Poll app. The Poll app should allow the following:

  • Users can create new polls.
  • A poll consists of a question and 2 or more choices as answers
  • Users can vote for one choice in each poll

In class we designed the Poll app together. In each section different features were discussed, such as:

  • Allow one vote per user per poll
  • Allow only invited users (via email) to answer a poll
  • Add a poll expiration date and time
  • Allow the reuse of choices (yes, no, etc...) for multiple polls

But ultimately, we decided that each feature would add more complexity to our implementation. Therefore, we should start only with the core features first, and then build the additional features on top of our first version (this is agile development!).

Here is an example design from class:

Mockups and Routes

Models

What we built

In some sections we built the user and poll/question association, in other sections we only built the poll/question and choice association. Both are good starting points.

The code in the /poll-app directory is based on the /backend-starter-code. In class, we developed code for the models and controllers, and instead of views, we used Postman to interact with our backend.

The files we added were:

  • /models/polls.js
  • /models/choices.js
  • /controllers/polls.js
  • and we updated the /config/config.json file.

Additional Tasks (due October 20, 2017)

  • Allow the user to update a Poll question text
    • Add a PUT route that allows this
  • Allow the user to delete a Poll
    • Add the DELETE route that allows this
    • Should also delete the associated Choices

Postman and pgAdmin

Using and testing our app is made easier by using Postman to interact with the routes and pgAdmin to inspect the database (Mac users can also take a look at Valentina Studio).

Linux Users

Postman

Use the following commands:

wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz
sudo tar -xzf postman.tar.gz -C /opt
rm postman.tar.gz
sudo ln -s /opt/Postman/Postman /usr/bin/postman

You can now type postman on the command line to launch postman

pgAdmin

Use the following commands:

sudo apt-get update
sudo apt-get install pgadmin3

You can now type pgadmin3 on the command line to launch pgadmin 3

Mac Users

Both Postman and pgAdmin can be installed by downloading the apps directly from their websites:

Or, you can install them using homebrew as follows:

brew tap caskroom/cask
brew cask install postman
brew cask install pgadmin4
brew cask install valentina-studio

week-06-projects's People

Contributors

medgardo avatar

Watchers

James Cloos avatar

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.