Giter Club home page Giter Club logo

events-api's Introduction

Bounce ๐ŸŽ‰

Link to our project

Goals ๐Ÿฅ…

Create a web app that can:

  1. display a list of nearby events to the user
  2. provide directions from the user's current location to the selected venue

To get more comfortable with APIs.

User Journey

Why we chose these APIs

We wanted to create something that would be useful, and might have some real-world application.

We chose the Ticketmaster API as we wanted to return a list of events. The documentation was pretty nice. The JSON was easy to navigate. https://developer.ticketmaster.com/products-and-docs/apis/getting-started/

When we ran an error, the API quite often returned a helpful message in the .responseText, that gave us instructions on how to fix what we'd done. Very helpful and worth checking the console for!!!

We chose the TFL API as we ran into problems with CORS on the Google Maps API. There were ways to get around it using a browser extension, but this wouldn't be practical for other users.

TFL's docs were not as good - it required a lot of finding examples, and some instructions weren't clear, for example how to append keys and IDs as query parameters in the url.

Dependencies to install ๐Ÿ’ป

  • JavaScript
  • HTML
  • CSS
  • Tape for testing
  • Create API keys

Problems ๐Ÿ˜ฅ

travolta

  • Google Maps API...

  • We spent ages trying to link our two .js files using module.exports and require, and ended up getting nowhere. We'd forgotten that we had already written code to help us avoid having to do this, passing a unique post code from our first API to each newly-created li element as a class name:

        var newItem = document.createElement("li");
        newItem.className = events[j]._embedded.venues[0].postalCode;
  • Which created this on the DOM:
        <span class="WC2 9HU">Matilda the Musical</span>

  • Using the DOM, our TFL API could then access the post code, and return directions relevant to the selected event.

  • We used the same DOM logic to overcome a problem with our geolocation. We couldn't get the user's latitude and longitude out of the local scope of the getLocation() function, and we couldn't pass the return value of the function into our TFL API call. So we sent the user's co-ordinates to the DOM:

function showPosition(position) {
  document.getElementById("invisible").textContent =
    position.coords.latitude + "," + position.coords.longitude;
}
  • And then our second API call to TFL was able to access the latitude and longitude from the element ("invisible") on the DOM.

Tests

  • We had problems testing APIs, we managed to test some of our other functions a little!

Stretch Goals ๐Ÿƒ๐Ÿฅ…

dancing

  • Display an image (provided in the JSON) for each listed event.
  • Allow user to choose a date, and return a list of events for that date.
  • Display the venue address to the user, as well as the directions on how to get there.

events-api's People

Contributors

jcharnley avatar saksiva avatar charlielafosse avatar aterna01 avatar

Watchers

D Sofer avatar James Cloos avatar  avatar  avatar  avatar

events-api's Issues

Startup page

Not sure what you're aiming for here but could maybe think about some sort of placeholder text before the user has selected a destination, like: "Your journey will load here" ?? just a thought...

Direction results

Your directions are fine if you know an area but just being told:
Walk to 'this' road.... more details would be great!
Walk to 'POSTCODE' ..... if you guys can navigate by postcode i'm super envious! Again a little more help would be great for someone like me who is terrible at finding locations I don't know!!

Cool animation

I like the list lines when you hover! Very cool and not too distracting

Great looking project!

Site looks impressive for the limited time you've had to work on it so great job! ๐ŸŒŸ

  • Readme could use more detail, expand on your current bullet points and give some description on what made you come up with the idea of using these particular APIs
  • Great to see use of reset.css so early on in the course ๐ŸŒŸ
  • Some tests need to be written. I know we said not to directly test the API so instead test that your request is returning an object using typeof
  • Good start to implementing file structure by seperating your APIs and tests. Maybe you could improve on this by adding a CSS folder and one for Images. This probably seems pointless when you only have one image currently but its best to prepare for if a project was expanded on
  • Just to get into the habit, when making your commit messages, make sure they describe what is being committed. If you ever had to role back to a previous version of your project as something had broken some of your commit message don't actually state what has been added to the project so it would be difficult to know where the bug occured
  • Also on commits (mentors are going to drive you nuts by keep bringing commits up), between your group they are uneven with @jcharnley leading. I know during a project it can be hard to keep these even so I would just be aware if you are constantly the one with either the highest or lowest number of commits on team projects to communicate this at the start of your next group project so that your team are aware of this and can hopefully address it

API week tends to cause a lot of stress so again well done on the project ๐Ÿ˜ƒ

Hover

Another thing for thinking mobile first, the hover animation is awesome!

unfortunately it's slightly less clear which item you are clicking in mobile first as the dividing lines are only available on hover which you can't do on mobile.
screenshot 2018-11-16 at 10 28 05

JS

I totally get that we were all just trying to get everything to work this week but maybe now your's is looking and working well you could think about refactoring your code to make it more efficient?

Ticket image

Love the design of having the ticket at the top of the page but not sure you thought mobile first though....?
screenshot 2018-11-16 at 10 23 56
Maybe think about how the image should scale for a smaller screen?

empty `<p>` tag

I am sure this is an accidental but you have an empty <p> tag in your results section:
screenshot 2018-11-16 at 10 20 34

Contrast

Black on pink is not very contrasting.

Padding

Maybe consider adding a little bit of padding to the text on the left in the public transport box.

Architecture

May want to think about organising the architecture of the project a little more clearly? The TFL and Ticketmaster folders are great but your image of the ticket is just out in the project on its own... maybe create an img folder? and think about a src folder etc...

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.