SlideShare ist ein Scribd-Unternehmen logo
1 von 16
Downloaden Sie, um offline zu lesen
API Economy
A NestJS adventure
17 December 2020
Michele Mastrogiovanni
Michele Mastrogiovanni
Who am I
Ph.D. in computer science @ La Sapienza (Roma):
a wonderful period of my life!
Former Engineering ingegneria informatica
Former Expedia Group (Hotels.com)
Former Konica Minolta
And since “I'm hungry, I'm foolish… (thanks Steve
Jobs) I started in October to work as CTO @
Stonize
Michele Mastrogiovanni
Agenda
1. What is an API and what does API Market mean
2. The “Facts” Project need to go in PRODUCTION
3. NestJS introduction and coding
Michele Mastrogiovanni
What is an API?
Application Programming Interface: A way to interact with your software
Examples: Microservices, IoT services…
The following expose API for their services:
● Google
● Facebook
● Twitter
● Telegram
● ...
Michele Mastrogiovanni
Why create an API for your Business?
Easy customer integration/adoption
Enforce standardisation
Enable your business on pay per use
Can be included in existing marketplace
Mobile friendly
...
Open your wonderful AI stock prediction engine to the world!
Michele Mastrogiovanni
Just few data
Source: https://media2.govtech.com/images/api_infographic_smartfile.jpg
Michele Mastrogiovanni
API Architecture (not today, baby!)
Reverse Proxy
CDN (Content Delivery Network)
API Gateway
Firewall
Load Balancers
...
Michele Mastrogiovanni
API Landscape
And many others
AWS Cognito
Michele Mastrogiovanni
API Design: why NestJS?
● Well designed
● Well documented
● Spring-Like
● Dependency Injection
● Annotated
Michele Mastrogiovanni
We work for the Stonize company
We need to create an API for our most
valuable service “Chuck Norris Facts”.
We need to go… in production!!!
Stonize Pillars
● Quality
● Security
● Performances
The “Facts” Project
High performant,
Reliable, Efficient,
Privacy Aware,
Secure, Testable,
Fault tolerant
...
Michele Mastrogiovanni
● Unit tests
● End-to-End tests
● Quality metrics: coverage, static code analysis...
● ...Did I mention to test the code?
● Code review
● Standard responses
● Validation everywhere: DTO, responses,
extreme conditions...
● Documentation: e.g. OpenAPI (Swagger API)
● Monitoring in production
Stonize’s pillars: Quality (1/3)
Michele Mastrogiovanni
Stonize’s pillars: Security (2/3)
External threats
● Authorization and authentication (e.g. JWT token)
● Headers protection
● Upload limits
● DoS protection (whitelist/blacklist)
● Throttling: Rate Limiting
● Penetration tests
● Software vulnerabilities
● ...
Internal risks
● Log’s anonymity
● ...
Michele Mastrogiovanni
Stonize’s pillars: Performance (3/3)
● Use of Cache
● Compression
● CDN for static contents
● Scalable architecture (someone mentioned containers?)
● Distribute load / Automatic provisioning
● Leverage also on client computational power
● Performance test
● ...
Michele Mastrogiovanni
Demo Time: let’s rock some code!
15
Thank you!
Michele Mastrogiovanni
michele.mastrogiovanni@stonize.com
https://www.linkedin.com/in/michele-mastrogiovanni/
Michele Mastrogiovanni
Resources
NestJS: https://www.postman.com/
Postman: https://www.postman.com/
Portainer:
https://documentation.portainer.io/v2.0/deploy/linux/#deploy-portainer-in-docker
HTTPie: https://httpie.io/
Chuck Norris Facts: https://chucknorrisfacts.net/top-100
Code: https://github.com/mastrogiovanni/codegarden-API-nest-17-12-2020

Weitere ähnliche Inhalte

Ähnlich wie Codegarden - API economy (NestJs)

