Giter Club home page Giter Club logo

spa-workshop's Introduction

SPA Workshop

In this workshop you'll be building and deploying an AngularJS single page application on the Aerobatic platform. The app itself is a city portal that displays local information for various cities around the world. This repo provides the basic scaffolding that you can fork to get started. It retrieves the weather for a given city using the forecast.io API and local news headlines using the Google News RSS feed. You can see a live demo of this starter template at http://spa-workshop.aerobaticapp.com.

Getting Started

  1. Login to http://www.aerobatic.com with your GitHub credentials.
  2. Install the yoke command line tool with npm: npm install -g yoke-cli
  3. Fork this repo to your own personal or organization account and clone it locally.
  4. In your terminal cd into the directory where you cloned the repo.
  5. Initialize your Aerobatic credentials by running yoke login.
  6. Create a new Aerobatic application with the command: yoke create-app. Be sure to select existing app when prompted.
  7. Run npm install.
  8. Register for an API key at forecast.io. Copy your API key to a new environment variable in your Aerobatic app dashboard called FORECAST_IO_API_KEY. Check the Server Only box to prevent the setting from being sent down to the browser in your index page.
  9. Open your app in development mode with: yoke sim -o.
  10. Start coding. Livereload should automatically keep your browser in sync as you save files.
  11. Before deploying to production, verify the release build of the app run without errors by re-running the simulator in release mode: yoke sim -o --release. This will execute the build step specified in the scripts section of package.json before launching the app.
  12. If everything looks good, you're ready to deploy to production: yoke deploy.

Enhancement Ideas

Here's some thoughts on how you might improve upon the scaffolded app. These are merely suggestions, feel free to get creative and make the app your own.

  • Make it look better (the bar is very low to begin)
  • Update geoLocationService.js to invoke a geo-location API (like the Google Maps API) rather than hardcoding the lat/long values.
  • Generalize the app to work with any arbitrary city rather than a predetermined list.
  • Show a loading indicator while API calls are in progress.
  • Enhance the current weather conditions to include a future forecast
  • Use the HTML5 location API to auto-suggest which city the current user is in
  • Use a more web friendly representation of the city name in the URL, i.e. cities/new-york rather than cities/New%20York
  • Display a map of the city
  • Show the local date and time in the city
  • Refactor cityCtrl.js to make the API calls to the Forecast and News services in parallel rather than serially. How might this code look were a dozen different APIs invoked to build the page? This article may be of use: http://solutionoptimist.com/2013/12/27/javascript-promise-chains-2/.
  • Implement Angular animations for the view changes, for example a slide-in/out transition.
  • Internationalize the app with angular-translate. You could also show news headlines in the language spoken in a particular city by tweaking the parameters to the Google News RSS feed.

spa-workshop's People

Contributors

dvonlehman avatar joekteo avatar thewillhuang avatar

Watchers

 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.