Coder Social home page Coder Social logo

savagewilliam / take-me-away Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fac-u/take-me-away

0.0 2.0 0.0 762 KB

Personal project to learn Hapi.js using 2 API's to populate views with handlebars

Home Page: https://weather-at-home.herokuapp.com/

JavaScript 68.04% CSS 15.19% HTML 16.77%

take-me-away's Introduction

Take Me Away (aka Keep Me at Home)

Resources

Project goals

Core

  • build a simple hapi app
  • consider user stories in the design phase
  • use test driven development (using the techniques and server.inject method)
  • query at least two APIs on the backend
  • use the retrieved data to populate a handlebars template
  • use server-side rendering to display on the front-end
  • weather icons from the 80s

Stretch

  • high test-coverage on front-end and back-end
  • host the project on heroku
  • images of user location from image api
  • use basic ES6 syntax in this project:
    • const for all variables whose values will never be re-assigned.
    • let for all variables whose values will be re-assigned.
    • (arg1, arg2) => {} arrow functions whenever you use callbacks.
    • template ${literals} whenever you use strings that require concatenation: i.e. 'string 1 ' + 'string 2'.

How to run

App

  1. Clone the repo to a local directory
  2. Run npm install from the root folder to install dependencies
  3. Run nodemon from the terminal to start the server through nodemon npm run devStart, or npm start without nodemon
  4. Add a new file called 'api-keys.env' to the root folder and request keys from FAC-U team
  5. Access the front end by visiting http://localhost:4000

Tests

  1. Run npm test to execute tape tests
  • test/main.test.js: these are the server, route and handler tests
  • run coverage to run Istanbul & Codecov
  • Back-end tests are written using Tape and run through Tap-spec
  • At this stage there are no QUnit tests

Key files

  • src/server.js: core server functionality
  • src/news.js: sends requests to and processes responses from newsapi.org
  • src/weather.js: sends requests to and processes responses from wunderground.com
  • views/layout/layout.html: top-level structure of homepage with template for content in body
  • views/index.html: second-tier page structure, pulling in core page elements
  • views/partials/weather.html: first page element
  • views/partials/news.html: second page element
  • public/main.css: main stylesheet

Dependencies

  • Env2
  • Handlebars
  • Hapi
  • Inert
  • Request
  • Vision
  • xmlhttprequest

Dev dependencies

  • Tape
  • Tap-spec
  • Eslint semi-standard
  • Nodemon
  • Codecov
  • Istanbul

Project history

Initial idea - abandoned

Our initial idea was to build an app for the following user story: 'I am a busy professional. I want to get out of town this weekend because I want to explore.'

Our plan was to use the Skyscanner api to get cheap flights from the user's destination and present three of these with weather in that destination and some points of interest from an api like Yelp or Factual.

Due to major issues with our chosen apis, we abandoned this project at midday on Tuesday.

Key learning

It's clear to us that we should have set milestones for our project. For next time, we need to establish how long we have for planning and testing dependencies (such as apis). We will set a timeframe ahead of the next stage to check in on whether things are tracking to our plan, or whether we need to redesign or rethink in order to meet the agreed deadlines.

take-me-away's People

Contributors

jsms90 avatar lucymonie avatar stevehopkinson avatar savagewilliam avatar

Watchers

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