Slide 1

Slide 1 text

www.galvao.eti.br CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 1 / 63 The Road to Node All images used in this presentation is a property of their entities. v. 0.1.0 The Road to Node… and other things.

Slide 2

Slide 2 text

Software Engineer at Edvisor First Brazilian to become Postman Supernova President, ABRAPHP - Brazilian Association of PHP Professionals Director, ConFLOSS and PHP Conference Brasil Evangelist and Contributor for PHP, Laminas Project Fedora Ambassador, LATAM Guest Post-Grad Professor (PR and SC) 25+ years developing web-interfaced systems 20+ with PHP and JavaScript ≃ 15 with Zend Framework / Laminas Project Speaker at national and international events Who?! www.galvao.eti.br www.galvao.eti.br CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 2 / 63

Slide 3

Slide 3 text

Goal www.galvao.eti.br CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 3 / 63

Slide 4

Slide 4 text

Learning www.galvao.eti.br How do I learn?!?! CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 4 / 63

Slide 5

Slide 5 text

Learning www.galvao.eti.br Fight FUD (Fear, Uncertainty and Doubt) CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 5 / 63

Slide 6

Slide 6 text

Learning www.galvao.eti.br Fight FUD (Fear, Uncertainty and Doubt) Build associations between what you know and what you don’t (Even if these associations are wrong) CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 6 / 63

Slide 7

Slide 7 text

Learning www.galvao.eti.br Fight FUD (Fear, Uncertainty and Doubt) Build associations between what you know and what you don’t (Even if these associations are wrong) Study AND practice CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 7 / 63

Slide 8

Slide 8 text

Beginning www.galvao.eti.br What is Node? CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 8 / 63

Slide 9

Slide 9 text

Beginning www.galvao.eti.br What is Node? (officially) Node.js is an open-source, cross-platform JavaScript runtime environment. CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 9 / 63

Slide 10

Slide 10 text

Beginning www.galvao.eti.br What is Node? (in my own words) Node is a runtime environment that allows JavaScript to operate in a backend/fullstack context. CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 10 / 63

Slide 11

Slide 11 text

Beginning www.galvao.eti.br What is Node? (in my own words) Node is a runtime environment that allows JavaScript to operate in a backend/fullstack context. This means Node enables us to use JS to: CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 11 / 63

Slide 12

Slide 12 text

Beginning www.galvao.eti.br What is Node? (in my own words) Node is a runtime environment that allows JavaScript to operate in a backend/fullstack context. This means Node enables us to use JS to: Read/Write files CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 12 / 63

Slide 13

Slide 13 text

Beginning www.galvao.eti.br What is Node? (in my own words) Node is a runtime environment that allows JavaScript to operate in a backend/fullstack context. This means Node enables us to use JS to: Read/Write files Connect to Databases CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 13 / 63

Slide 14

Slide 14 text

Beginning www.galvao.eti.br What is Node? (in my own words) Node is a runtime environment that allows JavaScript to operate in a backend/fullstack context. This means Node enables us to use JS to: Read/Write files Connect to Databases Send e-mails CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 14 / 63

Slide 15

Slide 15 text

Beginning www.galvao.eti.br What is Node? (in my own words) Node is a runtime environment that allows JavaScript to operate in a backend/fullstack context. This means Node enables us to use JS to: Read/Write files Connect to Databases Send e-mails etc... CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 15 / 63

Slide 16

Slide 16 text

On we go www.galvao.eti.br First step is… CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 16 / 63

Slide 17

Slide 17 text

On we go www.galvao.eti.br First step is… JavaScript! CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 17 / 63

Slide 18

Slide 18 text

On we go www.galvao.eti.br First step is… JavaScript! General Programming CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 18 / 63

Slide 19

Slide 19 text

On we go www.galvao.eti.br First step is… JavaScript! General Programming JS Quirks CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 19 / 63

Slide 20

Slide 20 text

