SlideShare ist ein Scribd-Unternehmen logo
1 von 35
METEOR JS
WHAT IS METEOR?
• Full Stack JavaScript based framework built on NodeJS to develop mobile/web
applications
• One Language for both Frontend and Backend
FIRST METEOR APP
$: meteor create <photo-blog>
LET’S SEE THE MAGIC HAPPEN
$: cd <photo-blog>
$: meteor // runs the app
DID THIS HAPPEN AT <HTTP://LOCALHOST:3000>
METEOR FOLDER STRUCTURE
- client
- main.html
- main.js
- main.css
- server
- main.js
- imports
- public
- package.json
- .meteor
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
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.
LET’S BUILD OUR FIRST REACT COMPONENT
/imports/ui/App.jsx
“JSX”? What’s that extension?
/client/main.html /client/main.js
UNDERSTANDING WHAT JUST HAPPENED
LETS INSTALL BOOTSTRAP
This is not a node module but a Meteor Package.
$: meteor add twbs:bootstrap
LET’S START BUILDING A PHOTO-BLOG
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 )
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”
LET’S INTEGRATE EVERYTHING
/client/App.jsx
BACKGROUND IMAGE
• Look for ‘home-bg.jpg’ in Meteor-GDG folder
• Move the image to ‘/public’ folder in the app directory
/client/main.css
DO YOU SEE THIS?
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
/imports/ui/Add.jsx
LET’S STORE THE INPUT INTO DATABASE
• Let’s declare our database table.
/imports/models/model.js
• Let’s use this model to insert the post
/imports/ui/Add.jsx
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
LET’S TRY INSERT AGAIN
LET’S MAKE THE FORM BETTER
/imports/ui/Add.jsx
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
/imports/ui/Blogs.jsx
• Create “PostSingle’ Component using the HTML provided
• What is React Tracker?
• What does “this.props” do?
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
LET’S ADD THE PUBLISH/SUBSCRIBE CODE
/server/main.js /imports/ui/Blogs.jsx
$: meteor remove insecure
/server/main.js /imports/ui/Blog.jsx
LET’S ADD USER ACCOUNTS
• Add “AccountsUIWrapper.jsx” file from the folder provided to “/imports/ui”
$: meteor add accounts-ui accounts-password
$: meteor add react-meteor-data
$: meteor npm install react-addons-pure-render-mixin
Let’s Add Few More Dependencies
WE HAVE TO CHANGE SOME CODE
/imports/App.jsx
/imports/App.jsx
KEY CONCEPTS
• Server Side Vs Client Side

Weitere ähnliche Inhalte

Was ist angesagt?

Using CI for continuous delivery Part 2
Using CI for continuous delivery Part 2Using CI for continuous delivery Part 2
Using CI for continuous delivery Part 2Vishal Biyani
 
ASP.NET MVC, AngularJS CRUD for Azerbaijan Technical University
ASP.NET MVC, AngularJS CRUD for Azerbaijan Technical UniversityASP.NET MVC, AngularJS CRUD for Azerbaijan Technical University
ASP.NET MVC, AngularJS CRUD for Azerbaijan Technical UniversitySyed Shanu
 
Best Practices for creating WP REST API by Galkin Nikita
Best Practices for creating WP REST API by Galkin NikitaBest Practices for creating WP REST API by Galkin Nikita
Best Practices for creating WP REST API by Galkin NikitaWordCamp Kyiv
 
Why you should add React to your Rails application now!
Why you should add React to your Rails application now!Why you should add React to your Rails application now!
Why you should add React to your Rails application now!David Roberts
 
Grails Connecting to MySQL
Grails Connecting to MySQLGrails Connecting to MySQL
Grails Connecting to MySQLashishkirpan
 
A Tale of 3 CLIs - Angular 2, Ember, and React
A Tale of 3 CLIs - Angular 2, Ember, and ReactA Tale of 3 CLIs - Angular 2, Ember, and React
A Tale of 3 CLIs - Angular 2, Ember, and ReactTracy Lee
 
Using JHipster 4 for generating Angular/Spring Boot apps
Using JHipster 4 for generating Angular/Spring Boot appsUsing JHipster 4 for generating Angular/Spring Boot apps
Using JHipster 4 for generating Angular/Spring Boot appsYakov Fain
 
Starting with Reactjs
Starting with ReactjsStarting with Reactjs
Starting with ReactjsThinh VoXuan
 
