Giter Site home page Giter Site logo

littlefact's Introduction

WHY

We decided that our app should allow users to type in a start station and end station for a London journey and that the app should return a brief overview on how long the journey will take with a bonus fact about the destination for the reader to learn about during their journey. We thought that this app would be useful for tourists as well as curious Londoners, and should be mobile first as most users would use it on-the-go.

WHAT

Our MVP

Our application only displays information on duration of the whole journey as well as lines that the user takes during the journey.

Also it display information from Wikipedia on the end station.

STRETCH goals

On top of this, we added stretch goals of having Line information (what lines the journey involves) as well as the status of them. Finally, our last stretch goal was the provide information for what time the next train to that destination is. These were assigned as stretch goals because they weren't necessary to our MVP but would have been helpful information. We started planning our software architecture on a whiteboard and this also proved helpful for assigning which tasks we should begin with. However, before starting on our code we created our repo, added in plenty of issues and thought about our file structure.

HOW

Alt text

We decided to use two APIs from the given list after being unable to find external APIs which didn't require some level of user authentication for what we wanted them to do. The APIs we decided on were the TFL and Wikipedia ones. When looking at the file architecture, we decided to go for a front-end/back-end structure. We utilised a Public folder in the directory root which would store all front-end related files. Within this we had a assets folder which would compartmentalise css specific files and images. We learnt about the use of a normalize.css file, which s a small CSS file that provides better cross-browser consistency in the default styling of HTML elements. We installed this by running npm install --save normalize.css

Writing the function that gets the wiki "fun fact"

We found that simply passing in the name of the station that a user had searched for would return really variable Wikipedia results. For example, proper capitalisation was important, and ambiguously named stations such as 'Bank' would return facts about banks! We refined our search inputs as such:

  1. We created an if function before passing in our search string to the API url to account for ambiguous station names such as Temple, Oval, Bank, Angel, etc.
  2. If our returned object had less than 50 characters in the extract, this implied the page had come up with a "Your search may refer to:" string in the extract followed by a list of page options. In these cases, we amended the search string to include ", London" to refine the page we're looking for and then ran the function again.
  3. Finally, if after completing these if statements the page returned an empty string, this simply meant that the page didn't exist, in which case we passed in an error message welcoming the user to create the Wikipedia page themselves!

The tests

Writing tests for a function that makes API calls and depends heavily on the DOM and browser functionality turned out to be incompatible with our current tests framework, so we decided to put that aside, and test the function for edge cases and improve it, by directly looking at the output in the browser.

Things we would do differently next time...

We didn't have enough time to update our readme with the level of detail that we would like - we need to update it more next time. We potentially could have refined our Wikipedia search by location to get rid of some searching issues. Having array of station codes to station names to have drop down menu.

littlefact's People

Contributors

y-zaky avatar ameliejyc avatar azayneeva avatar polyccon avatar

Watchers

James Cloos avatar Jen Spencer avatar  avatar

Forkers

polyccon

littlefact's Issues

clarify user instructions

The e.g. suggests the input should be tube station names, but it could easily be made clearer by including an instruction to write a tube station name. (otherwise I might try and put in a for e.g. postcode).

๐Ÿ‘ for case-insensitive searches.

Grad class isn't correct in css

Make sure comments for CSS are styled /* and */
Also try changing the background-color attribute to background - I think its that, and I don't think writing to bottom will work?

Try that and if it's not happening it might be worth getting rid of the class altogether.

Blue border in the input boxes?

Is this intentional or it occurred by default?

--> As that blue is not the same blue as the background color and it is square and not round as the square boxes, maybe it would look better without it? (this is just an opinion)

Test coverage

After running and passing all tests, check what our test coverage is and if necessary add more tests.

@media could be optimised for screen

Media screens can target all manner of stuff, screen readers, printers, etc. It's better to target screen instead of all so you can target the visual presentation stuff to things that can display it

Refactor our code

Refactor our code so that we make sure we dont repeat same code various times and make it more readable.

Verify the user input previously

If you just put something random or a typo in your tube-line, the apicall runs and threw an error. You can just solve this if you limit the user input with a dropdown menu.

Tests

Write tests for tfl and wiki api functions.

Accessibility

Generally ๐Ÿฅ‡ especially with the screen reader.

The accessibility audit tools suggest improving the colour contrast of the 'X minutes away' animation: (I also wonder if making the font-weight heavier/bolder would also help here).

Also, don't forget to state that the website language is English.

Accessibility tags in html

Remember to take into account accessibility issues and adding appropriate tags such as tab-index, aria labels as well as adjusting letter and buttons sizes.

Pull request clarification

Looking at your pull requests page, it's a bit difficult to see what each pull request was doing. Your commits are really clear to read, and it would be helpful for anyone joining your project to see what each pull request was for (more specifically than one word titles).

There also seem to have been more closed pull requests than closed issues - are you doing lots of pull requests to solve the same issue or not writing issues that cover everything you're doing?

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.