SlideShare uma empresa Scribd logo
Node.js Firebase
Jul 23, 2023
Node.js
Hello!
Brion Silva
Associate Technical Lead
brion@wso2.com
What is 🤔
4
RUNTIME
5
Created by RYAN DAHL in 2009
Allows to execute Javascript outside the
browser
Enables developers to write a full stack
application in JavaScript
Uses an event-driven, non-blocking I/O event
loop for handling concurrent requests.
Comes with a built in package manager.
Built on top of Chrome V8 Engine
Open Source & Cross Platform Fast & Efficient
󰞐 Source : https://github.com/nodejs/node
⬇ Download: https://nodejs.org/en/download/current
What’s
What is npm?
● npm is Node.js's package manager.
● It manages dependencies in Node.js projects.
● Developers can install open-source packages with ease.
● npm simplifies adding functionality to Node.js apps.
● It ensures version control for package consistency.
7
What’s Event Loop?
What is Event Loop?
9
1st PRIORITY - Call Stack
➡ Handles Synchronous Code
2nd PRIORITY - MICROTASK QUEUE
➡ Handles Promises and Microtasks
3rd PRIORITY - TASK QUEUE
➡ Handles Callbacks (From DOM
APIs, I/O operations, Timers, etc.)
RESTful API Development with Node.js
What is a RESTful API?
11
API: Application Programming Interface
REST: Representational State Transfer
✅ STANDARDIZED
✅ STATELESS
✅ PERFORMANT
REQUEST vs RESPONSE
12
HTTP Methods
13
CREATE
READ
UPDATE
DELETE
POST
GET
PUT
DELETE
14
Demo
15
Scenario Overview
IDEALIZE
API
Base URL: http://localhost:3000
Endpoints:
http://localhost:3000/authors
http://localhost:3000/sessions
The API should be able to provide the organizing
committee to manage and organize the sessions
organized as prerequisites for IDEALIZE 2023.
Requirements:
⭐ Should be able to fetch, add, update & delete authors.
⭐ Should be able to fetch, add, update & delete sessions.
⭐ Add, update & delete should be protected.
Supporting Software
16
Package Manager - npm
Web Framework - Express.js
Database System - Firestore
REST Client - Postman
💡Can also use yarn or pnpm as well.
💡Can also use Nest, Sails, Koa, etc.
💡Can also use MySQL, MongoDB, etc.
💡Can also use Insomnia, curl, etc.
17
🚀 Minimal API: index.js ↗
Structuring the API
Controllers
Modules or functions that handle the business
logic for specific API endpoints.
Routes
HTTP methods that clients can use to interact
with the API.
Middleware
Functions that have access to the request and
response objects and can perform additional
processing before the final request handler
Folder Structure
18
󰞐 Code up to now: source ↗
Firebase
Hello!
Omal Wijegunawardana
Senior Software Engineer
omal@wso2.com
What’s
What is Firebase?
● Firebase in NOT a database.
● A collection of backend cloud computing services by Google.
● There is a free tier to try out things.
● It offers following services (and more)
⦿ Databases
⦿ Authentication
⦿ Storage
⦿ Hosting
⦿ Compute units
⦿ Analytics
22
What’s
What is Cloud Firestore?
● NoSQL cloud database
● Collection/Document structure of data
● Store data in flexible, hierarchical data structures
● Integrate with web or mobile technologies with provided SDKs
● Realtime updates
● Offline support
● Scales automatically
24
25
Demo
26
What’s next?
● Use an IDaaS like Asgardeo to Authorize users accessing your API.
⦿ https://wso2.com/asgardeo
● Consuming configurations from .env files.
⦿ Do not push the original file to the repository.
⦿ Push a .env.sample file with placeholders.
● Use a logger for logging in useful actions that’ll come in handy for debugging.
⦿ https://www.npmjs.com/package/winston
● You may have to use additional tools.
⦿ `cors`
⦾ Handle cross origin requests when embedding the API in to a web application.
⦿ `dotenv`
⦾ Read environment variables from .env files.
Question Time!
wso2.com
Thanks!

Mais conteúdo relacionado

Semelhante a IDEALIZE 2023 - NodeJS & Firebase Session

Building a Distributed & Automated Open Source Program at Netflix
Building a Distributed & Automated Open Source Program at NetflixBuilding a Distributed & Automated Open Source Program at Netflix
Building a Distributed & Automated Open Source Program at Netflix
All Things Open
 
Tools and Recipes to Replatform Monolithic Apps to Modern Cloud Environments
Tools and Recipes to Replatform Monolithic Apps to Modern Cloud EnvironmentsTools and Recipes to Replatform Monolithic Apps to Modern Cloud Environments
Tools and Recipes to Replatform Monolithic Apps to Modern Cloud Environments
VMware Tanzu
 