1. Let's study web-development
1. Let's study web-development1. Let's study web-development
1. Let's study web-developmentJungwon Seo
 
Developing, building, testing and deploying react native apps
Developing, building, testing and deploying react native appsDeveloping, building, testing and deploying react native apps
Developing, building, testing and deploying react native appsLeena N
 
React & Redux, how to scale?
React & Redux, how to scale?React & Redux, how to scale?
React & Redux, how to scale?KMS Technology
 
React in production (react global summit 2021)
React in production (react global summit 2021)React in production (react global summit 2021)
React in production (react global summit 2021)Souvik Basu
 
Node.JS: Do you know the dependency of your dependencies dependency
Node.JS: Do you know the dependency of your dependencies dependencyNode.JS: Do you know the dependency of your dependencies dependency
Node.JS: Do you know the dependency of your dependencies dependencyWim Selles
 
JOSA TechTalks - RESTful API Concepts and Best Practices
JOSA TechTalks - RESTful API Concepts and Best PracticesJOSA TechTalks - RESTful API Concepts and Best Practices
JOSA TechTalks - RESTful API Concepts and Best PracticesJordan Open Source Association
 
Using hapi plugins to version your API (hapiDays 2014)
Using hapi plugins to version your API (hapiDays 2014)Using hapi plugins to version your API (hapiDays 2014)
Using hapi plugins to version your API (hapiDays 2014)Dave Stevens
 
Getting started with Chef
Getting started with ChefGetting started with Chef
Getting started with ChefEdureka!
 

Was ist angesagt? (20)

ReactJS Workflows
ReactJS WorkflowsReactJS Workflows
ReactJS Workflows
 
Using CI for continuous delivery Part 2
Using CI for continuous delivery Part 2Using CI for continuous delivery Part 2
Using CI for continuous delivery Part 2
 
ASP.NET MVC, AngularJS CRUD for Azerbaijan Technical University
ASP.NET MVC, AngularJS CRUD for Azerbaijan Technical UniversityASP.NET MVC, AngularJS CRUD for Azerbaijan Technical University
ASP.NET MVC, AngularJS CRUD for Azerbaijan Technical University
 
Best Practices for creating WP REST API by Galkin Nikita
Best Practices for creating WP REST API by Galkin NikitaBest Practices for creating WP REST API by Galkin Nikita
Best Practices for creating WP REST API by Galkin Nikita
 
Why you should add React to your Rails application now!
Why you should add React to your Rails application now!Why you should add React to your Rails application now!
Why you should add React to your Rails application now!
 
Grails Connecting to MySQL
Grails Connecting to MySQLGrails Connecting to MySQL
Grails Connecting to MySQL
 
A Tale of 3 CLIs - Angular 2, Ember, and React
A Tale of 3 CLIs - Angular 2, Ember, and ReactA Tale of 3 CLIs - Angular 2, Ember, and React
A Tale of 3 CLIs - Angular 2, Ember, and React
 
Using JHipster 4 for generating Angular/Spring Boot apps
Using JHipster 4 for generating Angular/Spring Boot appsUsing JHipster 4 for generating Angular/Spring Boot apps
Using JHipster 4 for generating Angular/Spring Boot apps
 
Starting with Reactjs
Starting with ReactjsStarting with Reactjs
Starting with Reactjs
 
1. Let's study web-development
1. Let's study web-development1. Let's study web-development
1. Let's study web-development
 
Developing, building, testing and deploying react native apps
Developing, building, testing and deploying react native appsDeveloping, building, testing and deploying react native apps
Developing, building, testing and deploying react native apps
 
React JS
React JSReact JS
React JS
 
Workshop React.js
Workshop React.jsWorkshop React.js
Workshop React.js
 
React & Redux, how to scale?
React & Redux, how to scale?React & Redux, how to scale?
React & Redux, how to scale?
 
React in production (react global summit 2021)
React in production (react global summit 2021)React in production (react global summit 2021)
React in production (react global summit 2021)
 
Node.JS: Do you know the dependency of your dependencies dependency
Node.JS: Do you know the dependency of your dependencies dependencyNode.JS: Do you know the dependency of your dependencies dependency
Node.JS: Do you know the dependency of your dependencies dependency
 
