SlideShare ist ein Scribd-Unternehmen logo
1 von 42
UNTANGLING THE WEB
FALL 2017 WEEK 7 – A DEVELOPER MINDSET, AN INTRODUCTION TO NODEJS,
DATABASES
AGENDA
• A developer mindset and how to conquer frustration
• Some resources to draw on
• An introduction to server-side programming
• NodeJS
• Databases
• A Bluemix Cloudant/NodeJS example
• Project 2 work if we have time
THIS PART IS MORE ABOUT DEFINITIONS AND
MINDSET THAN DEVELOPMENT
• I’m going to throw a lot of concepts at you, but they build on the previous classes less directly than the
previous few classes
• Just relax and think about the ideas I’m describing rather than the development details
A DEVELOPER MINDSET
• Zen and the Art of Motorcycle Maintenance
• “Assembly of Japanese BBQ requires great peace of mind”
• Comfort with discomfort
• Eventually you’ll figure it out. Or you won’t. Life will probably go on. Unless you’re trying to re-write the code
for the airlock and you’re on a space station. Then still don’t panic!
• Imposter syndrome
• Even as you gain skills you’ll still sometimes feel like the worst developer in the world and wonder how anyone
would ever hire you. It’s not your job to live up to over-inflated expectations, but only to try to do what you’ve
committed to.
CONCENTRATION
• https://medium.com/@crowquine/the-mindset-of-the-software-developer-2b8f64ee96e5#.pglf8vhw7
• Holding everything in your mind
• When I’m coding I *HATE* to be interrupted
• So much so that my boyfriend built me a little tent around my desk where I can pull the curtains and put on my
earplugs and he knows to never so much as wiggle the curtains unless he sends me email to ask if I can come
out
• Keeping a stack of inter-related concepts in mind, particularly a complex set of mathematical constructs, is just
hard and if I’m interrupted it may take quite some time to get back to where I was
HOW TO GET LESS FRUSTRATED
• Coding is inherently frustrating
• You’re trying to describe something very precisely to a machine that is more literal than a 3 year old. And might
have worse communication skills.
• Error messages are never sufficient.
• Work on the mental model
• Understand what you’re doing. Read conceptual help topics first, then man pages
• Draw pictures
• Walk away for a while. Take more breaks. Take a walk and think about it.
LIVECODING AND VIDEO LESSONS
• Screencasting is a thing. It’s also called livecoding.
• Twitch.tv
• https://www.liveedu.tv/livestreams/javascript/
• Even youtube has a lot of content
• These are all regular folks who stream. Expect variable quality.
• Online education is a huge thing
• I subscribe to pluralsight, safaribooks, stan Winston school, Adobe cloud, and others
• I also buy courses from select individuals on a regular basis
• It gets expensive, but if I pick up a nugget or two from a course it’s worth it
PLURALSIGHT
• The largest online education site, I think.
• It’s about $300 a year, sometimes a bit less with sales. (Big one is usually right around US thanksgiving.
If you sign up for a trial do so with a throwaway email address so that you’re eligible for new subscriber
discounts.)
• Very good quality content on a wide array of topics ranging from programming to application use to
graphics and creative process
• Get a free 3 month trial by signing up for Microsoft Developer Essentials:
https://www.visualstudio.com/dev-essentials/
SAFARI BOOKS
• This is O’Reilly’s online site. It is also about $300 a year.
• They have some courses, but mostly it is books and videos.
• They have all of the Packt publishing books, all of the O’Reilly books, and various other small publishers
that they strike deals with.
• Early release books, so you can see content before release, make comments, interact with authors, etc.
• I use this less than Pluralsight, but the ability to search forthcoming books makes it worth it to me.
HACKHANDS
• Now owned by pluralsight, but it runs as a separate company still
• Pay by the minute for a shared screen session with an expert
• Kind of like how I run my zoom sessions sometimes
• Please feel free to continue to use me for that during the course
• Can find experts on a variety of topics. When I’m learning a new language or library it sometimes saves
me many hours to pay someone $20-$50 to consult for a bit.
WES BOS
• Wes is a developer in Hamilton, Ontario that makes fantastic courses on Javascript and React.
• Generally $80-100 for a 5 or 6 hour course, so not cheap
• He has good sample projects and materials and maintains a good online presence for questions, though
• He has an ES6 course out right now and I’m anxiously awaiting his course on async/await that should be
out in the next month or two
CODE SCHOOL, CODE ACADEMY, ETC.
• https://www.codecademy.com/learn/javascript
• https://www.codeschool.com/learn
QUORA
• I’m not a huge fan, but they do have an interesting community
• It’s a good place to ask conceptual questions or questions about how programs interface with the real
world
• Not as good for pure programming questions
STACK OVERFLOW
• This is the place for programming questions
• Variable code quality, so don’t cut and paste haphazardly
• But feel free to test it out
• Even in professional settings you’ll often see code from stackoverflow
• The common convention is the leave a comment in the code with a link to the stackoverflow question
WORKING AS A GROUP
• I intentionally did not impose a process for working together because you can find many different ways
of doing so
• Informal mechanisms work best for small projects, but more formality is needed as teams grow and
projects get longer
• I’m fine for this class if you just have one person manage the repo and pass them code to check in
• Ideally you’ll each independently commit, and I trust that team members will do roughly equal amount
of work, but I won’t mark down for group approaches
PUBLIC PROJECT STRATEGY
• Best for large projects without a fixed team
• Owner is the only one with repo permissions
• Other people fork the code and modify it then make merge requests back to the owner
• Careful, everything you have changed gets put into the merge request! Use a branch to do your playing
around
• Project owner will review the request and take those pieces they want
PROJECT OWNER STRATEGY
• This is how I run my big projects with fixed team members
• A project owner is the only one who can check into the master branch
• The master branch is where builds come from
• Contributors can create branches and check code into those branches and then send me a merge
request when they want to move it to master
• This only happens when their code is synced up with the latest changes in the master branch and has passes
acceptance tests
CO-CONTRIBUTOR STRATEGY
• Add others as contributors, don’t enforce branch and merge rules
• This is really only suitable on small projects
• Requires team members to communicate about who is working on which pieces to avoid having to
merge or causing conflicts
• Ideally have people working in separate files most of the time
PAIR PROGRAMMING
• This is a useful technique where you program in groups of 2 (or more, sometimes)
• One person is typing, of course, but others are watching and helping to figure things out and make
suggestions
• It’s tiring being the one typing and you should change things up with some frequency
• This is a good way to share experience when one of the pair is more experienced than the other
FRONT END VERSUS BACK END
• Front-End programming
• Anything that runs in the user’s browser
• Client code and the graphics that are used to deliver the end-user experience
• Everything we have done in the course so far, with the possible exception of google maps where you were using
someone else’s back end
• Back-End programming
• Server side code
• Databases
• Anything that is not running on the user’s machine
WEB SERVER AND BACKENDS
• A web server can serve up pages to the user’s browser and not have any other backend code
• It can also run code on the backend that determines what it sends to the browser, but to date we have
not done this
BUILD ENVIRONMENT AND PACKAGES
• LOTS of decisions
• Node.JS
• NPM
• Webpack
• Express
• React, Angular, etc.
• The point isn’t to scare you, but just to illustrate some of the things that could be thought about
CORY HOUSE CLASS INTRODUCTION
• http://www.bitnative.com/2016/11/12/building-a-javascript-development-environment-live-on-
pluralsight/
• Longer version:
• https://www.youtube.com/watch?v=QGCWal_JWek&feature=player_embedded
WE’RE GOING TO SIMPLIFY THIS SET OF DECISIONS
• NodeJS version 6: https://nodejs.org/en/download/
• IBM CLI extensions: https://clis.ng.bluemix.net/ui/home.html
• We’ll use the default stack that Bluemix provides
• (Install the above, you may have to reboot after the IBM install, you’ll certainly have to close and re-
open any terminal windows)
• Try the commands “node –v”, “npm”, “bluemix” (all should work, don’t worry much about the output)
VSCODE BUG TO FIX
• In working on the example at the end of this class, I encountered a vscode bug that I had a hard time
tracking down
• The HTML formatter was automatically being invoked on save, and this was introducing an error that
would negatively effect the web page
• That formatter must be turned off on save
• F1 to get to the command pallette
• Type in “formatter config”
• The first line “onSave” should be changed to “false” rather than “true”
• Restart VSCode
NODEJS
• This is a server-side framework
• Access databases
• Access filesystems
• Authentication
• Mutiuser applications
• Uses javascript on the server
DATABASES
• 2 main varieties – SQL and NoSQL
• SQL – structured query language
• Relational database
• Multiple tables, joins, complex queries
• NoSQL – anything else!
• Usually flat structure
• MongoDB is a popular one
• We’ll be looking at Cloudant, which is an IBM version of the open source CouchDB database
CRUD APPLICATION
• https://en.wikipedia.org/wiki/Create,_read,_update_and_delete
• Create
• Read
• Update
• Delete
IBM CLOUDANT EXAMPLE
• NodeJS, cloudant, website, routes
• Don’t worry too much about how it’s put together, but more how to get it running
• We’ll go into more detail on the component parts starting next week
• Note the lines I added by copying out of package.json!
• This will become relevant for the homework 
A QUICK FILE WALKTHROUGH
• Package.json
• Routes
• Html files
• Styling
• Database scripts
HOMEWORK 7
• Create your Bluemix account (if you have not already done so) and send me the email under which you
created the account (ideally your uvic email)
• Install the IBM CLI tools and NodeJS version 6
• Install the NodeJS Cloudant DB Web Starter project
• Fix the vscode bug described earlier
• Edit the HTML page at views/index.html to describe what each of the dependencies in package.json does
• Create a new github repository for the project and check all the files in
• Push up to bluemix (using the bluemix command line tools)
• Turn in both a link to the page running on bluemix and a link to your github repository
PROJECT 2
• Please ask early if you have any questions
• I am expecting 3-4 nicely styled pages, although any backend functionality can just be placeholders
• I am also expecting a presentation, ideally just using the webpages rather than slides (feel free to add
an additional webpage if you need to explain anything not implemented in the UI, such as your business
model canvas and value proposition canvas.)
PROJECT 2 – DUE START OF CLASS OCT 25TH
• Groups of 3-4 (no smaller than 2, no larger than 5)
• You will design and implement a website business
• This website must contain 3-4 html pages, a map (we’ll discuss this next week), a database mockup
(you’ll do the UI only in this project, the database itself will be for project 3), and a chatbot (also for
project 3, but you’ll do the dialog design for this project)
PROJECT 2 DELIVERABLES
• A business model canvas and value proposition canvas for your website business
• 3-4 web pages, hosted on github pages, that are styled nicely in CSS
• A half-page discussion of which SEO factors your website exhibits
• A functional map on one of the pages, although it does not have to be completely populated
• A presentation of between 3-5 minutes giving a walkthrough of the website concept
• This project is worth 15% of your mark and all group members will get the same mark. Switching groups
between projects 2 and 3 is discouraged but not impossible.