On we go www.galvao.eti.br First step is… JavaScript! General Programming JS Quirks OOP CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 20 / 63

Slide 21

Slide 21 text

On we go www.galvao.eti.br First step is… JavaScript! General Programming JS Quirks OOP Things to keep in mind: CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 21 / 63

Slide 22

Slide 22 text

On we go www.galvao.eti.br First step is… JavaScript! General Programming JS Quirks OOP Docs are at https://developer.mozilla.org/en-US/docs/Web/JavaScript Things to keep in mind: CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 22 / 63

Slide 23

Slide 23 text

On we go www.galvao.eti.br First step is… JavaScript! General Programming JS Quirks OOP Docs are at https://developer.mozilla.org/en-US/docs/Web/JavaScript A nice starting point: https://www.youtube.com/watch?v=RLtyhwFtXQA Things to keep in mind: CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 23 / 63

Slide 24

Slide 24 text

On we go www.galvao.eti.br First step is… JavaScript! General Programming JS Quirks OOP Docs are at https://developer.mozilla.org/en-US/docs/Web/JavaScript A nice starting point: https://www.youtube.com/watch?v=RLtyhwFtXQA You’ll eventually use: https://www.npmjs.com/package/ Things to keep in mind: CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 24 / 63

Slide 25

Slide 25 text

On we go www.galvao.eti.br Second step is… CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 25 / 63

Slide 26

Slide 26 text

On we go www.galvao.eti.br Second step is… Events! CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 26 / 63

Slide 27

Slide 27 text

On we go www.galvao.eti.br Second step is… Events! “on”, just like in Frontend CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 27 / 63

Slide 28

Slide 28 text

On we go www.galvao.eti.br Second step is… Events! “on”, just like in Frontend We can EMIT! CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 28 / 63

Slide 29

Slide 29 text

On we go www.galvao.eti.br Second step is… Events! “on”, just like in Frontend We can EMIT! Custom Events CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 29 / 63

Slide 30

Slide 30 text

On we go www.galvao.eti.br Second step is… Events! “on”, just like in Frontend We can EMIT! Custom Events Things to keep in mind: CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 30 / 63

Slide 31

Slide 31 text

On we go www.galvao.eti.br Second step is… Events! “on”, just like in Frontend We can EMIT! Custom Events Events are SYNCHRONOUS, and therefore... Things to keep in mind: CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 31 / 63

Slide 32

Slide 32 text

On we go www.galvao.eti.br Second step is… Events! “on”, just like in Frontend We can EMIT! Custom Events Events are SYNCHRONOUS, and therefore... They keep the app “in check” Things to keep in mind: CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 32 / 63

Slide 33

Slide 33 text

On we go www.galvao.eti.br Third step is… CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 33 / 63

Slide 34

Slide 34 text

On we go www.galvao.eti.br Third step is… Asynchronicity! CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 34 / 63

Slide 35

Slide 35 text

On we go www.galvao.eti.br Third step is… Asynchronicity! Things happening! CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 35 / 63

Slide 36

Slide 36 text

On we go www.galvao.eti.br Third step is… Asynchronicity! Things happening! At the same time! CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 36 / 63

Slide 37

Slide 37 text

On we go www.galvao.eti.br Third step is… Asynchronicity! Things happening! At the same time! Promises, Promises... CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 37 / 63

Slide 38

Slide 38 text

On we go www.galvao.eti.br Third step is… Asynchronicity! Things happening! At the same time! Promises, Promises... Things to keep in mind: CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 38 / 63

Slide 39

Slide 39 text

On we go www.galvao.eti.br Third step is… Asynchronicity! Things happening! At the same time! Promises, Promises... Watch out for those pesky race conditions Things to keep in mind: CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 39 / 63

Slide 40

Slide 40 text

On we go www.galvao.eti.br Third step is… Asynchronicity! Things happening! At the same time! Promises, Promises... Watch out for those pesky race conditions Asynchronicity is NOT a silver bullet (nothing is) Things to keep in mind: CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 40 / 63