JOSA TechTalks - RESTful API Concepts and Best Practices
JOSA TechTalks - RESTful API Concepts and Best PracticesJOSA TechTalks - RESTful API Concepts and Best Practices
JOSA TechTalks - RESTful API Concepts and Best Practices
 
Using hapi plugins to version your API (hapiDays 2014)
Using hapi plugins to version your API (hapiDays 2014)Using hapi plugins to version your API (hapiDays 2014)
Using hapi plugins to version your API (hapiDays 2014)
 
Getting started with Chef
Getting started with ChefGetting started with Chef
Getting started with Chef
 
Learning chef
Learning chefLearning chef
Learning chef
 

Ähnlich wie MeteorJS Session

Using RequireJS with CakePHP
Using RequireJS with CakePHPUsing RequireJS with CakePHP
Using RequireJS with CakePHPStephen Young
 
Plone FSR
Plone FSRPlone FSR
Plone FSRfulv
 
Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011Timothy Fisher
 
ReactJS for Programmers
ReactJS for ProgrammersReactJS for Programmers
ReactJS for ProgrammersDavid Rodenas
 
Getting Started with React, When You’re an Angular Developer
Getting Started with React, When You’re an Angular DeveloperGetting Started with React, When You’re an Angular Developer
Getting Started with React, When You’re an Angular DeveloperFabrit Global
 
One code Web, iOS, Android
One code Web, iOS, AndroidOne code Web, iOS, Android
One code Web, iOS, AndroidArtem Marchenko
 
React && React Native workshop
React && React Native workshopReact && React Native workshop
React && React Native workshopStacy Goh
 
20171108 PDN HOL React Basics
20171108 PDN HOL React Basics20171108 PDN HOL React Basics
20171108 PDN HOL React BasicsRich Ross
 
Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]GDSC UofT Mississauga
 
Untangling - fall2017 - week 9
Untangling - fall2017 - week 9Untangling - fall2017 - week 9
Untangling - fall2017 - week 9Derek Jacoby
 
ReactJS vs AngularJS - Head to Head comparison
ReactJS vs AngularJS - Head to Head comparisonReactJS vs AngularJS - Head to Head comparison
ReactJS vs AngularJS - Head to Head comparison500Tech
 
Oracle JavaScript Extension Toolkit Web Components Bring Agility to App Devel...
Oracle JavaScript Extension Toolkit Web Components Bring Agility to App Devel...Oracle JavaScript Extension Toolkit Web Components Bring Agility to App Devel...
Oracle JavaScript Extension Toolkit Web Components Bring Agility to App Devel...Lucas Jellema
 
Untangling spring week5
Untangling spring week5Untangling spring week5
Untangling spring week5Derek Jacoby
 
Web Components v1
Web Components v1Web Components v1
Web Components v1Mike Wilcox
 
Wordpress beyond blogging
Wordpress beyond bloggingWordpress beyond blogging
Wordpress beyond bloggingJulien Minguely
 

Ähnlich wie MeteorJS Session (20)

Using RequireJS with CakePHP
Using RequireJS with CakePHPUsing RequireJS with CakePHP
Using RequireJS with CakePHP
 
slides.pptx
slides.pptxslides.pptx
slides.pptx
 
slides.pptx
slides.pptxslides.pptx
slides.pptx
 
Plone FSR
Plone FSRPlone FSR
Plone FSR
 
Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011
 
ReactJS for Programmers
ReactJS for ProgrammersReactJS for Programmers
ReactJS for Programmers
 
Getting Started with React, When You’re an Angular Developer
Getting Started with React, When You’re an Angular DeveloperGetting Started with React, When You’re an Angular Developer
Getting Started with React, When You’re an Angular Developer
 
One code Web, iOS, Android
One code Web, iOS, AndroidOne code Web, iOS, Android
One code Web, iOS, Android
 
Reactjs
ReactjsReactjs
Reactjs
 
React && React Native workshop
React && React Native workshopReact && React Native workshop
React && React Native workshop
 
20171108 PDN HOL React Basics
20171108 PDN HOL React Basics20171108 PDN HOL React Basics
20171108 PDN HOL React Basics
 
React js
React jsReact js
React js
 
Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]
 
Fluxible
FluxibleFluxible
Fluxible
 
Untangling - fall2017 - week 9
Untangling - fall2017 - week 9Untangling - fall2017 - week 9
Untangling - fall2017 - week 9
 
