shifting(the(paradigm( withthe(mean(stack · 2 agenda introduction...

32
1 Shifting the Paradigm with the MEAN Stack

Upload: others

Post on 23-Jun-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Shifting(the(Paradigm( withthe(MEAN(Stack · 2 Agenda Introduction Whywe&built&the&Submission&Platform&(Sub) Building-with-the-MEANStack I’ll&give&you&an&overview&of&how&we&built&Sub

1

Shifting  the  Paradigm  with  the  MEAN  Stack

Page 2: Shifting(the(Paradigm( withthe(MEAN(Stack · 2 Agenda Introduction Whywe&built&the&Submission&Platform&(Sub) Building-with-the-MEANStack I’ll&give&you&an&overview&of&how&we&built&Sub

2

AgendaIntroductionWhy  we  built  the  Submission  Platform  (Sub)

Building  with  the  MEAN  StackI’ll  give  you  an  overview  of  how  we  built  Sub

DemoI’ll  show  you  how  to  features  to  a  simple  MEAN  app

Page 3: Shifting(the(Paradigm( withthe(MEAN(Stack · 2 Agenda Introduction Whywe&built&the&Submission&Platform&(Sub) Building-with-the-MEANStack I’ll&give&you&an&overview&of&how&we&built&Sub

3

Introduction

Page 4: Shifting(the(Paradigm( withthe(MEAN(Stack · 2 Agenda Introduction Whywe&built&the&Submission&Platform&(Sub) Building-with-the-MEANStack I’ll&give&you&an&overview&of&how&we&built&Sub

4

Page 5: Shifting(the(Paradigm( withthe(MEAN(Stack · 2 Agenda Introduction Whywe&built&the&Submission&Platform&(Sub) Building-with-the-MEANStack I’ll&give&you&an&overview&of&how&we&built&Sub

5

Washington  Post  Peeps  Contest

https://www.washingtonpost.com/graphics/lifestyle/peeps-­diorama-­contest/2016/

Page 6: Shifting(the(Paradigm( withthe(MEAN(Stack · 2 Agenda Introduction Whywe&built&the&Submission&Platform&(Sub) Building-with-the-MEANStack I’ll&give&you&an&overview&of&how&we&built&Sub

6

Dynamic  form  builder  that  lets  you  collect  user  submissions  of  text,  images  and  other  data

Page 7: Shifting(the(Paradigm( withthe(MEAN(Stack · 2 Agenda Introduction Whywe&built&the&Submission&Platform&(Sub) Building-with-the-MEANStack I’ll&give&you&an&overview&of&how&we&built&Sub

7

Successful  Adoption

150+  Forms

=  50  Forms

Page 8: Shifting(the(Paradigm( withthe(MEAN(Stack · 2 Agenda Introduction Whywe&built&the&Submission&Platform&(Sub) Building-with-the-MEANStack I’ll&give&you&an&overview&of&how&we&built&Sub

8

Successful  Adoption

250+  Users

=  50  Users

Page 9: Shifting(the(Paradigm( withthe(MEAN(Stack · 2 Agenda Introduction Whywe&built&the&Submission&Platform&(Sub) Building-with-the-MEANStack I’ll&give&you&an&overview&of&how&we&built&Sub

9

Successful  Adoption

70K+  Submissions

=  10k  Submissions

Page 10: Shifting(the(Paradigm( withthe(MEAN(Stack · 2 Agenda Introduction Whywe&built&the&Submission&Platform&(Sub) Building-with-the-MEANStack I’ll&give&you&an&overview&of&how&we&built&Sub

10

Successful  Adoption

~15000  Media  Sets

=  5000  Media  Sets

Page 11: Shifting(the(Paradigm( withthe(MEAN(Stack · 2 Agenda Introduction Whywe&built&the&Submission&Platform&(Sub) Building-with-the-MEANStack I’ll&give&you&an&overview&of&how&we&built&Sub

11

How  did  we  do  this?

Page 12: Shifting(the(Paradigm( withthe(MEAN(Stack · 2 Agenda Introduction Whywe&built&the&Submission&Platform&(Sub) Building-with-the-MEANStack I’ll&give&you&an&overview&of&how&we&built&Sub

12

Page 13: Shifting(the(Paradigm( withthe(MEAN(Stack · 2 Agenda Introduction Whywe&built&the&Submission&Platform&(Sub) Building-with-the-MEANStack I’ll&give&you&an&overview&of&how&we&built&Sub

13

MongoDB

Page 14: Shifting(the(Paradigm( withthe(MEAN(Stack · 2 Agenda Introduction Whywe&built&the&Submission&Platform&(Sub) Building-with-the-MEANStack I’ll&give&you&an&overview&of&how&we&built&Sub

14

MongoDB ExpressJS

Page 15: Shifting(the(Paradigm( withthe(MEAN(Stack · 2 Agenda Introduction Whywe&built&the&Submission&Platform&(Sub) Building-with-the-MEANStack I’ll&give&you&an&overview&of&how&we&built&Sub

15

MongoDB ExpressJS AngularJS

Page 16: Shifting(the(Paradigm( withthe(MEAN(Stack · 2 Agenda Introduction Whywe&built&the&Submission&Platform&(Sub) Building-with-the-MEANStack I’ll&give&you&an&overview&of&how&we&built&Sub

16

MongoDB ExpressJS AngularJS NodeJS

Page 17: Shifting(the(Paradigm( withthe(MEAN(Stack · 2 Agenda Introduction Whywe&built&the&Submission&Platform&(Sub) Building-with-the-MEANStack I’ll&give&you&an&overview&of&how&we&built&Sub

17

The  MEAN  Stack

Client

Server

Database

SEND  JSON

POST  TO  DB

SEND  JSON AJAX

Page 18: Shifting(the(Paradigm( withthe(MEAN(Stack · 2 Agenda Introduction Whywe&built&the&Submission&Platform&(Sub) Building-with-the-MEANStack I’ll&give&you&an&overview&of&how&we&built&Sub

18

The  MEAN  Stack

Database

SEND  JSON

POST  TO  DB

Page 19: Shifting(the(Paradigm( withthe(MEAN(Stack · 2 Agenda Introduction Whywe&built&the&Submission&Platform&(Sub) Building-with-the-MEANStack I’ll&give&you&an&overview&of&how&we&built&Sub

19

The  MEAN  Stack

Server POST  TO  DB

SEND  JSON AJAX

SEND  JSON

Page 20: Shifting(the(Paradigm( withthe(MEAN(Stack · 2 Agenda Introduction Whywe&built&the&Submission&Platform&(Sub) Building-with-the-MEANStack I’ll&give&you&an&overview&of&how&we&built&Sub

20

The  MEAN  Stack

ClientSEND  JSON AJAX

Page 21: Shifting(the(Paradigm( withthe(MEAN(Stack · 2 Agenda Introduction Whywe&built&the&Submission&Platform&(Sub) Building-with-the-MEANStack I’ll&give&you&an&overview&of&how&we&built&Sub

21

The  MEAN  Stack

Client

Server

Database

SEND  JSON

POST  TO  DB

SEND  JSON AJAX

Page 22: Shifting(the(Paradigm( withthe(MEAN(Stack · 2 Agenda Introduction Whywe&built&the&Submission&Platform&(Sub) Building-with-the-MEANStack I’ll&give&you&an&overview&of&how&we&built&Sub

22

Why  the  MEAN  Stack?

Page 23: Shifting(the(Paradigm( withthe(MEAN(Stack · 2 Agenda Introduction Whywe&built&the&Submission&Platform&(Sub) Building-with-the-MEANStack I’ll&give&you&an&overview&of&how&we&built&Sub

23

Structure  your  data  with  the  app  in  mind

Page 24: Shifting(the(Paradigm( withthe(MEAN(Stack · 2 Agenda Introduction Whywe&built&the&Submission&Platform&(Sub) Building-with-the-MEANStack I’ll&give&you&an&overview&of&how&we&built&Sub

24

MongoDB  vs  Relational  DB:  Viewing  a  single  submission  would  have  required  pulling  data  from  6  tables  if  we  had  use  a  relational  DB:

-­ Submissions  for  each  app  have  different  form  fields

-­ To  make  up  for  lack  of  flexibility  this  becomes  a  complex  schema

Page 25: Shifting(the(Paradigm( withthe(MEAN(Stack · 2 Agenda Introduction Whywe&built&the&Submission&Platform&(Sub) Building-with-the-MEANStack I’ll&give&you&an&overview&of&how&we&built&Sub

25

MongoDB  vs.  Relational  DBWith  mongo  we  can  store  our  submissions  in  a  single  collection

-­ All  data  for  a  submission  resides  in  one  document

-­ This  fits  with  the  way  we  use  submissions  in  our  app.  

Page 26: Shifting(the(Paradigm( withthe(MEAN(Stack · 2 Agenda Introduction Whywe&built&the&Submission&Platform&(Sub) Building-with-the-MEANStack I’ll&give&you&an&overview&of&how&we&built&Sub

26

Using  Node  and  Mongoose

Submission  Schema

Page 27: Shifting(the(Paradigm( withthe(MEAN(Stack · 2 Agenda Introduction Whywe&built&the&Submission&Platform&(Sub) Building-with-the-MEANStack I’ll&give&you&an&overview&of&how&we&built&Sub

27

Using  Mongoose  ModelsSubmission  Schema  from  previous  slide  (Submit.js):

Using  the  schema  in  server.js  (node  runs  this  on  start  up):

Page 28: Shifting(the(Paradigm( withthe(MEAN(Stack · 2 Agenda Introduction Whywe&built&the&Submission&Platform&(Sub) Building-with-the-MEANStack I’ll&give&you&an&overview&of&how&we&built&Sub

28

Demo

Page 29: Shifting(the(Paradigm( withthe(MEAN(Stack · 2 Agenda Introduction Whywe&built&the&Submission&Platform&(Sub) Building-with-the-MEANStack I’ll&give&you&an&overview&of&how&we&built&Sub

29

Demo

https://github.com/styonsk/percona-­live-­meanstack-­demo

The  following  slides  cover  topics  that  we  will  cover  in  the  demo.  If  you  want  to  revisit  something  from  the  demo,  these  slides  will  be  posted  by  Percona  Live  after  the  talk.

Page 30: Shifting(the(Paradigm( withthe(MEAN(Stack · 2 Agenda Introduction Whywe&built&the&Submission&Platform&(Sub) Building-with-the-MEANStack I’ll&give&you&an&overview&of&how&we&built&Sub

30

Contact

Matt  CwalinskiLinkedIn:  https://www.linkedin.com/in/mcwalinski

Twitter:  @mcwalinski

Kat  StyonsLinkedIn:https://www.linkedin.com/pub/kat-­styons/48/3a4/604Twitter:  @HappyKatTweets

Sruti  CheedallaLinkedIn:https://www.linkedin.com/in/sruticheedallaTwitter:  @shrootyc

Follow  us  on  Twitter,  @SubPlatform!

Me

Page 31: Shifting(the(Paradigm( withthe(MEAN(Stack · 2 Agenda Introduction Whywe&built&the&Submission&Platform&(Sub) Building-with-the-MEANStack I’ll&give&you&an&overview&of&how&we&built&Sub

31

Questions

Page 32: Shifting(the(Paradigm( withthe(MEAN(Stack · 2 Agenda Introduction Whywe&built&the&Submission&Platform&(Sub) Building-with-the-MEANStack I’ll&give&you&an&overview&of&how&we&built&Sub

32

Resources

• MongoDB• Mongoose.js• Elasticsearch• Express.js• AngularJS• Node.js• https://github.com/styonsk/percona-­live-­meanstack-­demo

• https://www.npmjs.com/package/elmongoose