What is Google Cloud Platform - GDG DevFest 18 Depok
What is Google Cloud Platform - GDG DevFest 18 DepokWhat is Google Cloud Platform - GDG DevFest 18 Depok
What is Google Cloud Platform - GDG DevFest 18 Depok
Imre Nagi
 
Wie macht man aus Software einen Online-Service in der Cloud
Wie macht man aus Software einen Online-Service in der CloudWie macht man aus Software einen Online-Service in der Cloud
Wie macht man aus Software einen Online-Service in der Cloud
Aarno Aukia
 
Red Hat Forum Benelux 2015
Red Hat Forum Benelux 2015Red Hat Forum Benelux 2015
Red Hat Forum Benelux 2015
Microsoft
 
Top 13 Backend Frameworks for Web development in 2024
Top 13 Backend Frameworks for Web development in 2024Top 13 Backend Frameworks for Web development in 2024
Top 13 Backend Frameworks for Web development in 2024
Clarion Technologies
 
Gdsc muk - innocent
Gdsc   muk - innocentGdsc   muk - innocent
Gdsc muk - innocent
junaidhasan17
 
Top 11 Front-End Web Development Tools To Consider in 2020
 Top 11 Front-End Web Development Tools To Consider in 2020 Top 11 Front-End Web Development Tools To Consider in 2020
Top 11 Front-End Web Development Tools To Consider in 2020
Katy Slemon
 
InterCon 2016 - SLA vs Agilidade: uso de microserviços e monitoramento de cloud
InterCon 2016 - SLA vs Agilidade: uso de microserviços e monitoramento de cloudInterCon 2016 - SLA vs Agilidade: uso de microserviços e monitoramento de cloud
InterCon 2016 - SLA vs Agilidade: uso de microserviços e monitoramento de cloud
iMasters
 
Node js for beginners
Node js for beginnersNode js for beginners
Node js for beginners
Arjun Sreekumar
 
Important Backend Frameworks To Remember For Businesses In 2023
Important Backend Frameworks To Remember For Businesses In 2023Important Backend Frameworks To Remember For Businesses In 2023
Important Backend Frameworks To Remember For Businesses In 2023
Netizens Technologies
 
Industrial Training.pptx
Industrial Training.pptxIndustrial Training.pptx
Industrial Training.pptx
SamraatBansal1
 
Understanding Node.js and Django.docx
Understanding Node.js and Django.docxUnderstanding Node.js and Django.docx
Understanding Node.js and Django.docx
Savior_Marketing
 
Red Hat Java Update and Quarkus Introduction
Red Hat Java Update and Quarkus IntroductionRed Hat Java Update and Quarkus Introduction
Red Hat Java Update and Quarkus Introduction
John Archer
 
Exploring Next Generation Buildpacks - Anand Rao & Scott Deeg
Exploring Next Generation Buildpacks - Anand Rao & Scott DeegExploring Next Generation Buildpacks - Anand Rao & Scott Deeg
Exploring Next Generation Buildpacks - Anand Rao & Scott Deeg
VMware Tanzu
 
Ultimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on KubernetesUltimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on Kubernetes
kloia
 
Nodejs framework for app development.pdf
Nodejs framework for app development.pdfNodejs framework for app development.pdf
Nodejs framework for app development.pdf
Sufalam Technologies
 
NodeJS VS Python
NodeJS VS PythonNodeJS VS Python
NodeJS VS Python
Krishang Technolab
 
Joseph Ardolino CV (1)
Joseph Ardolino CV (1)Joseph Ardolino CV (1)
Joseph Ardolino CV (1)
Joe Ardolino
 
Mastinder singh visualcv_resume
Mastinder singh visualcv_resumeMastinder singh visualcv_resume
Mastinder singh visualcv_resume
Mastinder Singh
 

Semelhante a IDEALIZE 2023 - NodeJS & Firebase Session (20)

Building a Distributed & Automated Open Source Program at Netflix
Building a Distributed & Automated Open Source Program at NetflixBuilding a Distributed & Automated Open Source Program at Netflix
Building a Distributed & Automated Open Source Program at Netflix
 
Tools and Recipes to Replatform Monolithic Apps to Modern Cloud Environments
Tools and Recipes to Replatform Monolithic Apps to Modern Cloud EnvironmentsTools and Recipes to Replatform Monolithic Apps to Modern Cloud Environments
Tools and Recipes to Replatform Monolithic Apps to Modern Cloud Environments
 