Weitere ähnliche Inhalte

Was ist angesagt?

Untangling the web week1
Untangling the web week1Untangling the web week1
Untangling the web week1Derek Jacoby
 
Untangling the web11
Untangling the web11Untangling the web11
Untangling the web11Derek Jacoby
 
Untangling spring week2
Untangling spring week2Untangling spring week2
Untangling spring week2Derek Jacoby
 
Untangling spring week5
Untangling spring week5Untangling spring week5
Untangling spring week5Derek Jacoby
 
Untangling spring week12
Untangling spring week12Untangling spring week12
Untangling spring week12Derek Jacoby
 
Untangling spring week10
Untangling spring week10Untangling spring week10
Untangling spring week10Derek Jacoby
 
Untangling fall2017 week1
Untangling fall2017 week1Untangling fall2017 week1
Untangling fall2017 week1Derek Jacoby
 
Untangling spring week4
Untangling spring week4Untangling spring week4
Untangling spring week4Derek Jacoby
 
Untangling spring week1
Untangling spring week1Untangling spring week1
Untangling spring week1Derek Jacoby
 
Untangling spring week9
Untangling spring week9Untangling spring week9
Untangling spring week9Derek Jacoby
 
Untangling spring week8
Untangling spring week8Untangling spring week8
Untangling spring week8Derek Jacoby
 
