GithubHelp home page GithubHelp logo

happy-hour's Introduction

The Best Hour

Here we created our first full stack web application designed to allow users to view happy hours in San Francisco. Users are able to read reviews, add their own, update and delete their reviews.

Feel free to fork / star / watch for your own personal use.

See the published project at The Best Hour

##Technologies Used

  • jQuery and Javascript to add interactivity and display data on the client side
  • AJAX to make requests asynchronously
  • Handlebars to render templated JSON data on the front end
  • Node.js and Express for connecting our database to our client-side
  • MongoDB and Mongoose to persist our resources
  • Materialize framework to create a unified baseline structure
  • HTML and CSS for the basic structure of our app

##Code We're Proud Of

function update(req, res) {
  db.HappyHour.findById(req.params.happyHourId, function(err, foundHappyHour) {
    console.log(foundHappyHour);
    // we've got the happy hour, now find the review within it
    var correctReview = foundHappyHour.review.id(req.params.reviewId);
    if (correctReview) {
      console.log('req.body from update function in reviewsController',req.body);
      correctReview.userReview = req.body.userReview;
      foundHappyHour.save(function(err, saved) {
        console.log('UPDATED', correctReview, 'IN ', saved.reviews);
        res.json(correctReview);
      });
    } 
    else {
      res.send(404);
    }
  }); 

// Get the ID from the URL 
//i.e. get '/happyHours/0'
pathname = window.location.pathname;
//replace '/happyHours/' with empty string so '/happyHours/0' --> '0'
happyHourId = pathname.replace("/happyHours/",""); 

##Screenshots Home Page Screenshot Happy Hour Listings Screenshot Individual Happy Hour Screenshot Happy Hour Info Screenshot Happy Hour Reviews Screenshot Happy Hour Add Review Modal Screenshot

happy-hour's People

Contributors

serabakpak avatar

Watchers

James Cloos avatar Laura Russell 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.