SlideShare uma empresa Scribd logo
1 de 30
Baixar para ler offline
DAY 2 17 Dec 9am-5pm
catching up…
Source files from Day 1 can be found on Dropbox,
make sure that it works for you
We have created a functioning app yesterday, but
it runs only in browser memory and application
state is not persisted (no backend)
Problems faced ):
manual template rendering/injecting is
cumbersome
super inefficient to reload all the “panels”
every time application state changes
Changes are propagated imperatively, but
declarative is better!
HTML is gonna become long and hard to
maintain
a meteor has landed!!
is a cohesive development platform, a
collection of libraries and packages that are
bound together in a tidy way to make web
development easier
Why meteor?
ProductiveBehind the hood!
One Language
JS from front to back
• Auto imports everything
• Hot-reloading
• Templating engine included
Real timewith minimal effort
community
there is a package for 

EVERYTHING
Commonly used commands
meteor create
<name>
Create a new Meteor project in /<name>
meteor run
Runs your application on localhost:3000.
Changes are detected and hot reload!
meteor add
<package>
Add packages to your Meteor project.
meteor reset
Reset the current project to a fresh state. Removes
the local mongo database.
meteor deploy
Deploy the project in your current directory to
Meteor's servers. You’ll need an account for this
Exercise 1Install and create new meteor project
app structure
Getting organised
Special Directories
/client
Files here are not run on the server,
and automatically concatenated in
development
/server
Code here is not sent to the client.
Put your sensitive code here!
/public Place public assets like images here
/
Everything else in the root directory.
Place common code like collections
here
Exercise 2Find and add packages
- Semantic UI
- Underscore
Templates
<template name=“A”>
...
</template>
Instead of one HTML file, we compose a page with templates
<template name=“B”>
...
</template>
<body>
{{> A }}
{{> B }}
</body>
A
B
SpacebarsYou may use Mustache-like {{helpers}} to bind data
Reactive and automatic
HTML JS
Template.A.helpers({
something: function() {
return ??
}
})
<template name=“A”>
<p>{{something}}</p>
</template>
if ?? is reactive, then any changes will
flow to the UI automatically
Session Variables
Database queries
Reactive Variables
Template callbacks
You can register functions that will be called
during the template lifecycle
onCreated() onRendered() onDestroyed()
useful for plugin
initialisation
used for cleanupuseful for declaring
template variables
Exercise 3Convert HTML into Meteor templates
Use template helpers to bind data
Initialise plugins within onRendered() callback
event map
Template.<template name>.events({
‘<eventType> <selector>’: function()
}
})
We map browser events to functions with the Event Map
this -> data context of target element
eg. click, change same as jQuery
use console.log(this) to see for yourself
reactive data flow
<button class=“trigger>
{{ something }}
Template html
Template.<template name>.helpers({
something: function()
return Session.get(‘something’);
}
})
Template JS
Template.<template name>.events({
‘click .trigger’: function()
Session.set(‘something’, ‘Something here!’);
}
})
Helpers
Event map
Session
something ‘Something here!’
Exercise 4Add Check Compatibility to Event Map
Update contents of modal through Session object
more meteor magic
accounts
> meteor add accounts-password
> meteor add iandouglas:accounts-ui-semantic-ui
Meteor comes with some great packages for
managing user accounts (plug and play!)
Meteor.user() Returns currently logged in user or null
Meteor.userId() Returns id of currently logged in user or null
{{currentUser}} Template helper that calls Meteor.user()
{{#if currentUser}} Render something only if user is logged in
Accounts.ui.config() Specify options
Exercise 5Set up a user account system
Exercise 6Conditional display of page elements, depending on
whether user has logged in
mongo db
Relational Database Document Database
use SQL to query use javascript API to query
store all relevant data together
in single "document" in JSON,
which can nest values
hierarchically
data is not normalised
data must be stored in
tabular form - rows and
columns
data is normalised
meteor collections
Meteor stores data in Collections
The special thing about collections in
Meteor is that they can be accessed
from both the server and the client
Views backed by a Collection will be
updated reactively!
<- Meteor.users
Exercise 6Adding a form to add/update profile details
Save profile data to Meteor.users Collection
Exercise 8Query data from MongoDB, un-hardcode
getting data from collections
Collection.find( … )
MongoDB query object
REACTIVE ENTITY!
Exercise 9Increment likes and views
Exercise 10Deploy! Finally!!
End of day 2https://clarencengoh.typeform.com/to/kjByjA

Mais conteúdo relacionado

Mais procurados

ASP.NET 03 - Working With Web Server Controls
ASP.NET 03 - Working With Web Server ControlsASP.NET 03 - Working With Web Server Controls
ASP.NET 03 - Working With Web Server ControlsRandy Connolly
 
Introduction to React JS for beginners
Introduction to React JS for beginners Introduction to React JS for beginners
Introduction to React JS for beginners Varun Raj
 
SenchaCon 2016: Enterprise Applications, Role Based Access Controls (RBAC) an...
SenchaCon 2016: Enterprise Applications, Role Based Access Controls (RBAC) an...SenchaCon 2016: Enterprise Applications, Role Based Access Controls (RBAC) an...
SenchaCon 2016: Enterprise Applications, Role Based Access Controls (RBAC) an...Sencha
 
Introduction to React JS for beginners | Namespace IT
Introduction to React JS for beginners | Namespace ITIntroduction to React JS for beginners | Namespace IT
Introduction to React JS for beginners | Namespace ITnamespaceit
 
Less13 3 e_loadmodule_3
Less13 3 e_loadmodule_3Less13 3 e_loadmodule_3
Less13 3 e_loadmodule_3Suresh Mishra
 
Server Controls of ASP.Net
Server Controls of ASP.NetServer Controls of ASP.Net
Server Controls of ASP.NetHitesh Santani
 
How To Utilize Context API With Class And Functional Componen in React.pptx
How To Utilize Context API With Class And Functional Componen in React.pptxHow To Utilize Context API With Class And Functional Componen in React.pptx
How To Utilize Context API With Class And Functional Componen in React.pptxBOSC Tech Labs
 
Dicoding Developer Coaching #26: Android | Menyimpan Database dengan Lebih Si...
Dicoding Developer Coaching #26: Android | Menyimpan Database dengan Lebih Si...Dicoding Developer Coaching #26: Android | Menyimpan Database dengan Lebih Si...
Dicoding Developer Coaching #26: Android | Menyimpan Database dengan Lebih Si...DicodingEvent
 
Building Modern Web Applications using React and Redux
 Building Modern Web Applications using React and Redux Building Modern Web Applications using React and Redux
Building Modern Web Applications using React and ReduxMaxime Najim
 
ASP.NET MVC Performance
ASP.NET MVC PerformanceASP.NET MVC Performance
ASP.NET MVC Performancerudib
 

Mais procurados (20)

ASP.NET Lecture 2
ASP.NET Lecture 2ASP.NET Lecture 2
ASP.NET Lecture 2
 
React render props
React render propsReact render props
React render props
 
Web controls
Web controlsWeb controls
Web controls
 
ASP.NET 03 - Working With Web Server Controls
ASP.NET 03 - Working With Web Server ControlsASP.NET 03 - Working With Web Server Controls
ASP.NET 03 - Working With Web Server Controls
 
React js
React jsReact js
React js
 
Introduction to React JS for beginners
Introduction to React JS for beginners Introduction to React JS for beginners
Introduction to React JS for beginners
 
Asp.net.
Asp.net.Asp.net.
Asp.net.
 
SenchaCon 2016: Enterprise Applications, Role Based Access Controls (RBAC) an...
SenchaCon 2016: Enterprise Applications, Role Based Access Controls (RBAC) an...SenchaCon 2016: Enterprise Applications, Role Based Access Controls (RBAC) an...
SenchaCon 2016: Enterprise Applications, Role Based Access Controls (RBAC) an...
 
Introduction to react js
Introduction to react jsIntroduction to react js
Introduction to react js
 
Introduction to React JS for beginners | Namespace IT
Introduction to React JS for beginners | Namespace ITIntroduction to React JS for beginners | Namespace IT
Introduction to React JS for beginners | Namespace IT
 
reactJS
reactJSreactJS
reactJS
 
Less13 3 e_loadmodule_3
Less13 3 e_loadmodule_3Less13 3 e_loadmodule_3
Less13 3 e_loadmodule_3
 
React.js
React.jsReact.js
React.js
 
Server Controls of ASP.Net
Server Controls of ASP.NetServer Controls of ASP.Net
Server Controls of ASP.Net
 
How To Utilize Context API With Class And Functional Componen in React.pptx
How To Utilize Context API With Class And Functional Componen in React.pptxHow To Utilize Context API With Class And Functional Componen in React.pptx
How To Utilize Context API With Class And Functional Componen in React.pptx
 
Dicoding Developer Coaching #26: Android | Menyimpan Database dengan Lebih Si...
Dicoding Developer Coaching #26: Android | Menyimpan Database dengan Lebih Si...Dicoding Developer Coaching #26: Android | Menyimpan Database dengan Lebih Si...
Dicoding Developer Coaching #26: Android | Menyimpan Database dengan Lebih Si...
 
Ajax and ASP.NET AJAX
Ajax and ASP.NET AJAXAjax and ASP.NET AJAX
Ajax and ASP.NET AJAX
 
Building Modern Web Applications using React and Redux
 Building Modern Web Applications using React and Redux Building Modern Web Applications using React and Redux
Building Modern Web Applications using React and Redux
 
ASP.NET MVC Performance
ASP.NET MVC PerformanceASP.NET MVC Performance
ASP.NET MVC Performance
 
React / Redux Architectures
React / Redux ArchitecturesReact / Redux Architectures
React / Redux Architectures
 

Destaque

More about health
More about healthMore about health
More about healthJack740
 
best first-sort
best first-sortbest first-sort
best first-sortRajendran
 
Health matrix
Health matrixHealth matrix
Health matrixJack740
 
Ormiston education
Ormiston educationOrmiston education
Ormiston educationJack740
 
Aids doesnt kill. your attitude kills.
Aids doesnt kill. your attitude kills.Aids doesnt kill. your attitude kills.
Aids doesnt kill. your attitude kills.Nikhil Parekh
 
Presentación del proyecto a la comunidad educativa
Presentación del proyecto a la comunidad educativaPresentación del proyecto a la comunidad educativa
Presentación del proyecto a la comunidad educativaAlmudena Martin-Albo Huertas
 
Introducción a Metodos de investigación de usuarios
Introducción a Metodos de investigación de usuariosIntroducción a Metodos de investigación de usuarios
Introducción a Metodos de investigación de usuariosAlexei Hidalgo
 
The Global Impact of Container Inventory Imbalance and the factors that influ...
The Global Impact of Container Inventory Imbalance and the factors that influ...The Global Impact of Container Inventory Imbalance and the factors that influ...
The Global Impact of Container Inventory Imbalance and the factors that influ...CINEC Campus
 
Ifrs adoption in saudi arabia
Ifrs adoption in saudi arabiaIfrs adoption in saudi arabia
Ifrs adoption in saudi arabiaT.P.Ghosh Ghosh
 
Using Visualization to Succeed with Big Data
Using Visualization to Succeed with Big Data Using Visualization to Succeed with Big Data
Using Visualization to Succeed with Big Data Pactera_US
 
Right Sourcing Utrecht
Right Sourcing UtrechtRight Sourcing Utrecht
Right Sourcing UtrechtJohn Gøtze
 
Drexel private equity guest lecture 10 20-2015
Drexel private equity guest lecture 10 20-2015Drexel private equity guest lecture 10 20-2015
Drexel private equity guest lecture 10 20-2015Justin Shuman
 
International Accounting Standard compliance analysis on nine pharmaceutical ...
International Accounting Standard compliance analysis on nine pharmaceutical ...International Accounting Standard compliance analysis on nine pharmaceutical ...
International Accounting Standard compliance analysis on nine pharmaceutical ...Orko Abir
 
Recent Trends in Ship Design - 2013
Recent Trends in Ship Design - 2013Recent Trends in Ship Design - 2013
Recent Trends in Ship Design - 2013Siva Chidambaram
 
Presentacion Derecho Penal Especial
Presentacion Derecho Penal EspecialPresentacion Derecho Penal Especial
Presentacion Derecho Penal EspecialLIMENDEZ30
 
Hadoop & Cloud Storage: Object Store Integration in Production
Hadoop & Cloud Storage: Object Store Integration in ProductionHadoop & Cloud Storage: Object Store Integration in Production
Hadoop & Cloud Storage: Object Store Integration in ProductionDataWorks Summit/Hadoop Summit
 
ig2 game audio cut sequence production_2014 to 2015
ig2 game audio cut sequence production_2014 to 2015ig2 game audio cut sequence production_2014 to 2015
ig2 game audio cut sequence production_2014 to 2015PaulinaKucharska
 
1 s2.0-s2212827114000377-main
1 s2.0-s2212827114000377-main1 s2.0-s2212827114000377-main
1 s2.0-s2212827114000377-mainLoli Kurniawati
 

Destaque (20)

More about health
More about healthMore about health
More about health
 
best first-sort
best first-sortbest first-sort
best first-sort
 
Health matrix
Health matrixHealth matrix
Health matrix
 
Ormiston education
Ormiston educationOrmiston education
Ormiston education
 
Aids doesnt kill. your attitude kills.
Aids doesnt kill. your attitude kills.Aids doesnt kill. your attitude kills.
Aids doesnt kill. your attitude kills.
 
Presentación del proyecto a la comunidad educativa
Presentación del proyecto a la comunidad educativaPresentación del proyecto a la comunidad educativa
Presentación del proyecto a la comunidad educativa
 
Introducción a Metodos de investigación de usuarios
Introducción a Metodos de investigación de usuariosIntroducción a Metodos de investigación de usuarios
Introducción a Metodos de investigación de usuarios
 
The Global Impact of Container Inventory Imbalance and the factors that influ...
The Global Impact of Container Inventory Imbalance and the factors that influ...The Global Impact of Container Inventory Imbalance and the factors that influ...
The Global Impact of Container Inventory Imbalance and the factors that influ...
 
Ifrs adoption in saudi arabia
Ifrs adoption in saudi arabiaIfrs adoption in saudi arabia
Ifrs adoption in saudi arabia
 
Using Visualization to Succeed with Big Data
Using Visualization to Succeed with Big Data Using Visualization to Succeed with Big Data
Using Visualization to Succeed with Big Data
 
Right Sourcing Utrecht
Right Sourcing UtrechtRight Sourcing Utrecht
Right Sourcing Utrecht
 
Drexel private equity guest lecture 10 20-2015
Drexel private equity guest lecture 10 20-2015Drexel private equity guest lecture 10 20-2015
Drexel private equity guest lecture 10 20-2015
 
International Accounting Standard compliance analysis on nine pharmaceutical ...
International Accounting Standard compliance analysis on nine pharmaceutical ...International Accounting Standard compliance analysis on nine pharmaceutical ...
International Accounting Standard compliance analysis on nine pharmaceutical ...
 
Recent Trends in Ship Design - 2013
Recent Trends in Ship Design - 2013Recent Trends in Ship Design - 2013
Recent Trends in Ship Design - 2013
 
Presentacion Derecho Penal Especial
Presentacion Derecho Penal EspecialPresentacion Derecho Penal Especial
Presentacion Derecho Penal Especial
 
ikigai
ikigaiikigai
ikigai
 
Hadoop & Cloud Storage: Object Store Integration in Production
Hadoop & Cloud Storage: Object Store Integration in ProductionHadoop & Cloud Storage: Object Store Integration in Production
Hadoop & Cloud Storage: Object Store Integration in Production
 
KNIME tutorial
KNIME tutorialKNIME tutorial
KNIME tutorial
 
ig2 game audio cut sequence production_2014 to 2015
ig2 game audio cut sequence production_2014 to 2015ig2 game audio cut sequence production_2014 to 2015
ig2 game audio cut sequence production_2014 to 2015
 
1 s2.0-s2212827114000377-main
1 s2.0-s2212827114000377-main1 s2.0-s2212827114000377-main
1 s2.0-s2212827114000377-main
 

Semelhante a Having Fun Building Web Applications (Day 2 slides)

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
 
ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010
ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010
ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010vchircu
 
Getting started with hot towel spa
Getting started with hot towel spaGetting started with hot towel spa
Getting started with hot towel spaparth17290
 
Architecture Specification - Visual Modeling Tool
Architecture Specification - Visual Modeling ToolArchitecture Specification - Visual Modeling Tool
Architecture Specification - Visual Modeling ToolAdriaan Venter
 
Build Your Own Instagram Filters
Build Your Own Instagram FiltersBuild Your Own Instagram Filters
Build Your Own Instagram FiltersTJ Stalcup
 
Entity Framework Code First Migrations
Entity Framework Code First MigrationsEntity Framework Code First Migrations
Entity Framework Code First MigrationsDiluka99999
 
Better User Experience with .NET
Better User Experience with .NETBetter User Experience with .NET
Better User Experience with .NETPeter Gfader
 
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
 
Adding a modern twist to legacy web applications
Adding a modern twist to legacy web applicationsAdding a modern twist to legacy web applications
Adding a modern twist to legacy web applicationsJeff Durta
 
Andy Bosch - JavaServer Faces in the cloud
Andy Bosch -  JavaServer Faces in the cloudAndy Bosch -  JavaServer Faces in the cloud
Andy Bosch - JavaServer Faces in the cloudAndy Bosch
 
O365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - MaterialO365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - MaterialThomas Daly
 

Semelhante a Having Fun Building Web Applications (Day 2 slides) (20)

Synopsis
SynopsisSynopsis
Synopsis
 
ASP.NET MVC3 RAD
ASP.NET MVC3 RADASP.NET MVC3 RAD
ASP.NET MVC3 RAD
 
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]
 
Uma SunilKumar Resume
Uma SunilKumar ResumeUma SunilKumar Resume
Uma SunilKumar Resume
 
Test
TestTest
Test
 
Data herding
Data herdingData herding
Data herding
 
Data herding
Data herdingData herding
Data herding
 
Angular2 and You
Angular2 and YouAngular2 and You
Angular2 and You
 
ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010
ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010
ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010
 
Getting started with hot towel spa
Getting started with hot towel spaGetting started with hot towel spa
Getting started with hot towel spa
 
Architecture Specification - Visual Modeling Tool
Architecture Specification - Visual Modeling ToolArchitecture Specification - Visual Modeling Tool
Architecture Specification - Visual Modeling Tool
 
Intro to Application Express
Intro to Application ExpressIntro to Application Express
Intro to Application Express
 
Build Your Own Instagram Filters
Build Your Own Instagram FiltersBuild Your Own Instagram Filters
Build Your Own Instagram Filters
 
Entity Framework Code First Migrations
Entity Framework Code First MigrationsEntity Framework Code First Migrations
Entity Framework Code First Migrations
 
Better User Experience with .NET
Better User Experience with .NETBetter User Experience with .NET
Better User Experience with .NET
 
Sqllite
SqlliteSqllite
Sqllite
 
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
 
Adding a modern twist to legacy web applications
Adding a modern twist to legacy web applicationsAdding a modern twist to legacy web applications
Adding a modern twist to legacy web applications
 
Andy Bosch - JavaServer Faces in the cloud
Andy Bosch -  JavaServer Faces in the cloudAndy Bosch -  JavaServer Faces in the cloud
Andy Bosch - JavaServer Faces in the cloud
 
O365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - MaterialO365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - Material
 

Último

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
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
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
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
🐬 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 Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 

Último (20)

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
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
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
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
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...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
🐬 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 Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
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...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 

Having Fun Building Web Applications (Day 2 slides)

  • 1. DAY 2 17 Dec 9am-5pm
  • 2. catching up… Source files from Day 1 can be found on Dropbox, make sure that it works for you We have created a functioning app yesterday, but it runs only in browser memory and application state is not persisted (no backend)
  • 3. Problems faced ): manual template rendering/injecting is cumbersome super inefficient to reload all the “panels” every time application state changes Changes are propagated imperatively, but declarative is better! HTML is gonna become long and hard to maintain
  • 4. a meteor has landed!!
  • 5. is a cohesive development platform, a collection of libraries and packages that are bound together in a tidy way to make web development easier
  • 6. Why meteor? ProductiveBehind the hood! One Language JS from front to back • Auto imports everything • Hot-reloading • Templating engine included Real timewith minimal effort community there is a package for 
 EVERYTHING
  • 7.
  • 8. Commonly used commands meteor create <name> Create a new Meteor project in /<name> meteor run Runs your application on localhost:3000. Changes are detected and hot reload! meteor add <package> Add packages to your Meteor project. meteor reset Reset the current project to a fresh state. Removes the local mongo database. meteor deploy Deploy the project in your current directory to Meteor's servers. You’ll need an account for this
  • 9. Exercise 1Install and create new meteor project
  • 10. app structure Getting organised Special Directories /client Files here are not run on the server, and automatically concatenated in development /server Code here is not sent to the client. Put your sensitive code here! /public Place public assets like images here / Everything else in the root directory. Place common code like collections here
  • 11. Exercise 2Find and add packages - Semantic UI - Underscore
  • 12. Templates <template name=“A”> ... </template> Instead of one HTML file, we compose a page with templates <template name=“B”> ... </template> <body> {{> A }} {{> B }} </body> A B
  • 13. SpacebarsYou may use Mustache-like {{helpers}} to bind data Reactive and automatic HTML JS Template.A.helpers({ something: function() { return ?? } }) <template name=“A”> <p>{{something}}</p> </template> if ?? is reactive, then any changes will flow to the UI automatically Session Variables Database queries Reactive Variables
  • 14. Template callbacks You can register functions that will be called during the template lifecycle onCreated() onRendered() onDestroyed() useful for plugin initialisation used for cleanupuseful for declaring template variables
  • 15. Exercise 3Convert HTML into Meteor templates Use template helpers to bind data Initialise plugins within onRendered() callback
  • 16. event map Template.<template name>.events({ ‘<eventType> <selector>’: function() } }) We map browser events to functions with the Event Map this -> data context of target element eg. click, change same as jQuery use console.log(this) to see for yourself
  • 17. reactive data flow <button class=“trigger> {{ something }} Template html Template.<template name>.helpers({ something: function() return Session.get(‘something’); } }) Template JS Template.<template name>.events({ ‘click .trigger’: function() Session.set(‘something’, ‘Something here!’); } }) Helpers Event map Session something ‘Something here!’
  • 18. Exercise 4Add Check Compatibility to Event Map Update contents of modal through Session object
  • 20. accounts > meteor add accounts-password > meteor add iandouglas:accounts-ui-semantic-ui Meteor comes with some great packages for managing user accounts (plug and play!) Meteor.user() Returns currently logged in user or null Meteor.userId() Returns id of currently logged in user or null {{currentUser}} Template helper that calls Meteor.user() {{#if currentUser}} Render something only if user is logged in Accounts.ui.config() Specify options
  • 21. Exercise 5Set up a user account system
  • 22. Exercise 6Conditional display of page elements, depending on whether user has logged in
  • 23. mongo db Relational Database Document Database use SQL to query use javascript API to query store all relevant data together in single "document" in JSON, which can nest values hierarchically data is not normalised data must be stored in tabular form - rows and columns data is normalised
  • 24. meteor collections Meteor stores data in Collections The special thing about collections in Meteor is that they can be accessed from both the server and the client Views backed by a Collection will be updated reactively! <- Meteor.users
  • 25. Exercise 6Adding a form to add/update profile details Save profile data to Meteor.users Collection
  • 26. Exercise 8Query data from MongoDB, un-hardcode
  • 27. getting data from collections Collection.find( … ) MongoDB query object REACTIVE ENTITY!
  • 30. End of day 2https://clarencengoh.typeform.com/to/kjByjA