What is Google Cloud Platform - GDG DevFest 18 Depok
What is Google Cloud Platform - GDG DevFest 18 DepokWhat is Google Cloud Platform - GDG DevFest 18 Depok
What is Google Cloud Platform - GDG DevFest 18 Depok
 
Wie macht man aus Software einen Online-Service in der Cloud
Wie macht man aus Software einen Online-Service in der CloudWie macht man aus Software einen Online-Service in der Cloud
Wie macht man aus Software einen Online-Service in der Cloud
 
Red Hat Forum Benelux 2015
Red Hat Forum Benelux 2015Red Hat Forum Benelux 2015
Red Hat Forum Benelux 2015
 
Top 13 Backend Frameworks for Web development in 2024
Top 13 Backend Frameworks for Web development in 2024Top 13 Backend Frameworks for Web development in 2024
Top 13 Backend Frameworks for Web development in 2024
 
Gdsc muk - innocent
Gdsc   muk - innocentGdsc   muk - innocent
Gdsc muk - innocent
 
Top 11 Front-End Web Development Tools To Consider in 2020
 Top 11 Front-End Web Development Tools To Consider in 2020 Top 11 Front-End Web Development Tools To Consider in 2020
Top 11 Front-End Web Development Tools To Consider in 2020
 
InterCon 2016 - SLA vs Agilidade: uso de microserviços e monitoramento de cloud
InterCon 2016 - SLA vs Agilidade: uso de microserviços e monitoramento de cloudInterCon 2016 - SLA vs Agilidade: uso de microserviços e monitoramento de cloud
InterCon 2016 - SLA vs Agilidade: uso de microserviços e monitoramento de cloud
 
Node js for beginners
Node js for beginnersNode js for beginners
Node js for beginners
 
Important Backend Frameworks To Remember For Businesses In 2023
Important Backend Frameworks To Remember For Businesses In 2023Important Backend Frameworks To Remember For Businesses In 2023
Important Backend Frameworks To Remember For Businesses In 2023
 
Industrial Training.pptx
Industrial Training.pptxIndustrial Training.pptx
Industrial Training.pptx
 
Understanding Node.js and Django.docx
Understanding Node.js and Django.docxUnderstanding Node.js and Django.docx
Understanding Node.js and Django.docx
 
Red Hat Java Update and Quarkus Introduction
Red Hat Java Update and Quarkus IntroductionRed Hat Java Update and Quarkus Introduction
Red Hat Java Update and Quarkus Introduction
 
Exploring Next Generation Buildpacks - Anand Rao & Scott Deeg
Exploring Next Generation Buildpacks - Anand Rao & Scott DeegExploring Next Generation Buildpacks - Anand Rao & Scott Deeg
Exploring Next Generation Buildpacks - Anand Rao & Scott Deeg
 
Ultimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on KubernetesUltimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on Kubernetes
 
Nodejs framework for app development.pdf
Nodejs framework for app development.pdfNodejs framework for app development.pdf
Nodejs framework for app development.pdf
 
NodeJS VS Python
NodeJS VS PythonNodeJS VS Python
NodeJS VS Python
 
Joseph Ardolino CV (1)
Joseph Ardolino CV (1)Joseph Ardolino CV (1)
Joseph Ardolino CV (1)
 
Mastinder singh visualcv_resume
Mastinder singh visualcv_resumeMastinder singh visualcv_resume
Mastinder singh visualcv_resume
 

Último

Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
gray level transformation unit 3(image processing))
gray level transformation unit 3(image processing))gray level transformation unit 3(image processing))
gray level transformation unit 3(image processing))
shivani5543
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
SUTEJAS
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
Hitesh Mohapatra
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
KrishnaveniKrishnara1
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
jpsjournal1
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
171ticu
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
Rahul
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
IJECEIAES
 
The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.
sachin chaurasia
 
Casting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdfCasting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdf
zubairahmad848137
 
Introduction to AI Safety (public presentation).pptx
Introduction to AI Safety (public presentation).pptxIntroduction to AI Safety (public presentation).pptx
Introduction to AI Safety (public presentation).pptx
MiscAnnoy1
 
Hematology Analyzer Machine - Complete Blood Count
Hematology Analyzer Machine - Complete Blood CountHematology Analyzer Machine - Complete Blood Count
Hematology Analyzer Machine - Complete Blood Count
shahdabdulbaset
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
Madan Karki
 
Engine Lubrication performance System.pdf
Engine Lubrication performance System.pdfEngine Lubrication performance System.pdf
Engine Lubrication performance System.pdf
mamamaam477
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
IJECEIAES
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Sinan KOZAK
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Christina Lin
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
Victor Morales
 