Slide 41

Slide 41 text

On we go www.galvao.eti.br Third step is… Asynchronicity! Things happening! At the same time! Promises, Promises... Watch out for those pesky race conditions Asynchronicity is NOT a silver bullet (nothing is) Use it wisely Things to keep in mind: CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 41 / 63

Slide 42

Slide 42 text

On we go www.galvao.eti.br Fourth step is… CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 42 / 63

Slide 43

Slide 43 text

On we go www.galvao.eti.br Fourth step is… Backend! CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 43 / 63

Slide 44

Slide 44 text

On we go www.galvao.eti.br Fourth step is… Backend! VERY different context CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 44 / 63

Slide 45

Slide 45 text

On we go www.galvao.eti.br Fourth step is… Backend! VERY different context With great power... CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 45 / 63

Slide 46

Slide 46 text

On we go www.galvao.eti.br Fourth step is… Backend! VERY different context With great power... Quality is king CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 46 / 63

Slide 47

Slide 47 text

On we go www.galvao.eti.br Fourth step is… Backend! VERY different context With great power... Quality is king Things to keep in mind: CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 47 / 63

Slide 48

Slide 48 text

On we go www.galvao.eti.br Fourth step is… Backend! VERY different context With great power... Quality is king Docs are at https://nodejs.org/en/docs/ Things to keep in mind: CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 48 / 63

Slide 49

Slide 49 text

On we go www.galvao.eti.br Fourth step is… Backend! VERY different context With great power... Quality is king Docs are at https://nodejs.org/en/docs/ Test, test and when in doubt… test AGAIN Things to keep in mind: CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 49 / 63

Slide 50

Slide 50 text

On we go www.galvao.eti.br Fourth step is… Backend! VERY different context With great power... Quality is king Docs are at https://nodejs.org/en/docs/ Test, test and when in doubt… test AGAIN Log ALL THE THINGS Things to keep in mind: CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 50 / 63

Slide 51

Slide 51 text

So... www.galvao.eti.br What is Node? CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 51 / 63

Slide 52

Slide 52 text

So... www.galvao.eti.br What is Node? JavaScript * (Events + Async) Backend CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 52 / 63 Node =

Slide 53

Slide 53 text

Now what? www.galvao.eti.br Congrats! CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 53 / 63

Slide 54

Slide 54 text

Now what? www.galvao.eti.br Congrats! Now... CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 54 / 63

Slide 55

Slide 55 text

Now what? www.galvao.eti.br Congrats! Now... CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 55 / 63

Slide 56

Slide 56 text

Now what? www.galvao.eti.br Congrats! Now... CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 56 / 63

Slide 57

Slide 57 text

Now what? www.galvao.eti.br Congrats! Now... CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 57 / 63

Slide 58

Slide 58 text

Now what? www.galvao.eti.br Congrats! Now... CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 58 / 63 GraphQL is a JSON-esque language for querying data

Slide 59

Slide 59 text

Now what? www.galvao.eti.br Congrats! Now... GraphQL is a JSON-esque language for querying data NestJS is like a MVC Framework CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 59 / 63

Slide 60

Slide 60 text

Now what? www.galvao.eti.br Congrats! Now... GraphQL is a JSON-esque language for querying data NestJS is like a MVC Framework TypeScript is JavaScript + Types CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 60 / 63

Slide 61

Slide 61 text

Now what? www.galvao.eti.br Congrats! Now... CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 61 / 63 * Remember: Associations, even wrong ones. GraphQL is a JSON-esque language for querying data NestJS is like a MVC Framework TypeScript is JavaScript + Types

Slide 62

Slide 62 text

The Result www.galvao.eti.br https://github.com/galvao/cush CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 62 / 63

Slide 63

Slide 63 text

Thank you! www.galvao.eti.br Questions? Critiques? Compliments?! ? CC Attribution-ShareAlike 4.0 International License by Er Galvão Abbott - 10/14/22 - 63 / 63