Untangling - fall2017 - week 10
Untangling - fall2017 - week 10Untangling - fall2017 - week 10
Untangling - fall2017 - week 10Derek Jacoby
 
Untangling the web - week 3
Untangling the web - week 3Untangling the web - week 3
Untangling the web - week 3Derek Jacoby
 
Untangling spring week3
Untangling spring week3Untangling spring week3
Untangling spring week3Derek Jacoby
 
Untangling the web10
Untangling the web10Untangling the web10
Untangling the web10Derek Jacoby
 
Engage 2019: Modernising Your Domino and XPages Applications
Engage 2019: Modernising Your Domino and XPages Applications Engage 2019: Modernising Your Domino and XPages Applications
Engage 2019: Modernising Your Domino and XPages Applications Paul Withers
 
Migrate PHP E-Commerce Site to Go
Migrate PHP E-Commerce Site to GoMigrate PHP E-Commerce Site to Go
Migrate PHP E-Commerce Site to GoWeng Wei
 
A Personal Journey
A Personal JourneyA Personal Journey
A Personal JourneyMichael Lihs
 

Was ist angesagt? (20)

Untangling the web week1
Untangling the web week1Untangling the web week1
Untangling the web week1
 
Untangling the web11
Untangling the web11Untangling the web11
Untangling the web11
 