Technology scouting and how to exploit the periphery dbm workshop
Technology scouting and how to exploit the periphery dbm workshopTechnology scouting and how to exploit the periphery dbm workshop
Technology scouting and how to exploit the periphery dbm workshopStefano Mizio
 
Empirical evaluation in 2020: how big, how beautiful?
Empirical evaluation in 2020: how big, how beautiful?Empirical evaluation in 2020: how big, how beautiful?
Empirical evaluation in 2020: how big, how beautiful?Massimiliano Di Penta
 
UX Workshop: How to design a product with great user experience
UX Workshop: How to design a product with great user experienceUX Workshop: How to design a product with great user experience
UX Workshop: How to design a product with great user experienceRaj Lal
 
INSECURE Magazine - 35
INSECURE Magazine - 35INSECURE Magazine - 35
INSECURE Magazine - 35Felipe Prado
 
CSA Raleigh application security and deception in the cloud
CSA Raleigh   application security and deception in the cloudCSA Raleigh   application security and deception in the cloud
CSA Raleigh application security and deception in the cloudPhillip Maddux
 
Log Analytics for Distributed Microservices
Log Analytics for Distributed MicroservicesLog Analytics for Distributed Microservices
Log Analytics for Distributed MicroservicesKai Wähner
 
Microservices: The Future-Proof Framework for IoT
Microservices: The Future-Proof Framework for IoTMicroservices: The Future-Proof Framework for IoT
Microservices: The Future-Proof Framework for IoTCapgemini
 
Stermedia - AI and software solutions for manufacturing/industry 4.0
Stermedia - AI and software solutions for manufacturing/industry 4.0Stermedia - AI and software solutions for manufacturing/industry 4.0
Stermedia - AI and software solutions for manufacturing/industry 4.0stermedia
 
Penetration testing as an internal audit activity
Penetration testing as an internal audit activityPenetration testing as an internal audit activity
Penetration testing as an internal audit activityTranscendent Group
 
System Security @ NECSTLab and Breaking the Laws of Robotics: Attacking Indus...
System Security @ NECSTLab and Breaking the Laws of Robotics: Attacking Indus...System Security @ NECSTLab and Breaking the Laws of Robotics: Attacking Indus...
System Security @ NECSTLab and Breaking the Laws of Robotics: Attacking Indus...NECST Lab @ Politecnico di Milano
 
Spellpoint - Securing Access for Microservices
Spellpoint - Securing Access for MicroservicesSpellpoint - Securing Access for Microservices
Spellpoint - Securing Access for MicroservicesUbisecure
 
Towards an Effective Process Improvement Platform: Spago4Q and the QEST nD Mo...
Towards an Effective Process Improvement Platform: Spago4Q and the QEST nD Mo...Towards an Effective Process Improvement Platform: Spago4Q and the QEST nD Mo...
Towards an Effective Process Improvement Platform: Spago4Q and the QEST nD Mo...SpagoWorld
 
EMFcamp2022 - What if apps logged into you, instead of you logging into apps?
EMFcamp2022 - What if apps logged into you, instead of you logging into apps?EMFcamp2022 - What if apps logged into you, instead of you logging into apps?
EMFcamp2022 - What if apps logged into you, instead of you logging into apps?Chris Swan
 
DevOps at ING Analytics: combining data engineering with data operations - Gi...
DevOps at ING Analytics: combining data engineering with data operations - Gi...DevOps at ING Analytics: combining data engineering with data operations - Gi...
DevOps at ING Analytics: combining data engineering with data operations - Gi...Codemotion
 
Trends on Data Graphs & Security for the Internet of Things
Trends on Data Graphs & Security for the Internet of ThingsTrends on Data Graphs & Security for the Internet of Things
Trends on Data Graphs & Security for the Internet of ThingsGhislain Atemezing
 
Software Engineering Research @ Simula
Software Engineering Research @ SimulaSoftware Engineering Research @ Simula
Software Engineering Research @ SimulaPhu H. Nguyen
 
