SlideShare uma empresa Scribd logo
1 de 34
Baixar para ler offline
Agenda
Blockchain & IPFS basics
➔ Why blockchain has fees
➔ How to connect to a blockchain
➔ How to work with keys
➔ Introduction to IPFS and motivation for
using IPFS together with blockchain
➔ Introduction to Subsocial and its SDK
Understanding the basics of Next.js power
➔ Kinds of renders (SSR, SSG, ISR)
➔ Routing
➔ Compressing images
➔ API out of the box
Development
➔ Incorporating user authentication using
key pair generation
➔ Setting up a captcha for spam
protection
➔ Incorporating data storage using IPFS
➔ Optimizing app speed using Next.js
features
Deployment
➔ Deploying the chat on Vercel
Blockchain & IPFS basics
What is
Blockchain?
A decentralized and distributed
database technology, differs from
centralized databases by storing data
across multiple nodes without a
governing central authority.
Consisting of blocks linked by
cryptographic hashes, blockchains
ensure secure, tamper-proof data
chains with immutable content that
cannot be altered without network
consensus.
What is the main difference in interacting with a blockchain
compared to databases?
Fees
Prevent spam and malicious
transactions, promote efficient
network usage.
Why blockchain has fees?
Incentivize miners/validators:
Encourage participation and
maintain network security.
Users pay fees for blockchain
transactions because blockchains
rely on fees to maintain network
operations.
Network security: Fees raise
the cost of potential attacks,
ensuring a more secure and
stable network.
How to connect to
a blockchain?
An RPC node facilitates
communication between nodes
in a blockchain network. It
enables user interaction with the
blockchain via APIs.
RPC node is a program on a
computer that receives and
responds to requests from other
network nodes.
JSON-RPC for public
or own nodes
➔ HTTP
➔ WS
JS libraries:
➔ Ethereum: web3.js, either.js,
wagmi
➔ Polkadot: @polkadot/api
➔ Subsocial: @subsocial/api
➔ GraphQL
JSON-RPC Examples
JS SDKs Examples
Frontend
How to work with
keys?
Public Key:
➔ Used as an identifier.
➔ Can be safely shared.
➔ Validates signature
authenticity.
Private Key:
➔ Stored secretly on the user's
side.
➔ Signs transactions, providing
cryptographic proof of identity.
➔ Losing the key equates to
losing the account.
Backend
Introduction to IPFS - InterPlanetary File System
IPFS is a set of peer-to-peer protocols for decentralized file systems, enabling resilient
networks with persistent availability, even without internet backbone connectivity.
What is motivation for using IPFS together with blockchain
Cost Reduction
Storing data on a blockchain can be
expensive due to transaction fees and
storage constraints. Integrating IPFS
with blockchain allows for off-chain
storage of large data while maintaining
the data's integrity.
Improved Performance
IPFS enables faster data retrieval
and distribution, as users can
access files from multiple sources
simultaneously.
Scalability
IPFS can efficiently distribute and store
large amounts of data. By integrating
IPFS with blockchain, the limitations of
blockchain storage can be addressed.
Censorship resistant storing
IPFS's decentralized and distributed
nature makes saved data more
resilient to censorship compared to
traditional centralized systems.
What is Subsocial?
A Layer 1 blockchain based on Substrate framework designed specifically for social
networking. Subsocial provide social primitives suitable for many social use case
Click-to-deploy
dapps
Interactive
media
DAO
communities
Photo/video
sharing
Career
networking
E-commerce
storefronts
Solidity
Rust
JavaScript
❌
❌
✅
Understanding the basics of
Next.js
Disclaimer: We are looking at the stable version of Next.js. Currently, there is a
Beta version that offers a different project structure, but this concept remains
the same, only the organization style changes.
Kind of renders (CSR, SSR, SSG, ISR)
Well-defined structure (based on pages!)
main wrapper for application: _app.js
Main wrapper for the application. You could add a reusable layout
here.
Dynamic routes
Next.js pages examples
Optimization from the Box
Optimizing Images
Size Optimization:
Automatically serve correctly
sized images for each device,
using modern image formats
like WebP and AVIF.
Visual Stability: Prevent layout
shift automatically when
images are loading.
Faster Page Loads: Images are
only loaded when they enter the
viewport using native browser
lazy loading, with optional
blur-up placeholders.
Optimization from the Box
Layouts:
Many of these
components are often
reused between pages.
For example, you might
have the same navigation
bar and footer on every
page or particular pages
API Routes
Any file inside the folder pages/api is mapped to /api/* and will be treated as an API endpoint instead
of a page. They are server-side only bundles and won't increase your client-side bundle size.
Development
Tech stack: Next.js, SWR, Typescript, TailwindCSS, Subsocial SDK
What modules do we need to build a typical chat?
What modules do we need to build a typical chat?
➔ Database
➔ Auth service
➔ CRUD backend
➔ Real-time fetching messages (websocket)
➔ Frontend interface
What modules do we need to build decentralized chat?
➔ Database (Blockchain + IPFS)
➔ Auth service (Based on blockchain accounts)
➔ CRUD backend (Blockchain modules)
➔ Real-time fetching messages (ws subscription
out of the box)
➔ Frontend interface (Your own part)
Connect to Blockchain
Fetch messages from blockchain with Subscription
Login with accounts
Transaction sending
Captcha
Next.js optimizations
Deployment
➔ Deploying the chat on Vercel

Mais conteúdo relacionado

Semelhante a Workshop "Building Decentralised Chat with Next.js", Oleh Melnychuk

Building Killer RESTful APIs with NodeJs
Building Killer RESTful APIs with NodeJsBuilding Killer RESTful APIs with NodeJs
Building Killer RESTful APIs with NodeJsSrdjan Strbanovic
 
Asp. net core 3.0 build modern web and cloud applications (top 13 features +...
Asp. net core 3.0  build modern web and cloud applications (top 13 features +...Asp. net core 3.0  build modern web and cloud applications (top 13 features +...
Asp. net core 3.0 build modern web and cloud applications (top 13 features +...Katy Slemon
 
Billions of Messages in Real Time: Why Paypal & LinkedIn Trust an Engagement ...
Billions of Messages in Real Time: Why Paypal & LinkedIn Trust an Engagement ...Billions of Messages in Real Time: Why Paypal & LinkedIn Trust an Engagement ...
Billions of Messages in Real Time: Why Paypal & LinkedIn Trust an Engagement ...confluent
 
Privacy Preservation in cloud Environment using AES Algorithm
Privacy Preservation in cloud Environment using AES AlgorithmPrivacy Preservation in cloud Environment using AES Algorithm
Privacy Preservation in cloud Environment using AES AlgorithmIRJET Journal
 
Getting started with dotnet core Web APIs
Getting started with dotnet core Web APIsGetting started with dotnet core Web APIs
Getting started with dotnet core Web APIsKnoldus Inc.
 
Cloud Deployment Toolkit
Cloud Deployment ToolkitCloud Deployment Toolkit
Cloud Deployment ToolkitBret Piatt
 
Maginatics @ SDC 2013: Architecting An Enterprise Storage Platform Using Obje...
Maginatics @ SDC 2013: Architecting An Enterprise Storage Platform Using Obje...Maginatics @ SDC 2013: Architecting An Enterprise Storage Platform Using Obje...
Maginatics @ SDC 2013: Architecting An Enterprise Storage Platform Using Obje...Maginatics
 
(Speaker Notes Version) Architecting An Enterprise Storage Platform Using Obj...
(Speaker Notes Version) Architecting An Enterprise Storage Platform Using Obj...(Speaker Notes Version) Architecting An Enterprise Storage Platform Using Obj...
(Speaker Notes Version) Architecting An Enterprise Storage Platform Using Obj...Niraj Tolia
 
Couchbase - NoSQL for you! (SDP 2014)
Couchbase - NoSQL for you! (SDP 2014)Couchbase - NoSQL for you! (SDP 2014)
Couchbase - NoSQL for you! (SDP 2014)SirKetchup
 
Web Development with ASP.NET: Taking Control of the Digital World
Web Development with ASP.NET: Taking Control  of the Digital WorldWeb Development with ASP.NET: Taking Control  of the Digital World
Web Development with ASP.NET: Taking Control of the Digital Worldcompany
 
apidays LIVE Singapore 2022_Redesigning Data Architecture.pdf
apidays LIVE Singapore 2022_Redesigning Data Architecture.pdfapidays LIVE Singapore 2022_Redesigning Data Architecture.pdf
apidays LIVE Singapore 2022_Redesigning Data Architecture.pdfapidays
 
Comparing the Key Features of the Top Node.js Frameworks
Comparing the Key Features of the Top Node.js FrameworksComparing the Key Features of the Top Node.js Frameworks
Comparing the Key Features of the Top Node.js FrameworksTien Nguyen
 
Pivotal cloud cache for .net microservices
Pivotal cloud cache for .net microservicesPivotal cloud cache for .net microservices
Pivotal cloud cache for .net microservicesJagdish Mirani
 
IRJET- Distributed Decentralized Data Storage using IPFS
IRJET- Distributed Decentralized Data Storage using IPFSIRJET- Distributed Decentralized Data Storage using IPFS
IRJET- Distributed Decentralized Data Storage using IPFSIRJET Journal
 
APIs & Underlying Protocols #APICraftSF
APIs & Underlying Protocols #APICraftSFAPIs & Underlying Protocols #APICraftSF
APIs & Underlying Protocols #APICraftSFAndrei Savu
 
Silicon India Java Conference: Building Scalable Solutions For Commerce Silic...
Silicon India Java Conference: Building Scalable Solutions For Commerce Silic...Silicon India Java Conference: Building Scalable Solutions For Commerce Silic...
Silicon India Java Conference: Building Scalable Solutions For Commerce Silic...Kalaiselvan (Selvan)
 
How APIs are Transforming Cisco Solutions and Catalyzing an Innovation Ecosystem
How APIs are Transforming Cisco Solutions and Catalyzing an Innovation EcosystemHow APIs are Transforming Cisco Solutions and Catalyzing an Innovation Ecosystem
How APIs are Transforming Cisco Solutions and Catalyzing an Innovation EcosystemCisco DevNet
 
IRJET- Blockchain based Secure Data Storage
IRJET-  	  Blockchain based Secure Data StorageIRJET-  	  Blockchain based Secure Data Storage
IRJET- Blockchain based Secure Data StorageIRJET Journal
 
Web API or WCF - An Architectural Comparison
Web API or WCF - An Architectural ComparisonWeb API or WCF - An Architectural Comparison
Web API or WCF - An Architectural ComparisonAdnan Masood
 

Semelhante a Workshop "Building Decentralised Chat with Next.js", Oleh Melnychuk (20)

Apache ignite v1.3
Apache ignite v1.3Apache ignite v1.3
Apache ignite v1.3
 
Building Killer RESTful APIs with NodeJs
Building Killer RESTful APIs with NodeJsBuilding Killer RESTful APIs with NodeJs
Building Killer RESTful APIs with NodeJs
 
Asp. net core 3.0 build modern web and cloud applications (top 13 features +...
Asp. net core 3.0  build modern web and cloud applications (top 13 features +...Asp. net core 3.0  build modern web and cloud applications (top 13 features +...
Asp. net core 3.0 build modern web and cloud applications (top 13 features +...
 
Billions of Messages in Real Time: Why Paypal & LinkedIn Trust an Engagement ...
Billions of Messages in Real Time: Why Paypal & LinkedIn Trust an Engagement ...Billions of Messages in Real Time: Why Paypal & LinkedIn Trust an Engagement ...
Billions of Messages in Real Time: Why Paypal & LinkedIn Trust an Engagement ...
 
Privacy Preservation in cloud Environment using AES Algorithm
Privacy Preservation in cloud Environment using AES AlgorithmPrivacy Preservation in cloud Environment using AES Algorithm
Privacy Preservation in cloud Environment using AES Algorithm
 
Getting started with dotnet core Web APIs
Getting started with dotnet core Web APIsGetting started with dotnet core Web APIs
Getting started with dotnet core Web APIs
 
Cloud Deployment Toolkit
Cloud Deployment ToolkitCloud Deployment Toolkit
Cloud Deployment Toolkit
 
Maginatics @ SDC 2013: Architecting An Enterprise Storage Platform Using Obje...
Maginatics @ SDC 2013: Architecting An Enterprise Storage Platform Using Obje...Maginatics @ SDC 2013: Architecting An Enterprise Storage Platform Using Obje...
Maginatics @ SDC 2013: Architecting An Enterprise Storage Platform Using Obje...
 
(Speaker Notes Version) Architecting An Enterprise Storage Platform Using Obj...
(Speaker Notes Version) Architecting An Enterprise Storage Platform Using Obj...(Speaker Notes Version) Architecting An Enterprise Storage Platform Using Obj...
(Speaker Notes Version) Architecting An Enterprise Storage Platform Using Obj...
 
Couchbase - NoSQL for you! (SDP 2014)
Couchbase - NoSQL for you! (SDP 2014)Couchbase - NoSQL for you! (SDP 2014)
Couchbase - NoSQL for you! (SDP 2014)
 
Web Development with ASP.NET: Taking Control of the Digital World
Web Development with ASP.NET: Taking Control  of the Digital WorldWeb Development with ASP.NET: Taking Control  of the Digital World
Web Development with ASP.NET: Taking Control of the Digital World
 
apidays LIVE Singapore 2022_Redesigning Data Architecture.pdf
apidays LIVE Singapore 2022_Redesigning Data Architecture.pdfapidays LIVE Singapore 2022_Redesigning Data Architecture.pdf
apidays LIVE Singapore 2022_Redesigning Data Architecture.pdf
 
Comparing the Key Features of the Top Node.js Frameworks
Comparing the Key Features of the Top Node.js FrameworksComparing the Key Features of the Top Node.js Frameworks
Comparing the Key Features of the Top Node.js Frameworks
 
Pivotal cloud cache for .net microservices
Pivotal cloud cache for .net microservicesPivotal cloud cache for .net microservices
Pivotal cloud cache for .net microservices
 
IRJET- Distributed Decentralized Data Storage using IPFS
IRJET- Distributed Decentralized Data Storage using IPFSIRJET- Distributed Decentralized Data Storage using IPFS
IRJET- Distributed Decentralized Data Storage using IPFS
 
APIs & Underlying Protocols #APICraftSF
APIs & Underlying Protocols #APICraftSFAPIs & Underlying Protocols #APICraftSF
APIs & Underlying Protocols #APICraftSF
 
Silicon India Java Conference: Building Scalable Solutions For Commerce Silic...
Silicon India Java Conference: Building Scalable Solutions For Commerce Silic...Silicon India Java Conference: Building Scalable Solutions For Commerce Silic...
Silicon India Java Conference: Building Scalable Solutions For Commerce Silic...
 
How APIs are Transforming Cisco Solutions and Catalyzing an Innovation Ecosystem
How APIs are Transforming Cisco Solutions and Catalyzing an Innovation EcosystemHow APIs are Transforming Cisco Solutions and Catalyzing an Innovation Ecosystem
How APIs are Transforming Cisco Solutions and Catalyzing an Innovation Ecosystem
 
IRJET- Blockchain based Secure Data Storage
IRJET-  	  Blockchain based Secure Data StorageIRJET-  	  Blockchain based Secure Data Storage
IRJET- Blockchain based Secure Data Storage
 
Web API or WCF - An Architectural Comparison
Web API or WCF - An Architectural ComparisonWeb API or WCF - An Architectural Comparison
Web API or WCF - An Architectural Comparison
 

Mais de Fwdays

"How Preply reduced ML model development time from 1 month to 1 day",Yevhen Y...
"How Preply reduced ML model development time from 1 month to 1 day",Yevhen Y..."How Preply reduced ML model development time from 1 month to 1 day",Yevhen Y...
"How Preply reduced ML model development time from 1 month to 1 day",Yevhen Y...Fwdays
 
"GenAI Apps: Our Journey from Ideas to Production Excellence",Danil Topchii
"GenAI Apps: Our Journey from Ideas to Production Excellence",Danil Topchii"GenAI Apps: Our Journey from Ideas to Production Excellence",Danil Topchii
"GenAI Apps: Our Journey from Ideas to Production Excellence",Danil TopchiiFwdays
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
"What is a RAG system and how to build it",Dmytro Spodarets
"What is a RAG system and how to build it",Dmytro Spodarets"What is a RAG system and how to build it",Dmytro Spodarets
"What is a RAG system and how to build it",Dmytro SpodaretsFwdays
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
"Distributed graphs and microservices in Prom.ua", Maksym Kindritskyi
"Distributed graphs and microservices in Prom.ua",  Maksym Kindritskyi"Distributed graphs and microservices in Prom.ua",  Maksym Kindritskyi
"Distributed graphs and microservices in Prom.ua", Maksym KindritskyiFwdays
 
"Rethinking the existing data loading and processing process as an ETL exampl...
"Rethinking the existing data loading and processing process as an ETL exampl..."Rethinking the existing data loading and processing process as an ETL exampl...
"Rethinking the existing data loading and processing process as an ETL exampl...Fwdays
 
"How Ukrainian IT specialist can go on vacation abroad without crossing the T...
"How Ukrainian IT specialist can go on vacation abroad without crossing the T..."How Ukrainian IT specialist can go on vacation abroad without crossing the T...
"How Ukrainian IT specialist can go on vacation abroad without crossing the T...Fwdays
 
"The Strength of Being Vulnerable: the experience from CIA, Tesla and Uber", ...
"The Strength of Being Vulnerable: the experience from CIA, Tesla and Uber", ..."The Strength of Being Vulnerable: the experience from CIA, Tesla and Uber", ...
"The Strength of Being Vulnerable: the experience from CIA, Tesla and Uber", ...Fwdays
 
"[QUICK TALK] Radical candor: how to achieve results faster thanks to a cultu...
"[QUICK TALK] Radical candor: how to achieve results faster thanks to a cultu..."[QUICK TALK] Radical candor: how to achieve results faster thanks to a cultu...
"[QUICK TALK] Radical candor: how to achieve results faster thanks to a cultu...Fwdays
 
"[QUICK TALK] PDP Plan, the only one door to raise your salary and boost care...
"[QUICK TALK] PDP Plan, the only one door to raise your salary and boost care..."[QUICK TALK] PDP Plan, the only one door to raise your salary and boost care...
"[QUICK TALK] PDP Plan, the only one door to raise your salary and boost care...Fwdays
 
"4 horsemen of the apocalypse of working relationships (+ antidotes to them)"...
"4 horsemen of the apocalypse of working relationships (+ antidotes to them)"..."4 horsemen of the apocalypse of working relationships (+ antidotes to them)"...
"4 horsemen of the apocalypse of working relationships (+ antidotes to them)"...Fwdays
 
"Reconnecting with Purpose: Rediscovering Job Interest after Burnout", Anast...
"Reconnecting with Purpose: Rediscovering Job Interest after Burnout",  Anast..."Reconnecting with Purpose: Rediscovering Job Interest after Burnout",  Anast...
"Reconnecting with Purpose: Rediscovering Job Interest after Burnout", Anast...Fwdays
 
"Mentoring 101: How to effectively invest experience in the success of others...
"Mentoring 101: How to effectively invest experience in the success of others..."Mentoring 101: How to effectively invest experience in the success of others...
"Mentoring 101: How to effectively invest experience in the success of others...Fwdays
 
"Mission (im) possible: How to get an offer in 2024?", Oleksandra Myronova
"Mission (im) possible: How to get an offer in 2024?",  Oleksandra Myronova"Mission (im) possible: How to get an offer in 2024?",  Oleksandra Myronova
"Mission (im) possible: How to get an offer in 2024?", Oleksandra MyronovaFwdays
 
"Why have we learned how to package products, but not how to 'package ourselv...
"Why have we learned how to package products, but not how to 'package ourselv..."Why have we learned how to package products, but not how to 'package ourselv...
"Why have we learned how to package products, but not how to 'package ourselv...Fwdays
 
"How to tame the dragon, or leadership with imposter syndrome", Oleksandr Zin...
"How to tame the dragon, or leadership with imposter syndrome", Oleksandr Zin..."How to tame the dragon, or leadership with imposter syndrome", Oleksandr Zin...
"How to tame the dragon, or leadership with imposter syndrome", Oleksandr Zin...Fwdays
 

Mais de Fwdays (20)

"How Preply reduced ML model development time from 1 month to 1 day",Yevhen Y...
"How Preply reduced ML model development time from 1 month to 1 day",Yevhen Y..."How Preply reduced ML model development time from 1 month to 1 day",Yevhen Y...
"How Preply reduced ML model development time from 1 month to 1 day",Yevhen Y...
 
"GenAI Apps: Our Journey from Ideas to Production Excellence",Danil Topchii
"GenAI Apps: Our Journey from Ideas to Production Excellence",Danil Topchii"GenAI Apps: Our Journey from Ideas to Production Excellence",Danil Topchii
"GenAI Apps: Our Journey from Ideas to Production Excellence",Danil Topchii
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
"What is a RAG system and how to build it",Dmytro Spodarets
"What is a RAG system and how to build it",Dmytro Spodarets"What is a RAG system and how to build it",Dmytro Spodarets
"What is a RAG system and how to build it",Dmytro Spodarets
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
"Distributed graphs and microservices in Prom.ua", Maksym Kindritskyi
"Distributed graphs and microservices in Prom.ua",  Maksym Kindritskyi"Distributed graphs and microservices in Prom.ua",  Maksym Kindritskyi
"Distributed graphs and microservices in Prom.ua", Maksym Kindritskyi
 
"Rethinking the existing data loading and processing process as an ETL exampl...
"Rethinking the existing data loading and processing process as an ETL exampl..."Rethinking the existing data loading and processing process as an ETL exampl...
"Rethinking the existing data loading and processing process as an ETL exampl...
 
"How Ukrainian IT specialist can go on vacation abroad without crossing the T...
"How Ukrainian IT specialist can go on vacation abroad without crossing the T..."How Ukrainian IT specialist can go on vacation abroad without crossing the T...
"How Ukrainian IT specialist can go on vacation abroad without crossing the T...
 
"The Strength of Being Vulnerable: the experience from CIA, Tesla and Uber", ...
"The Strength of Being Vulnerable: the experience from CIA, Tesla and Uber", ..."The Strength of Being Vulnerable: the experience from CIA, Tesla and Uber", ...
"The Strength of Being Vulnerable: the experience from CIA, Tesla and Uber", ...
 
"[QUICK TALK] Radical candor: how to achieve results faster thanks to a cultu...
"[QUICK TALK] Radical candor: how to achieve results faster thanks to a cultu..."[QUICK TALK] Radical candor: how to achieve results faster thanks to a cultu...
"[QUICK TALK] Radical candor: how to achieve results faster thanks to a cultu...
 
"[QUICK TALK] PDP Plan, the only one door to raise your salary and boost care...
"[QUICK TALK] PDP Plan, the only one door to raise your salary and boost care..."[QUICK TALK] PDP Plan, the only one door to raise your salary and boost care...
"[QUICK TALK] PDP Plan, the only one door to raise your salary and boost care...
 
"4 horsemen of the apocalypse of working relationships (+ antidotes to them)"...
"4 horsemen of the apocalypse of working relationships (+ antidotes to them)"..."4 horsemen of the apocalypse of working relationships (+ antidotes to them)"...
"4 horsemen of the apocalypse of working relationships (+ antidotes to them)"...
 
"Reconnecting with Purpose: Rediscovering Job Interest after Burnout", Anast...
"Reconnecting with Purpose: Rediscovering Job Interest after Burnout",  Anast..."Reconnecting with Purpose: Rediscovering Job Interest after Burnout",  Anast...
"Reconnecting with Purpose: Rediscovering Job Interest after Burnout", Anast...
 
"Mentoring 101: How to effectively invest experience in the success of others...
"Mentoring 101: How to effectively invest experience in the success of others..."Mentoring 101: How to effectively invest experience in the success of others...
"Mentoring 101: How to effectively invest experience in the success of others...
 
"Mission (im) possible: How to get an offer in 2024?", Oleksandra Myronova
"Mission (im) possible: How to get an offer in 2024?",  Oleksandra Myronova"Mission (im) possible: How to get an offer in 2024?",  Oleksandra Myronova
"Mission (im) possible: How to get an offer in 2024?", Oleksandra Myronova
 
"Why have we learned how to package products, but not how to 'package ourselv...
"Why have we learned how to package products, but not how to 'package ourselv..."Why have we learned how to package products, but not how to 'package ourselv...
"Why have we learned how to package products, but not how to 'package ourselv...
 
"How to tame the dragon, or leadership with imposter syndrome", Oleksandr Zin...
"How to tame the dragon, or leadership with imposter syndrome", Oleksandr Zin..."How to tame the dragon, or leadership with imposter syndrome", Oleksandr Zin...
"How to tame the dragon, or leadership with imposter syndrome", Oleksandr Zin...
 

Último

Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
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
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
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
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
[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
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 

Último (20)

Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
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
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
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
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
[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
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 

Workshop "Building Decentralised Chat with Next.js", Oleh Melnychuk

  • 1.
  • 2. Agenda Blockchain & IPFS basics ➔ Why blockchain has fees ➔ How to connect to a blockchain ➔ How to work with keys ➔ Introduction to IPFS and motivation for using IPFS together with blockchain ➔ Introduction to Subsocial and its SDK Understanding the basics of Next.js power ➔ Kinds of renders (SSR, SSG, ISR) ➔ Routing ➔ Compressing images ➔ API out of the box Development ➔ Incorporating user authentication using key pair generation ➔ Setting up a captcha for spam protection ➔ Incorporating data storage using IPFS ➔ Optimizing app speed using Next.js features Deployment ➔ Deploying the chat on Vercel
  • 4. What is Blockchain? A decentralized and distributed database technology, differs from centralized databases by storing data across multiple nodes without a governing central authority. Consisting of blocks linked by cryptographic hashes, blockchains ensure secure, tamper-proof data chains with immutable content that cannot be altered without network consensus.
  • 5.
  • 6. What is the main difference in interacting with a blockchain compared to databases?
  • 8. Prevent spam and malicious transactions, promote efficient network usage. Why blockchain has fees? Incentivize miners/validators: Encourage participation and maintain network security. Users pay fees for blockchain transactions because blockchains rely on fees to maintain network operations. Network security: Fees raise the cost of potential attacks, ensuring a more secure and stable network.
  • 9. How to connect to a blockchain? An RPC node facilitates communication between nodes in a blockchain network. It enables user interaction with the blockchain via APIs. RPC node is a program on a computer that receives and responds to requests from other network nodes. JSON-RPC for public or own nodes ➔ HTTP ➔ WS JS libraries: ➔ Ethereum: web3.js, either.js, wagmi ➔ Polkadot: @polkadot/api ➔ Subsocial: @subsocial/api ➔ GraphQL
  • 12. Frontend How to work with keys? Public Key: ➔ Used as an identifier. ➔ Can be safely shared. ➔ Validates signature authenticity. Private Key: ➔ Stored secretly on the user's side. ➔ Signs transactions, providing cryptographic proof of identity. ➔ Losing the key equates to losing the account. Backend
  • 13. Introduction to IPFS - InterPlanetary File System IPFS is a set of peer-to-peer protocols for decentralized file systems, enabling resilient networks with persistent availability, even without internet backbone connectivity.
  • 14. What is motivation for using IPFS together with blockchain Cost Reduction Storing data on a blockchain can be expensive due to transaction fees and storage constraints. Integrating IPFS with blockchain allows for off-chain storage of large data while maintaining the data's integrity. Improved Performance IPFS enables faster data retrieval and distribution, as users can access files from multiple sources simultaneously. Scalability IPFS can efficiently distribute and store large amounts of data. By integrating IPFS with blockchain, the limitations of blockchain storage can be addressed. Censorship resistant storing IPFS's decentralized and distributed nature makes saved data more resilient to censorship compared to traditional centralized systems.
  • 15. What is Subsocial? A Layer 1 blockchain based on Substrate framework designed specifically for social networking. Subsocial provide social primitives suitable for many social use case Click-to-deploy dapps Interactive media DAO communities Photo/video sharing Career networking E-commerce storefronts
  • 17. Understanding the basics of Next.js Disclaimer: We are looking at the stable version of Next.js. Currently, there is a Beta version that offers a different project structure, but this concept remains the same, only the organization style changes.
  • 18. Kind of renders (CSR, SSR, SSG, ISR)
  • 19. Well-defined structure (based on pages!) main wrapper for application: _app.js Main wrapper for the application. You could add a reusable layout here. Dynamic routes
  • 21. Optimization from the Box Optimizing Images Size Optimization: Automatically serve correctly sized images for each device, using modern image formats like WebP and AVIF. Visual Stability: Prevent layout shift automatically when images are loading. Faster Page Loads: Images are only loaded when they enter the viewport using native browser lazy loading, with optional blur-up placeholders.
  • 22. Optimization from the Box Layouts: Many of these components are often reused between pages. For example, you might have the same navigation bar and footer on every page or particular pages
  • 23. API Routes Any file inside the folder pages/api is mapped to /api/* and will be treated as an API endpoint instead of a page. They are server-side only bundles and won't increase your client-side bundle size.
  • 24. Development Tech stack: Next.js, SWR, Typescript, TailwindCSS, Subsocial SDK
  • 25. What modules do we need to build a typical chat?
  • 26. What modules do we need to build a typical chat? ➔ Database ➔ Auth service ➔ CRUD backend ➔ Real-time fetching messages (websocket) ➔ Frontend interface
  • 27. What modules do we need to build decentralized chat? ➔ Database (Blockchain + IPFS) ➔ Auth service (Based on blockchain accounts) ➔ CRUD backend (Blockchain modules) ➔ Real-time fetching messages (ws subscription out of the box) ➔ Frontend interface (Your own part)
  • 29. Fetch messages from blockchain with Subscription