ReactJS vs AngularJS - Head to Head comparison
ReactJS vs AngularJS - Head to Head comparisonReactJS vs AngularJS - Head to Head comparison
ReactJS vs AngularJS - Head to Head comparison
 
Oracle JavaScript Extension Toolkit Web Components Bring Agility to App Devel...
Oracle JavaScript Extension Toolkit Web Components Bring Agility to App Devel...Oracle JavaScript Extension Toolkit Web Components Bring Agility to App Devel...
Oracle JavaScript Extension Toolkit Web Components Bring Agility to App Devel...
 
Untangling spring week5
Untangling spring week5Untangling spring week5
Untangling spring week5
 
Web Components v1
Web Components v1Web Components v1
Web Components v1
 
Wordpress beyond blogging
Wordpress beyond bloggingWordpress beyond blogging
Wordpress beyond blogging
 

Mehr von Shreyans Gandhi

Scratch Workshop at Riverside School, Ahmedabad - By GSC DAIICT
Scratch Workshop at Riverside School, Ahmedabad - By GSC DAIICTScratch Workshop at Riverside School, Ahmedabad - By GSC DAIICT
Scratch Workshop at Riverside School, Ahmedabad - By GSC DAIICTShreyans Gandhi
 
Google Cloud - An Introduction
Google Cloud - An IntroductionGoogle Cloud - An Introduction
Google Cloud - An IntroductionShreyans Gandhi
 
WebKit - DAIICT SBG Proposal
WebKit - DAIICT SBG ProposalWebKit - DAIICT SBG Proposal
WebKit - DAIICT SBG ProposalShreyans Gandhi
 

Mehr von Shreyans Gandhi (6)

Javascipt
JavasciptJavascipt
Javascipt
 
Chrome Extension
Chrome ExtensionChrome Extension
Chrome Extension
 
Appathon'16, DAIICT
Appathon'16, DAIICTAppathon'16, DAIICT
Appathon'16, DAIICT
 
Scratch Workshop at Riverside School, Ahmedabad - By GSC DAIICT
Scratch Workshop at Riverside School, Ahmedabad - By GSC DAIICTScratch Workshop at Riverside School, Ahmedabad - By GSC DAIICT
Scratch Workshop at Riverside School, Ahmedabad - By GSC DAIICT
 
Google Cloud - An Introduction
Google Cloud - An IntroductionGoogle Cloud - An Introduction
Google Cloud - An Introduction
 
WebKit - DAIICT SBG Proposal
WebKit - DAIICT SBG ProposalWebKit - DAIICT SBG Proposal
WebKit - DAIICT SBG Proposal
 

Kürzlich hochgeladen

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 

Kürzlich hochgeladen (20)

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

MeteorJS Session

  • 2. WHAT IS METEOR? • Full Stack JavaScript based framework built on NodeJS to develop mobile/web applications • One Language for both Frontend and Backend
  • 3. FIRST METEOR APP $: meteor create <photo-blog>
  • 4. LET’S SEE THE MAGIC HAPPEN $: cd <photo-blog> $: meteor // runs the app
  • 5. DID THIS HAPPEN AT <HTTP://LOCALHOST:3000>
  • 6. METEOR FOLDER STRUCTURE - client - main.html - main.js - main.css - server - main.js - imports - public - package.json - .meteor
  • 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?
  • 12. LETS INSTALL BOOTSTRAP This is not a node module but a Meteor Package. $: meteor add twbs:bootstrap
  • 13. LET’S START BUILDING A PHOTO-BLOG
  • 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”
  • 17. BACKGROUND IMAGE • Look for ‘home-bg.jpg’ in Meteor-GDG folder • Move the image to ‘/public’ folder in the app directory /client/main.css
  • 18. DO YOU SEE THIS?
  • 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
  • 25. LET’S MAKE THE FORM BETTER /imports/ui/Add.jsx
  • 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
  • 31. $: meteor remove insecure /server/main.js /imports/ui/Blog.jsx
  • 32. LET’S ADD USER ACCOUNTS • Add “AccountsUIWrapper.jsx” file from the folder provided to “/imports/ui” $: meteor add accounts-ui accounts-password $: meteor add react-meteor-data $: meteor npm install react-addons-pure-render-mixin Let’s Add Few More Dependencies
  • 33. WE HAVE TO CHANGE SOME CODE /imports/App.jsx
  • 35. KEY CONCEPTS • Server Side Vs Client Side