Identity Management with midPoint
Identity Management with midPointIdentity Management with midPoint
Identity Management with midPointRadovan Semancik
 
Current state of industrial IoT / Industrie 4.0 markets - IoT Tech Expo
Current state of industrial IoT / Industrie 4.0 markets - IoT Tech ExpoCurrent state of industrial IoT / Industrie 4.0 markets - IoT Tech Expo
Current state of industrial IoT / Industrie 4.0 markets - IoT Tech ExpoIoTAnalytics
 

Ähnlich wie Codegarden - API economy (NestJs) (20)

Technology scouting and how to exploit the periphery dbm workshop
Technology scouting and how to exploit the periphery dbm workshopTechnology scouting and how to exploit the periphery dbm workshop
Technology scouting and how to exploit the periphery dbm workshop
 
Empirical evaluation in 2020: how big, how beautiful?
Empirical evaluation in 2020: how big, how beautiful?Empirical evaluation in 2020: how big, how beautiful?
Empirical evaluation in 2020: how big, how beautiful?
 
UX Workshop: How to design a product with great user experience
UX Workshop: How to design a product with great user experienceUX Workshop: How to design a product with great user experience
UX Workshop: How to design a product with great user experience
 
INSECURE Magazine - 35
INSECURE Magazine - 35INSECURE Magazine - 35
INSECURE Magazine - 35
 
CSA Raleigh application security and deception in the cloud
CSA Raleigh   application security and deception in the cloudCSA Raleigh   application security and deception in the cloud
CSA Raleigh application security and deception in the cloud
 
Log Analytics for Distributed Microservices
Log Analytics for Distributed MicroservicesLog Analytics for Distributed Microservices
Log Analytics for Distributed Microservices
 
Microservices: The Future-Proof Framework for IoT
Microservices: The Future-Proof Framework for IoTMicroservices: The Future-Proof Framework for IoT
Microservices: The Future-Proof Framework for IoT
 
IOT Consulting Service in Bangalore
IOT Consulting Service in BangaloreIOT Consulting Service in Bangalore
IOT Consulting Service in Bangalore
 
Stermedia - AI and software solutions for manufacturing/industry 4.0
Stermedia - AI and software solutions for manufacturing/industry 4.0Stermedia - AI and software solutions for manufacturing/industry 4.0
Stermedia - AI and software solutions for manufacturing/industry 4.0
 
Penetration testing as an internal audit activity
Penetration testing as an internal audit activityPenetration testing as an internal audit activity
Penetration testing as an internal audit activity
 
System Security @ NECSTLab and Breaking the Laws of Robotics: Attacking Indus...
System Security @ NECSTLab and Breaking the Laws of Robotics: Attacking Indus...System Security @ NECSTLab and Breaking the Laws of Robotics: Attacking Indus...
System Security @ NECSTLab and Breaking the Laws of Robotics: Attacking Indus...
 
Spellpoint - Securing Access for Microservices
Spellpoint - Securing Access for MicroservicesSpellpoint - Securing Access for Microservices
Spellpoint - Securing Access for Microservices
 
Towards an Effective Process Improvement Platform: Spago4Q and the QEST nD Mo...
Towards an Effective Process Improvement Platform: Spago4Q and the QEST nD Mo...Towards an Effective Process Improvement Platform: Spago4Q and the QEST nD Mo...
Towards an Effective Process Improvement Platform: Spago4Q and the QEST nD Mo...
 
Kba talk track 2018
Kba talk track 2018Kba talk track 2018
Kba talk track 2018
 
EMFcamp2022 - What if apps logged into you, instead of you logging into apps?
EMFcamp2022 - What if apps logged into you, instead of you logging into apps?EMFcamp2022 - What if apps logged into you, instead of you logging into apps?
EMFcamp2022 - What if apps logged into you, instead of you logging into apps?
 
