Open your Chrome Bookmarks and select Girls Who Code @ Xoom to open and view this presentation locally
High Level Overview
Today we are going to:
----
My goal for our session together:
Overview of our sample Node application
Node.js is
Why use Node.js?
Also referred to as the Front-End
An entity requesting a resource in a network.
A common client is a web browser requesting a web page from a web server.
Also referred to as the Back-End
A server is a computer that provides data to other computers.
A web server is a server that runs software and can serve its content to the WWW. Node.js is the web server that we'll be using to run our sample application locally.
Controller (Server-side Javascript)
controllers/getCountries.js makes our 2 API calls and sends the response from each call into the model
Model (Server-side JavaScript)
viewModels/countryData.js selects particular data from the response of each API call and organizes it into an object that the View will use
View (Client-side JavaScript)
/views/layout.hbs, /views/index.hbs
Model-View-Controller Architecture
API: Application Programming Interface
API request #1: https://api.xoom.com/v2/catalog/currency-channels
Here is a sample entry for Argentina from the Catalog API:
API request #2: http://countryapi.gear.host/v1/Country/getCountries
Here is a sample entry for Argentina:
Let's download and run our sample web application!
git clone https://github.com/girlsWhoCodeXoom/sample-node-app.git
cd sample-node-app
npm install
node app.js
Browse to http://localhost:3000
There are several volunteers in the room so if you have any question as you're going along just raise a hand :)
To render the maps, we are using the Google Charts Map Component:
https://developers.google.com/chart/interactive/docs/gallery/map
Let's open /view/layout.hbs and to see how we're drawing the maps to the page:
Within a self-executing function we load the Google Charts map package and set drawWorldMap as the callback function
- drawWorldMap()
Group Exercise - Please open /views/layout.hbs
Click command-S in your editor to save the change and then refresh your browser window.
1. Add the ability to click a marker on the world map to render an individual map of that country.
//addListenerToWorldMap(worldMap, worldMapDataTable);
2. Add a real-time traffic layer to the individual country map.
//var trafficLayer = new google.maps.TrafficLayer();
//trafficLayer.setMap(countryMap);
3. Enable Google Places search within the individual country maps.
//addPlaces(countryMap);
4. Add a custom color scheme to the individual country map
//styles: mapStyles
Thank You!
I am so happy that you are here at Xoom today, and that we are able to share and collaborate with you.
It is my wish that whatever you take away from your experience here at Xoom serves you well.