Untangling spring week2
Untangling spring week2Untangling spring week2
Untangling spring week2
 
Untangling spring week5
Untangling spring week5Untangling spring week5
Untangling spring week5
 
Untangling spring week12
Untangling spring week12Untangling spring week12
Untangling spring week12
 
Untangling spring week10
Untangling spring week10Untangling spring week10
Untangling spring week10
 
Untangling fall2017 week1
Untangling fall2017 week1Untangling fall2017 week1
Untangling fall2017 week1
 
Untangling spring week4
Untangling spring week4Untangling spring week4
Untangling spring week4
 
Untangling spring week1
Untangling spring week1Untangling spring week1
Untangling spring week1
 
Untangling spring week9
Untangling spring week9Untangling spring week9
Untangling spring week9
 
Untangling spring week8
Untangling spring week8Untangling spring week8
Untangling spring week8
 
Untangling11
Untangling11Untangling11
Untangling11
 
Untangling - fall2017 - week 10
Untangling - fall2017 - week 10Untangling - fall2017 - week 10
Untangling - fall2017 - week 10
 
Untangling7
Untangling7Untangling7
Untangling7
 
Untangling the web - week 3
Untangling the web - week 3Untangling the web - week 3
Untangling the web - week 3
 
Untangling spring week3
Untangling spring week3Untangling spring week3
Untangling spring week3
 
Untangling the web10
Untangling the web10Untangling the web10
Untangling the web10
 
Engage 2019: Modernising Your Domino and XPages Applications
Engage 2019: Modernising Your Domino and XPages Applications Engage 2019: Modernising Your Domino and XPages Applications
Engage 2019: Modernising Your Domino and XPages Applications
 
Migrate PHP E-Commerce Site to Go
Migrate PHP E-Commerce Site to GoMigrate PHP E-Commerce Site to Go
Migrate PHP E-Commerce Site to Go
 
A Personal Journey
A Personal JourneyA Personal Journey
A Personal Journey
 

Ähnlich wie NodeJS Intro Databases

Introducing Pair Programming
Introducing Pair ProgrammingIntroducing Pair Programming
Introducing Pair ProgrammingSteven Smith
 
Software Development Whats & Whys
Software Development Whats & Whys Software Development Whats & Whys
Software Development Whats & Whys Harun Yardımcı
 
It's XP Stupid (2019)
It's XP Stupid (2019)It's XP Stupid (2019)
It's XP Stupid (2019)Mike Harris
 
Driving application development through behavior driven development
Driving application development through behavior driven developmentDriving application development through behavior driven development
Driving application development through behavior driven developmentEinar Ingebrigtsen
 
Agile Software Development
Agile Software DevelopmentAgile Software Development
Agile Software DevelopmentAhmet Bulut
 
Scaling a High Traffic Web Application: Our Journey from Java to PHP
Scaling a High Traffic Web Application: Our Journey from Java to PHPScaling a High Traffic Web Application: Our Journey from Java to PHP
Scaling a High Traffic Web Application: Our Journey from Java to PHP120bi
 
Scaling High Traffic Web Applications
Scaling High Traffic Web ApplicationsScaling High Traffic Web Applications
Scaling High Traffic Web ApplicationsAchievers Tech
 
How to guarantee your change is integrated to Moodle core
How to guarantee your change is integrated to Moodle coreHow to guarantee your change is integrated to Moodle core
How to guarantee your change is integrated to Moodle coreDan Poltawski
 
