2. WHAT IS METEOR?
• Full Stack JavaScript based framework built on NodeJS to develop mobile/web
applications
• One Language for both Frontend and Backend
7. LET’S INSTALL REACT
• Here we are installing “react” and “react-dom” to our project.
• What is NPM?
• What does “–save” do? Check package.json file
$: meteor npm install --save react react-dom
8. WHAT IS REACTJS?
• React is JavaScript based frontend framework developed at Facebook
• React is developed based on the philosophy of breaking down the app into
“Components”
• React is a little strict with HTML Tags and few other things
• No <img>, but <img />. React needs closing tags
• No inline comments in HTML
We are not going to dive deeper into React. We will learn enough to develop a meteor app.
9. LET’S BUILD OUR FIRST REACT COMPONENT
/imports/ui/App.jsx
“JSX”? What’s that extension?
14. LET’S GET NECESSARY CSS AND JS FILES
• Look for “assets.zip” file in the folder “Meteor-GDG” (I guess you
have it)
• Extract the files in “/client/assets”
• All these files will be automatically loaded into your project
(Meteor magic )
15. LET’S CREATE 2 MORE REACT COMPONENTS
• Look for “nav.html” and “header.html” in the Meteor-GDG folder
• Build two React Components (just like App.jsx) naming them
“Header.jsx” and “Nav.jsx”
• These components need to be in “/imports/ui”
19. LET’S CREATE A FORM TO WRITE A BLOG
• Create a new component “Add.jsx” using the HTML code provided.
• Let’s add a function to handle the form input
21. LET’S STORE THE INPUT INTO DATABASE
• Let’s declare our database table.
/imports/models/model.js
22. • Let’s use this model to insert the post
/imports/ui/Add.jsx
23. BUMMER!!! WHAT WENT WRONG!!
• The “insert” function tells the server side to execute.
• But the server side does not know what “Posts” is. Let’s fix this.
/server/main.js
26. LET’S DISPLAY THE POST
• We are now going to create two more components, “Blogs” and “Post-
Single”.
• What’s Tracker? We’ll get back to this a little later
$: meteor add ultimatejs:tracker-react
28. • Create “PostSingle’ Component using the HTML provided
• What is React Tracker?
• What does “this.props” do?
29. LET’S ADD SECURITY TO THE APP
• Meteor Sucscribe/Publish
• Meteor Methods
$: meteor remove auto-publish
$: meteor remove insecure
Let’s just do the first part
30. LET’S ADD THE PUBLISH/SUBSCRIBE CODE
/server/main.js /imports/ui/Blogs.jsx