DevOps at ING Analytics: combining data engineering with data operations - Gi...
DevOps at ING Analytics: combining data engineering with data operations - Gi...DevOps at ING Analytics: combining data engineering with data operations - Gi...
DevOps at ING Analytics: combining data engineering with data operations - Gi...
 
Trends on Data Graphs & Security for the Internet of Things
Trends on Data Graphs & Security for the Internet of ThingsTrends on Data Graphs & Security for the Internet of Things
Trends on Data Graphs & Security for the Internet of Things
 
Software Engineering Research @ Simula
Software Engineering Research @ SimulaSoftware Engineering Research @ Simula
Software Engineering Research @ Simula
 
Identity Management with midPoint
Identity Management with midPointIdentity Management with midPoint
Identity Management with midPoint
 
Current state of industrial IoT / Industrie 4.0 markets - IoT Tech Expo
Current state of industrial IoT / Industrie 4.0 markets - IoT Tech ExpoCurrent state of industrial IoT / Industrie 4.0 markets - IoT Tech Expo
Current state of industrial IoT / Industrie 4.0 markets - IoT Tech Expo
 

Kürzlich hochgeladen

JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)Max Lee
 
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdfImplementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdfVictor Lopez
 
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...naitiksharma1124
 
How to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabberHow to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabbereGrabber
 
What need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java DevelopersWhat need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java DevelopersEmilyJiang23
 
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1KnowledgeSeed
 
Microsoft 365 Copilot; An AI tool changing the world of work _PDF.pdf
Microsoft 365 Copilot; An AI tool changing the world of work _PDF.pdfMicrosoft 365 Copilot; An AI tool changing the world of work _PDF.pdf
Microsoft 365 Copilot; An AI tool changing the world of work _PDF.pdfQ-Advise
 
SQL Injection Introduction and Prevention
SQL Injection Introduction and PreventionSQL Injection Introduction and Prevention
SQL Injection Introduction and PreventionMohammed Fazuluddin
 
APVP,apvp apvp High quality supplier safe spot transport, 98% purity
APVP,apvp apvp High quality supplier safe spot transport, 98% purityAPVP,apvp apvp High quality supplier safe spot transport, 98% purity
APVP,apvp apvp High quality supplier safe spot transport, 98% purityamy56318795
 
Agnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in KrakówAgnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in Krakówbim.edu.pl
 
A Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data MigrationA Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data MigrationHelp Desk Migration
 
INGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by DesignINGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by DesignNeo4j
 
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...Andrea Goulet
 
OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024Shane Coughlan
 
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAGAI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAGAlluxio, Inc.
 
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Gáspár Nagy
 
CompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdfCompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdfFurqanuddin10
 
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...Alluxio, Inc.
 
how-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdfhow-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdfMehmet Akar
 
IT Software Development Resume, Vaibhav jha 2024
IT Software Development Resume, Vaibhav jha 2024IT Software Development Resume, Vaibhav jha 2024
IT Software Development Resume, Vaibhav jha 2024vaibhav130304
 

Kürzlich hochgeladen (20)

JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)
 
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdfImplementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
 
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
 
How to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabberHow to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabber
 
What need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java DevelopersWhat need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java Developers
 
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
 
Microsoft 365 Copilot; An AI tool changing the world of work _PDF.pdf
Microsoft 365 Copilot; An AI tool changing the world of work _PDF.pdfMicrosoft 365 Copilot; An AI tool changing the world of work _PDF.pdf
Microsoft 365 Copilot; An AI tool changing the world of work _PDF.pdf
 
SQL Injection Introduction and Prevention
SQL Injection Introduction and PreventionSQL Injection Introduction and Prevention
SQL Injection Introduction and Prevention
 
APVP,apvp apvp High quality supplier safe spot transport, 98% purity
APVP,apvp apvp High quality supplier safe spot transport, 98% purityAPVP,apvp apvp High quality supplier safe spot transport, 98% purity
APVP,apvp apvp High quality supplier safe spot transport, 98% purity
 
Agnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in KrakówAgnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in Kraków
 
A Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data MigrationA Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data Migration
 
INGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by DesignINGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by Design
 
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
 
OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024
 
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAGAI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
 
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
 
CompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdfCompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdf
 
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
 
how-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdfhow-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdf
 
IT Software Development Resume, Vaibhav jha 2024
IT Software Development Resume, Vaibhav jha 2024IT Software Development Resume, Vaibhav jha 2024
IT Software Development Resume, Vaibhav jha 2024
 

Codegarden - API economy (NestJs)

  • 1. API Economy A NestJS adventure 17 December 2020 Michele Mastrogiovanni
  • 2. Michele Mastrogiovanni Who am I Ph.D. in computer science @ La Sapienza (Roma): a wonderful period of my life! Former Engineering ingegneria informatica Former Expedia Group (Hotels.com) Former Konica Minolta And since “I'm hungry, I'm foolish… (thanks Steve Jobs) I started in October to work as CTO @ Stonize
  • 3. Michele Mastrogiovanni Agenda 1. What is an API and what does API Market mean 2. The “Facts” Project need to go in PRODUCTION 3. NestJS introduction and coding
  • 4. Michele Mastrogiovanni What is an API? Application Programming Interface: A way to interact with your software Examples: Microservices, IoT services… The following expose API for their services: ● Google ● Facebook ● Twitter ● Telegram ● ...
  • 5. Michele Mastrogiovanni Why create an API for your Business? Easy customer integration/adoption Enforce standardisation Enable your business on pay per use Can be included in existing marketplace Mobile friendly ... Open your wonderful AI stock prediction engine to the world!
  • 6. Michele Mastrogiovanni Just few data Source: https://media2.govtech.com/images/api_infographic_smartfile.jpg
  • 7. Michele Mastrogiovanni API Architecture (not today, baby!) Reverse Proxy CDN (Content Delivery Network) API Gateway Firewall Load Balancers ...
  • 9. Michele Mastrogiovanni API Design: why NestJS? ● Well designed ● Well documented ● Spring-Like ● Dependency Injection ● Annotated
  • 10. Michele Mastrogiovanni We work for the Stonize company We need to create an API for our most valuable service “Chuck Norris Facts”. We need to go… in production!!! Stonize Pillars ● Quality ● Security ● Performances The “Facts” Project High performant, Reliable, Efficient, Privacy Aware, Secure, Testable, Fault tolerant ...
  • 11. Michele Mastrogiovanni ● Unit tests ● End-to-End tests ● Quality metrics: coverage, static code analysis... ● ...Did I mention to test the code? ● Code review ● Standard responses ● Validation everywhere: DTO, responses, extreme conditions... ● Documentation: e.g. OpenAPI (Swagger API) ● Monitoring in production Stonize’s pillars: Quality (1/3)
  • 12. Michele Mastrogiovanni Stonize’s pillars: Security (2/3) External threats ● Authorization and authentication (e.g. JWT token) ● Headers protection ● Upload limits ● DoS protection (whitelist/blacklist) ● Throttling: Rate Limiting ● Penetration tests ● Software vulnerabilities ● ... Internal risks ● Log’s anonymity ● ...
  • 13. Michele Mastrogiovanni Stonize’s pillars: Performance (3/3) ● Use of Cache ● Compression ● CDN for static contents ● Scalable architecture (someone mentioned containers?) ● Distribute load / Automatic provisioning ● Leverage also on client computational power ● Performance test ● ...
  • 14. Michele Mastrogiovanni Demo Time: let’s rock some code!
  • 16. Michele Mastrogiovanni Resources NestJS: https://www.postman.com/ Postman: https://www.postman.com/ Portainer: https://documentation.portainer.io/v2.0/deploy/linux/#deploy-portainer-in-docker HTTPie: https://httpie.io/ Chuck Norris Facts: https://chucknorrisfacts.net/top-100 Code: https://github.com/mastrogiovanni/codegarden-API-nest-17-12-2020