CPP01 - Introduction to C++
CPP01 - Introduction to C++CPP01 - Introduction to C++
CPP01 - Introduction to C++Michael Heron
 
Demystifying pair programming, swarming and mob programming - Shrikant Vashis...
Demystifying pair programming, swarming and mob programming - Shrikant Vashis...Demystifying pair programming, swarming and mob programming - Shrikant Vashis...
Demystifying pair programming, swarming and mob programming - Shrikant Vashis...Technical Agility institute
 
TDD - Seriously, try it! (updated '22)
TDD - Seriously, try it! (updated '22)TDD - Seriously, try it! (updated '22)
TDD - Seriously, try it! (updated '22)Nacho Cougil
 
Embracing OSS in the enterprise
Embracing OSS in the enterpriseEmbracing OSS in the enterprise
Embracing OSS in the enterprisecyberzeddk
 
Internet of Things, TYBSC IT, Semester 5, Unit II
Internet of Things, TYBSC IT, Semester 5, Unit IIInternet of Things, TYBSC IT, Semester 5, Unit II
Internet of Things, TYBSC IT, Semester 5, Unit IIArti Parab Academics
 
Extreme Programming (XP): Revisted
Extreme Programming (XP): RevistedExtreme Programming (XP): Revisted
Extreme Programming (XP): RevistedMike Harris
 
How engineering practices help business
How engineering practices help businessHow engineering practices help business
How engineering practices help businessAndrey Rebrov
 
Technical Writing Overview: WTD Nigeria
Technical Writing Overview: WTD NigeriaTechnical Writing Overview: WTD Nigeria
Technical Writing Overview: WTD NigeriaMargaret Fero
 

Ähnlich wie NodeJS Intro Databases (20)

Introducing Pair Programming
Introducing Pair ProgrammingIntroducing Pair Programming
Introducing Pair Programming
 
Software Development Whats & Whys
Software Development Whats & Whys Software Development Whats & Whys
Software Development Whats & Whys
 
It's XP Stupid (2019)
It's XP Stupid (2019)It's XP Stupid (2019)
It's XP Stupid (2019)
 
Driving application development through behavior driven development
Driving application development through behavior driven developmentDriving application development through behavior driven development
Driving application development through behavior driven development
 
It's XP, Stupid
It's XP, StupidIt's XP, Stupid
It's XP, Stupid
 
Agile Software Development
Agile Software DevelopmentAgile Software Development
Agile Software Development
 
Scaling a High Traffic Web Application: Our Journey from Java to PHP
Scaling a High Traffic Web Application: Our Journey from Java to PHPScaling a High Traffic Web Application: Our Journey from Java to PHP
Scaling a High Traffic Web Application: Our Journey from Java to PHP
 
Scaling High Traffic Web Applications
Scaling High Traffic Web ApplicationsScaling High Traffic Web Applications
Scaling High Traffic Web Applications
 
How to guarantee your change is integrated to Moodle core
How to guarantee your change is integrated to Moodle coreHow to guarantee your change is integrated to Moodle core
How to guarantee your change is integrated to Moodle core
 
CPP01 - Introduction to C++
CPP01 - Introduction to C++CPP01 - Introduction to C++
CPP01 - Introduction to C++
 
Demystifying pair programming, swarming and mob programming - Shrikant Vashis...
Demystifying pair programming, swarming and mob programming - Shrikant Vashis...Demystifying pair programming, swarming and mob programming - Shrikant Vashis...
Demystifying pair programming, swarming and mob programming - Shrikant Vashis...
 
Software development fundamentals
Software development fundamentalsSoftware development fundamentals
Software development fundamentals
 
CPAN Curation
CPAN CurationCPAN Curation
CPAN Curation
 
TDD - Seriously, try it! (updated '22)
TDD - Seriously, try it! (updated '22)TDD - Seriously, try it! (updated '22)
TDD - Seriously, try it! (updated '22)
 
Embracing OSS in the enterprise
Embracing OSS in the enterpriseEmbracing OSS in the enterprise
Embracing OSS in the enterprise
 
DevOps Year One
DevOps Year OneDevOps Year One
DevOps Year One
 
Internet of Things, TYBSC IT, Semester 5, Unit II
Internet of Things, TYBSC IT, Semester 5, Unit IIInternet of Things, TYBSC IT, Semester 5, Unit II
Internet of Things, TYBSC IT, Semester 5, Unit II
 
Extreme Programming (XP): Revisted
Extreme Programming (XP): RevistedExtreme Programming (XP): Revisted
Extreme Programming (XP): Revisted
 
How engineering practices help business
How engineering practices help businessHow engineering practices help business
How engineering practices help business
 
Technical Writing Overview: WTD Nigeria
Technical Writing Overview: WTD NigeriaTechnical Writing Overview: WTD Nigeria
Technical Writing Overview: WTD Nigeria
 

Mehr von Derek Jacoby

Untangling the web fall2017 class 3
Untangling the web fall2017 class 3Untangling the web fall2017 class 3
Untangling the web fall2017 class 3Derek Jacoby
 
Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Derek Jacoby
 
Untangling fall2017 week2
Untangling fall2017 week2Untangling fall2017 week2
Untangling fall2017 week2Derek Jacoby
 
Untangling spring week7
Untangling spring week7Untangling spring week7
Untangling spring week7Derek Jacoby
 
Untangling the web9
Untangling the web9Untangling the web9
Untangling the web9Derek Jacoby
 

Mehr von Derek Jacoby (8)

Untangling the web fall2017 class 3
Untangling the web fall2017 class 3Untangling the web fall2017 class 3
Untangling the web fall2017 class 3
 
Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Untangling fall2017 week2_try2
Untangling fall2017 week2_try2
 
Untangling fall2017 week2
Untangling fall2017 week2Untangling fall2017 week2
Untangling fall2017 week2
 
Untangling spring week7
Untangling spring week7Untangling spring week7
Untangling spring week7
 
Untangling the web9
Untangling the web9Untangling the web9
Untangling the web9
 
Untangling8
Untangling8Untangling8
Untangling8
 
Untangling6
Untangling6Untangling6
Untangling6
 
Untangling4
Untangling4Untangling4
Untangling4
 

Kürzlich hochgeladen

Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 

Kürzlich hochgeladen (20)

Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 

NodeJS Intro Databases

  • 1. UNTANGLING THE WEB FALL 2017 WEEK 7 – A DEVELOPER MINDSET, AN INTRODUCTION TO NODEJS, DATABASES
  • 2. AGENDA • A developer mindset and how to conquer frustration • Some resources to draw on • An introduction to server-side programming • NodeJS • Databases • A Bluemix Cloudant/NodeJS example • Project 2 work if we have time
  • 3. THIS PART IS MORE ABOUT DEFINITIONS AND MINDSET THAN DEVELOPMENT • I’m going to throw a lot of concepts at you, but they build on the previous classes less directly than the previous few classes • Just relax and think about the ideas I’m describing rather than the development details
  • 4.
  • 5. A DEVELOPER MINDSET • Zen and the Art of Motorcycle Maintenance • “Assembly of Japanese BBQ requires great peace of mind” • Comfort with discomfort • Eventually you’ll figure it out. Or you won’t. Life will probably go on. Unless you’re trying to re-write the code for the airlock and you’re on a space station. Then still don’t panic! • Imposter syndrome • Even as you gain skills you’ll still sometimes feel like the worst developer in the world and wonder how anyone would ever hire you. It’s not your job to live up to over-inflated expectations, but only to try to do what you’ve committed to.
  • 6. CONCENTRATION • https://medium.com/@crowquine/the-mindset-of-the-software-developer-2b8f64ee96e5#.pglf8vhw7 • Holding everything in your mind • When I’m coding I *HATE* to be interrupted • So much so that my boyfriend built me a little tent around my desk where I can pull the curtains and put on my earplugs and he knows to never so much as wiggle the curtains unless he sends me email to ask if I can come out • Keeping a stack of inter-related concepts in mind, particularly a complex set of mathematical constructs, is just hard and if I’m interrupted it may take quite some time to get back to where I was
  • 7. HOW TO GET LESS FRUSTRATED • Coding is inherently frustrating • You’re trying to describe something very precisely to a machine that is more literal than a 3 year old. And might have worse communication skills. • Error messages are never sufficient. • Work on the mental model • Understand what you’re doing. Read conceptual help topics first, then man pages • Draw pictures • Walk away for a while. Take more breaks. Take a walk and think about it.
  • 8. LIVECODING AND VIDEO LESSONS • Screencasting is a thing. It’s also called livecoding. • Twitch.tv • https://www.liveedu.tv/livestreams/javascript/ • Even youtube has a lot of content • These are all regular folks who stream. Expect variable quality. • Online education is a huge thing • I subscribe to pluralsight, safaribooks, stan Winston school, Adobe cloud, and others • I also buy courses from select individuals on a regular basis • It gets expensive, but if I pick up a nugget or two from a course it’s worth it
  • 9. PLURALSIGHT • The largest online education site, I think. • It’s about $300 a year, sometimes a bit less with sales. (Big one is usually right around US thanksgiving. If you sign up for a trial do so with a throwaway email address so that you’re eligible for new subscriber discounts.) • Very good quality content on a wide array of topics ranging from programming to application use to graphics and creative process • Get a free 3 month trial by signing up for Microsoft Developer Essentials: https://www.visualstudio.com/dev-essentials/
  • 10. SAFARI BOOKS • This is O’Reilly’s online site. It is also about $300 a year. • They have some courses, but mostly it is books and videos. • They have all of the Packt publishing books, all of the O’Reilly books, and various other small publishers that they strike deals with. • Early release books, so you can see content before release, make comments, interact with authors, etc. • I use this less than Pluralsight, but the ability to search forthcoming books makes it worth it to me.
  • 11. HACKHANDS • Now owned by pluralsight, but it runs as a separate company still • Pay by the minute for a shared screen session with an expert • Kind of like how I run my zoom sessions sometimes • Please feel free to continue to use me for that during the course • Can find experts on a variety of topics. When I’m learning a new language or library it sometimes saves me many hours to pay someone $20-$50 to consult for a bit.
  • 12. WES BOS • Wes is a developer in Hamilton, Ontario that makes fantastic courses on Javascript and React. • Generally $80-100 for a 5 or 6 hour course, so not cheap • He has good sample projects and materials and maintains a good online presence for questions, though • He has an ES6 course out right now and I’m anxiously awaiting his course on async/await that should be out in the next month or two
  • 13. CODE SCHOOL, CODE ACADEMY, ETC. • https://www.codecademy.com/learn/javascript • https://www.codeschool.com/learn
  • 14. QUORA • I’m not a huge fan, but they do have an interesting community • It’s a good place to ask conceptual questions or questions about how programs interface with the real world • Not as good for pure programming questions
  • 15. STACK OVERFLOW • This is the place for programming questions • Variable code quality, so don’t cut and paste haphazardly • But feel free to test it out • Even in professional settings you’ll often see code from stackoverflow • The common convention is the leave a comment in the code with a link to the stackoverflow question
  • 16. WORKING AS A GROUP • I intentionally did not impose a process for working together because you can find many different ways of doing so • Informal mechanisms work best for small projects, but more formality is needed as teams grow and projects get longer • I’m fine for this class if you just have one person manage the repo and pass them code to check in • Ideally you’ll each independently commit, and I trust that team members will do roughly equal amount of work, but I won’t mark down for group approaches
  • 17. PUBLIC PROJECT STRATEGY • Best for large projects without a fixed team • Owner is the only one with repo permissions • Other people fork the code and modify it then make merge requests back to the owner • Careful, everything you have changed gets put into the merge request! Use a branch to do your playing around • Project owner will review the request and take those pieces they want
  • 18. PROJECT OWNER STRATEGY • This is how I run my big projects with fixed team members • A project owner is the only one who can check into the master branch • The master branch is where builds come from • Contributors can create branches and check code into those branches and then send me a merge request when they want to move it to master • This only happens when their code is synced up with the latest changes in the master branch and has passes acceptance tests
  • 19. CO-CONTRIBUTOR STRATEGY • Add others as contributors, don’t enforce branch and merge rules • This is really only suitable on small projects • Requires team members to communicate about who is working on which pieces to avoid having to merge or causing conflicts • Ideally have people working in separate files most of the time
  • 20. PAIR PROGRAMMING • This is a useful technique where you program in groups of 2 (or more, sometimes) • One person is typing, of course, but others are watching and helping to figure things out and make suggestions • It’s tiring being the one typing and you should change things up with some frequency • This is a good way to share experience when one of the pair is more experienced than the other
  • 21. FRONT END VERSUS BACK END • Front-End programming • Anything that runs in the user’s browser • Client code and the graphics that are used to deliver the end-user experience • Everything we have done in the course so far, with the possible exception of google maps where you were using someone else’s back end • Back-End programming • Server side code • Databases • Anything that is not running on the user’s machine
  • 22. WEB SERVER AND BACKENDS • A web server can serve up pages to the user’s browser and not have any other backend code • It can also run code on the backend that determines what it sends to the browser, but to date we have not done this
  • 23. BUILD ENVIRONMENT AND PACKAGES • LOTS of decisions • Node.JS • NPM • Webpack • Express • React, Angular, etc. • The point isn’t to scare you, but just to illustrate some of the things that could be thought about
  • 24. CORY HOUSE CLASS INTRODUCTION • http://www.bitnative.com/2016/11/12/building-a-javascript-development-environment-live-on- pluralsight/ • Longer version: • https://www.youtube.com/watch?v=QGCWal_JWek&feature=player_embedded
  • 25.
  • 26. WE’RE GOING TO SIMPLIFY THIS SET OF DECISIONS • NodeJS version 6: https://nodejs.org/en/download/ • IBM CLI extensions: https://clis.ng.bluemix.net/ui/home.html • We’ll use the default stack that Bluemix provides • (Install the above, you may have to reboot after the IBM install, you’ll certainly have to close and re- open any terminal windows) • Try the commands “node –v”, “npm”, “bluemix” (all should work, don’t worry much about the output)
  • 27. VSCODE BUG TO FIX • In working on the example at the end of this class, I encountered a vscode bug that I had a hard time tracking down • The HTML formatter was automatically being invoked on save, and this was introducing an error that would negatively effect the web page • That formatter must be turned off on save • F1 to get to the command pallette • Type in “formatter config” • The first line “onSave” should be changed to “false” rather than “true” • Restart VSCode
  • 28. NODEJS • This is a server-side framework • Access databases • Access filesystems • Authentication • Mutiuser applications • Uses javascript on the server
  • 29. DATABASES • 2 main varieties – SQL and NoSQL • SQL – structured query language • Relational database • Multiple tables, joins, complex queries • NoSQL – anything else! • Usually flat structure • MongoDB is a popular one • We’ll be looking at Cloudant, which is an IBM version of the open source CouchDB database
  • 31. IBM CLOUDANT EXAMPLE • NodeJS, cloudant, website, routes • Don’t worry too much about how it’s put together, but more how to get it running • We’ll go into more detail on the component parts starting next week
  • 32.
  • 33.
  • 34.
  • 35.
  • 36. • Note the lines I added by copying out of package.json! • This will become relevant for the homework 
  • 37.
  • 38. A QUICK FILE WALKTHROUGH • Package.json • Routes • Html files • Styling • Database scripts
  • 39. HOMEWORK 7 • Create your Bluemix account (if you have not already done so) and send me the email under which you created the account (ideally your uvic email) • Install the IBM CLI tools and NodeJS version 6 • Install the NodeJS Cloudant DB Web Starter project • Fix the vscode bug described earlier • Edit the HTML page at views/index.html to describe what each of the dependencies in package.json does • Create a new github repository for the project and check all the files in • Push up to bluemix (using the bluemix command line tools) • Turn in both a link to the page running on bluemix and a link to your github repository
  • 40. PROJECT 2 • Please ask early if you have any questions • I am expecting 3-4 nicely styled pages, although any backend functionality can just be placeholders • I am also expecting a presentation, ideally just using the webpages rather than slides (feel free to add an additional webpage if you need to explain anything not implemented in the UI, such as your business model canvas and value proposition canvas.)
  • 41. PROJECT 2 – DUE START OF CLASS OCT 25TH • Groups of 3-4 (no smaller than 2, no larger than 5) • You will design and implement a website business • This website must contain 3-4 html pages, a map (we’ll discuss this next week), a database mockup (you’ll do the UI only in this project, the database itself will be for project 3), and a chatbot (also for project 3, but you’ll do the dialog design for this project)
  • 42. PROJECT 2 DELIVERABLES • A business model canvas and value proposition canvas for your website business • 3-4 web pages, hosted on github pages, that are styled nicely in CSS • A half-page discussion of which SEO factors your website exhibits • A functional map on one of the pages, although it does not have to be completely populated • A presentation of between 3-5 minutes giving a walkthrough of the website concept • This project is worth 15% of your mark and all group members will get the same mark. Switching groups between projects 2 and 3 is discouraged but not impossible.