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

The Mean Stack

The Mean Stack

1st step : HTML / CSS / LESS & SASS
2nd : Old School JS + Intro to Node
--
3rd : Node Overwiew + Express JS
4th : Express.js + MongoDB
5th : Angular 2

Clément Sauvage

September 07, 2016
Tweet

More Decks by Clément Sauvage

Other Decks in Programming

Transcript

  1. CLÉMENT SAUVAGE 25 YEARS OLD MOBILE & WEB SOFTWARE ENGINEER

    FROM #LILLE @CLEMENTSAUVAGE ON TWITTER & @CLMNTSVG ON INSTAGRAM
  2. ONE QUESTION REMAINS ! What about you ? NAME, JOB,

    INTEREST IN JS, EXPERIENCE WITH IT, AND... WHAT DO YOU EXPECT FROM THIS WEEK !
  3. HTML 5 | CSS 3 & Preprocessors | Bootstrap REST

    & Webservices Design Pattern AND
  4. HTML 5 | CSS 3 & Preprocessors | Bootstrap REST

    & Webservices Design Pattern AND
  5. MONDAY Web 2.0 HTML 5, CSS 3, JAVACRIPT "A LA

    PAPA" DOM, CLASSES, ID, SELECTORS INSTALLING THE TOOLS
  6. > Created in less than 10 days by Brendan Eich

    for Netscape Communication > Java-script (one and only time I'll talk about JAVA !) > December 1995 > Microsoft react (") and launch JScript > ... > Actaully ES7 (ECMA Script 2016)
  7. QUICK REMINDER Yesterday we've talked about > HTML (the content

    of the page) <html> (...) <body> <div class="my__body__class"> </body> </html>
  8. > CSS 3 (The style of the page) .my__body__class {

    background-color: yellow; color: blue; /*OK these combination is aweful !*/ }
  9. > 2 of its preprocessor LESS (written by Alexis Sellier,

    written ein JS) @myKolor : #E6E6E6 .borderRadius(@radius) { border-radius: @radius; /* Note that it won't prefix your CSS output on your behalf */ } .my__body__class { background-color: @myKolor .borderRadius(5px); }
  10. SASS, a bit more powerful with Bourbon and or Compass

    (ORIGINALLY WRITTEN I RUBY, BUT ALMOST AVAILABLE EVERYWHERE ) @import "colors"; $primaryColor: #1DC035; $secondayColor: #FF9250; $violet: #8C3CAA; @mixin borderRadiusMixin($borderRadius) { border-radius: $borderRadius; } .article { $secondayColor: #E9222F; background-color: $secondayColor; }
  11. .message { background-color: $secondayColor; border: solid 1px darken(#E4E4E4, 20%); color:

    $bleu; @include borderRadiusMixin(20px); } .classe_a { $violet: #0D6E4F; color: $violet; } .classe_b { color: $violet; } $columns: 12; @for $i from 1 through $columns { .colonne-#{$i} { width: ((100/$columns)*$i)*0.8%; margin: 5px; background-color: $violet; display: inline-block; } }
  12. We then discovered 2 responsive front-end framework (we'll see them

    deeper later on): > Bootstrap : Originally designed by 2 twitter buddies (powerful, but tedious with class names); > ZURB Foundation : The one I love (Did I mention it !), clean, powerful and lightweight.
  13. BY THE END OF THE DAY Write few node applications

    BUT WE NEED TO KNOW FEW THINGS ABOUT DATA INTERCHANGE
  14. // 1 Primitive Data Type //Boolean store true or false

    var iAmDevelopper = true; var iAmButcher = false; //Numbers var playerScore = 12; var playerLives = 5; //String var firstname = "Clément"; var lastanme = "SAUVAGE"; var business = "Startup Founder"; var jobs = "C.T.O";
  15. // 1 Primitive Data Type (2) //NULL var whatsThisVar =

    null; //Undefined var specificallyUndefined = undefined; var initVar;
  16. // Identifying types and values var myVariable = "Hello, World";

    //Undefined console.log(myVariable); // Hello, World console.log(typeof myVariable); // String
  17. == != === // Comparing Objects And Values var myString

    = "5"; var myNumber = 5; //Undefined console.log(myString == myNumber); // true console.log(myString === myNumber); // false
  18. PRIMITIVES USEFUL METHODS // Comparing Objects And Values var myString

    = "Hello"; var ucString = myString.toUpperCase(); // returns "HELLO" var lcString = ucString.toLowerCase(); // returns "hello" //And much...much more on MDN (Mozilla developper network)
  19. CREATING OBJECT var myPupil = new Object(); myPupil.firstname = "Jean";

    myPupil.lastname = "Dutilleul"; myPupil.age = 27; myPupil.job = { title: "Boulanger", farines : ['Bise', 'Type 540', 'Levain', '...'] /* Other properties */ }; //<= Litteral Object
  20. PROTOTYPES FUNCTION function Job(jobTitle, arrayOfLanguages){ this.title = jobTitle; this.language =

    arrayOfLanguages; } function Person(){ this.firstname; this.lastname; this.age; this.job; this.pointDeVie = 100; this.eat = function(manger, pointDeVie) { this.pointDeVie += pointDeVie; console.log(`J'ai bien mangé ${manger}, j'ai gagné ${pointDeVie} PdV, j'ai donc ${this.pointDeVie} PdV`); } this.work = function(travail) { this.pointDeVie -= 30; console.log(`J'ai bien travaillé ${travail}, mais j'ai maintenant ${this.pointDeVie} PdV !`); } }
  21. var luke = new Person(); luke.firstname = "Luke"; luke.lastname =

    "Skywalker"; luke.age = 6; luke.job = new Job("Padawan", new Array("Light Saber", "The dark side of the Force")); console.log(luke.job.title); console.log(luke.work('The Force')); console.log(luke.work('Levitation')); console.log(luke.eat('ewok', 10)); console.log(luke.eat('red pepper', 60));
  22. QUICK REMINDER > NOT a framework > Javascript runtime environnement

    based on V8 engine. > V8 Engine written in C++ for Google Chrome & derived product > Lauched in 2009 by Ryan Dahl > Main goal : Use JS server side
  23. RUN NODE IN THE CONSOLE Just type node in your

    shell. It will lauch a REPL (for Read Eval Print Loop) which will allow you to "playground" Node.js.