Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Bluemix Webinar: Deploying a Full Stack Node.js Application to IBM Bluemix

Bluemix Webinar: Deploying a Full Stack Node.js Application to IBM Bluemix

Check out this webinar to learn how to deploy a full stack Node.js application to IBM Bluemix and how to quickly and easily add a Cloudant service to your Bluemix application. The value of Cloudant, a NoSQL database as a service (DBaaS) that excels at data replication and sync, is that it makes data available to users non-stop with elastic scalability, high availability, and integrated security. Join Bradley Holt, Developer Advocate for Cloudant, as he explores the Bluemix application manifest, buildpacks, deploy scripts, the Procfile, and configuration of Bluemix applications.

Bradley Holt

June 16, 2015
Tweet

More Decks by Bradley Holt

Other Decks in Programming

Transcript

  1. Deploying a Full Stack Node.js Application to IBM Bluemix IBM

    Bluemix Webinar Tuesday, June 16, 2015 Bradley Holt, Developer Advocate @BradleyHolt
  2. Location Tracker •  Stores data locally in PouchDB •  Front

    end built with AngularJS •  Authentication logic built with Node.js •  User interface built with Leaflet •  Replicates location data to Cloudant •  More info: https://cloudant.com/location-tracker/ 2
  3. 3 Location Tracker Part 3: https://cloudant.com/location-tracker/

  4. Deploying Manually

  5. Clone from GitHub 5 $ git clone https://github.com/cloudant-labs/location-tracker-nodejs.git
 
 $

    cd location-tracker-nodejs"
  6. Sign up for IBM Bluemix •  Deploy with one command

    •  Based on Cloud Foundry •  Sign up at: https://bluemix.net/ 6
  7. Install the Cloud Foundry CLI 7 •  Allows you to

    deploy and modify applications and service instances •  Set up instructions available at: https://www.ng.bluemix.net/docs/#starters/install_cli.html •  Installers and binaries for Debian, Red Hat, Mac OS X, Windows, and other Linux systems available at: https://github.com/cloudfoundry/cli/releases
  8. Configure the Cloud Foundry CLI 8 1.  Connect to Bluemix

    using the cf api command. For example: $ cf api https://api.ng.bluemix.net" 2.  Log in to Bluemix using the cf login command. For example: $ cf login -u john.doe@acme.com -o john.doe@acme.com -s myspace" 3.  Don't deploy to Bluemix quite yet!
  9. Create a Cloudant Service 9 $ cf create-service cloudantNoSQLDB Shared

    cloudant-location-tracker-db"
  10. 10

  11. 11

  12. 12

  13. 13

  14. IBM Cloudant •  Globally distributed data layer for web and

    mobile applications •  MongoDB-style queries •  Advanced geospatial capabilities •  Full text search indexing 14
  15. JSON Documents 15 {
 _id: "6EF9D2B0-13D3-1378-8D30-39E3CE0B36C2",
 _rev: "1-0b457efcf82fb29492ef927ba5b6ee15",
 type: "Feature",


    geometry: {
 type: "Point",
 coordinates: [
 -71.1028,
 42.3691
 ]
 },
 properties: {
 session_id: "3486b13f-7b8a-8a96-dfbf-9b82800e367f",
 timestamp: 1422928591717
 }
 }
  16. Deploy! 16 $ cf push"

  17. 17

  18. 18

  19. How it Works

  20. 20

  21. Location Tracker Files 21

  22. The Application Manifest (manifest.yml) 22

  23. Node.js Buildpack •  Builds the application by installing the npm

    dependencies declared in package.json" •  Executes any scripts declared in package.json" •  Provides a Node.js runtime environment in which to start your application 23
  24. Deploy Scripts (package.json) 24

  25. The Procfile (Procfile) 25

  26. Configuration 26

  27. Further Reading •  Location Tracker https://cloudant.com/location-tracker/ •  Cloudant Node.js library

    https://github.com/cloudant/nodejs-cloudant •  PouchDB http://pouchdb.com/ •  Webinar: Integrate User Management and Cloudant Query into a Node.js/ Cloudant Application https://cloudant.com/resources/webinars/ 27
  28. Bradley Holt Developer Advocate bradley.holt@us.ibm.com @BradleyHolt github.com/bradley-holt