Transformers design and coooling methods
Transformers design and coooling methodsTransformers design and coooling methods
Transformers design and coooling methods
Roger Rozario
 

Último (20)

Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
gray level transformation unit 3(image processing))
gray level transformation unit 3(image processing))gray level transformation unit 3(image processing))
gray level transformation unit 3(image processing))
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
 
The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.
 
Casting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdfCasting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdf
 
Introduction to AI Safety (public presentation).pptx
Introduction to AI Safety (public presentation).pptxIntroduction to AI Safety (public presentation).pptx
Introduction to AI Safety (public presentation).pptx
 
Hematology Analyzer Machine - Complete Blood Count
Hematology Analyzer Machine - Complete Blood CountHematology Analyzer Machine - Complete Blood Count
Hematology Analyzer Machine - Complete Blood Count
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
 
Engine Lubrication performance System.pdf
Engine Lubrication performance System.pdfEngine Lubrication performance System.pdf
Engine Lubrication performance System.pdf
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
 
Transformers design and coooling methods
Transformers design and coooling methodsTransformers design and coooling methods
Transformers design and coooling methods
 

IDEALIZE 2023 - NodeJS & Firebase Session

  • 5. RUNTIME 5 Created by RYAN DAHL in 2009 Allows to execute Javascript outside the browser Enables developers to write a full stack application in JavaScript Uses an event-driven, non-blocking I/O event loop for handling concurrent requests. Comes with a built in package manager. Built on top of Chrome V8 Engine Open Source & Cross Platform Fast & Efficient 󰞐 Source : https://github.com/nodejs/node ⬇ Download: https://nodejs.org/en/download/current
  • 7. What is npm? ● npm is Node.js's package manager. ● It manages dependencies in Node.js projects. ● Developers can install open-source packages with ease. ● npm simplifies adding functionality to Node.js apps. ● It ensures version control for package consistency. 7
  • 9. What is Event Loop? 9 1st PRIORITY - Call Stack ➡ Handles Synchronous Code 2nd PRIORITY - MICROTASK QUEUE ➡ Handles Promises and Microtasks 3rd PRIORITY - TASK QUEUE ➡ Handles Callbacks (From DOM APIs, I/O operations, Timers, etc.)
  • 10. RESTful API Development with Node.js
  • 11. What is a RESTful API? 11 API: Application Programming Interface REST: Representational State Transfer ✅ STANDARDIZED ✅ STATELESS ✅ PERFORMANT
  • 15. 15 Scenario Overview IDEALIZE API Base URL: http://localhost:3000 Endpoints: http://localhost:3000/authors http://localhost:3000/sessions The API should be able to provide the organizing committee to manage and organize the sessions organized as prerequisites for IDEALIZE 2023. Requirements: ⭐ Should be able to fetch, add, update & delete authors. ⭐ Should be able to fetch, add, update & delete sessions. ⭐ Add, update & delete should be protected.
  • 16. Supporting Software 16 Package Manager - npm Web Framework - Express.js Database System - Firestore REST Client - Postman 💡Can also use yarn or pnpm as well. 💡Can also use Nest, Sails, Koa, etc. 💡Can also use MySQL, MongoDB, etc. 💡Can also use Insomnia, curl, etc.
  • 17. 17 🚀 Minimal API: index.js ↗ Structuring the API Controllers Modules or functions that handle the business logic for specific API endpoints. Routes HTTP methods that clients can use to interact with the API. Middleware Functions that have access to the request and response objects and can perform additional processing before the final request handler Folder Structure
  • 18. 18 󰞐 Code up to now: source ↗
  • 22. What is Firebase? ● Firebase in NOT a database. ● A collection of backend cloud computing services by Google. ● There is a free tier to try out things. ● It offers following services (and more) ⦿ Databases ⦿ Authentication ⦿ Storage ⦿ Hosting ⦿ Compute units ⦿ Analytics 22
  • 24. What is Cloud Firestore? ● NoSQL cloud database ● Collection/Document structure of data ● Store data in flexible, hierarchical data structures ● Integrate with web or mobile technologies with provided SDKs ● Realtime updates ● Offline support ● Scales automatically 24
  • 26. 26 What’s next? ● Use an IDaaS like Asgardeo to Authorize users accessing your API. ⦿ https://wso2.com/asgardeo ● Consuming configurations from .env files. ⦿ Do not push the original file to the repository. ⦿ Push a .env.sample file with placeholders. ● Use a logger for logging in useful actions that’ll come in handy for debugging. ⦿ https://www.npmjs.com/package/winston ● You may have to use additional tools. ⦿ `cors` ⦾ Handle cross origin requests when embedding the API in to a web application. ⦿ `dotenv` ⦾ Read environment variables from .env files.