$30 off During Our Annual Pro Sale. View Details »

Building Decentralized Web Apps with Solid and Symfony

Building Decentralized Web Apps with Solid and Symfony

No, this presentation is not about web3.

And for good reasons! There is a more open, more interoperable, simpler, more ecological, and even more... decentralized (!!) way to build decentralized web applications.

Web standards, and in particular those of the latest generation (RDF, JSON-LD, N3, OpenID Connect) provide a framework for building such apps.

It is on this technical basis that two new protocols that could revolutionize the web are established: Solid.

The Solid project, for Social Linked Data, developed by Sir Tim Berners-Lee - the creator of the Web himself - gives users control of their data. It allows them to store their data wherever they want, and to choose precisely which application can access what.

Even better, no need for smart contracts or even blockchain to create decentralized web applications using these technologies, a good old PHP script and a Raspberry Pi are enough. That said, using Symfony and API Platform can greatly facilitate the task, that's what we will discover together!

Kévin Dunglas

April 01, 2022
Tweet

More Decks by Kévin Dunglas

Other Decks in Programming

Transcript

  1. Building
    Decentralized
    Web Apps
    Using Symfony, API Platform and
    no blockchain!

    View Slide

  2. Save the web, decentralize!
    02
    03
    OUTLINE
    04
    01
    Web 3 VS Web 3.0
    Solid
    Build your Solid application

    View Slide

  3. Kévin Dunglas
    ➔ Co-founder of Les-Tilleuls.coop
    ➔ Symfony Core Team
    ➔ Creator of:
    ● API Platform
    ● Mercure.rocks
    ● Vulcain.rocks
    @dunglas

    View Slide

  4. 02
    03
    04
    01 Save the web, decentralize!
    Build your Solid application
    Solid
    Web 3 or Web 3.0?

    View Slide

  5. View Slide

  6. Save the Web, Decentralize!
    57%
    of all network traffic
    =
    Source: Sandvine (2021)

    View Slide

  7. Our Privacy Is at Risk

    View Slide

  8. Our Societies Are at Risk

    View Slide

  9. Save the Web, Decentralize
    @ AFUP Day 2020

    View Slide

  10. 02
    03
    04
    01 Save the web, decentralize!
    Web 3 or Web 3.0?
    Build your Solid application
    Solid

    View Slide

  11. ➔ Resources
    ◆ published on servers
    ◆ requested by clients
    ◆ identified by URIs (aka URLs)
    ◆ linked together
    ➔ Open standards (W3C, IETF):
    ◆ URI, HTTP, HTML…
    ➔ Created by Tim Berners-Lee @
    CERN
    Back to the Future: Web 1.0 (90s)

    View Slide

  12. « The Web is intended
    to be an Internet-scale
    distributed
    hypermedia system. »
    Roy Fielding (author of
    HTTP, Apache and REST), in
    2000.
    The Web 1.0 was Decentralized

    View Slide

  13. ➔ User Generated Content
    ➔ focus on interoperability (initially)
    ➔ Marketing term, not a fundamental
    change of the web stack:
    ◆ still relying on URI, HTTP (1.1),
    HTML…
    ◆ RSS, XML, web APIs, XML, JSON 😍
    ◆ rise of JavaScript
    ➔ Mix of community (RSS, Wordpress,
    Wikipedia…) and commercial (YouTube,
    Twitter, Facebook…) projects
    ➔ Lead to centralization (because money)
    Web 2.0: the Social Web (2000s)

    View Slide

  14. ➔ Reclaim big tech’s and government’s power,
    give users back the control of their data
    ➔ Decentralized open source apps
    ➔ Crypto-based, runs on blockchains
    ➔ Trustless and permissionless: direct exchanges, no 3rd parties
    Web3, the Promise: Re-Decentralize
    Image: Rapid Innovation

    View Slide

  15. ➔ Real-world “dapps” are mostly
    centralized, most of data and code are
    in centralized servers, not in the
    blockchain (eg OpenSea NFT)
    ➔ Hard to maintain, privacy issues (public
    and immutable data/code)
    ➔ Proof of Work Blockchains:
    huge ecological footprint
    ➔ Proof of Stake Blockchains:
    less decentralized, favors users who
    have a large amount of cryptocurrency
    Web 3: Don’t Believe the Hype

    View Slide

  16. Web 3: Don’t Believe the Hype
    ➔ Promoted by VCs, crypto and
    NFT enthusiasts, large tech
    corps
    ➔ Main goal: monetize and
    financialize every aspects of
    life
    ➔ Littered by scams and Ponzi
    schemes
    ➔ Criticized by many experts:
    Moxie Marlinspike, André Stalz,
    Jack Dorsey, Stephen Diehl…
    even Elon Musk

    View Slide

  17. Back in 2014…

    View Slide

  18. ➔ Machine-readable web: Linked Data
    ➔ The web as a big database
    ➔ Focus on interoperability and
    decentralization
    ➔ Created by Tim Berners-Lee
    ➔ Open standards (W3C):
    ◆ URI, HTTP
    ◆ RDF: abstract data model
    ◆ JSON-LD, Turtle, XML-RDF…:
    serialization formats
    ◆ RDFS, OWL: vocabulary definitions
    The Original Web 3.0: Semantic Web (2000s)

    View Slide

  19. ➔ Abstract model to represent any set of data
    ➔ Directed graph
    ➔ Basic unit: semantic triple
    ◆ subject
    ◆ predicate
    ◆ object
    Resource Description Format (RDF)
    SUBJECT OBJECT
    predicate

    View Slide

  20. RDF: Table and Visual Representations

    View Slide

  21. RDF: N-Triples

    View Slide

  22. RDF: Turtle

    View Slide

  23. RDF: Turtle with Prefixes

    View Slide

  24. RDF: JSON-LD

    View Slide

  25. View Slide

  26. 03
    01
    Web 3 or Web 3.0?
    Solid
    02
    04
    Save the web, decentralize!
    Build your Solid application

    View Slide

  27. View Slide

  28. View Slide

  29. ➔ Toolkit to build decentralized and
    interoperable apps
    ➔ Users store their data in decentralized
    data pods
    ➔ Pods are secure personal data stores
    (S3-like)
    ➔ Users choose who and which apps can
    access their data
    ➔ Set of open standards (W3C)
    ➔ Built on top of Web 3.0 standards
    ➔ Created by Tim Berners-Lee, Inrupt and
    the MIT
    Solid

    View Slide

  30. Solid: Overview
    Social Web
    Resources
    management
    Identity /
    Auth

    View Slide

  31. Solid Stack: Standards
    URI
    HTTPS
    RDF
    LDP, WebID and OpenID Connect
    Solid specs

    View Slide

  32. ➔ WebID: URI identifying a person,
    an organization, a company…
    ➔ Open ID Connect (OIDC): identity layer
    on top of OAuth2
    ➔ Solid OIDC: to discover the
    OIDC/OAuth server related to a WebID
    ➔ Linked Data Platform (LDP): Linked
    Data REST API to read and write RDF
    resources
    ➔ Web Access Control (WAC): RDF
    vocabulary for users, groups and ACL
    ➔ Other specs: pub/sub, notifications,
    friend lists….
    Solid Stack: Standards

    View Slide

  33. Solid Pods
    ➔ FOSS, self-hosted
    ◆ Node solid server (most popular)
    ◆ Nextcloud
    ◆ PHP Solid Server
    ➔ FOSS, community hosted:
    ◆ solidcommunity.net
    ◆ solidweb.org
    ➔ Commercial:
    ◆ Inrupt Enterprise Solid Server
    ◆ TrinPod

    View Slide

  34. NHS Pods Storing Health Records

    View Slide

  35. ➔ Common vocabularies are key for:
    ◆ interoperability between apps
    ◆ data portability
    ➔ Well known vocabularies:
    ◆ FOAF: social graph
    ◆ vcard: e-business cards
    ◆ ActivityStreams: social networks
    ◆ DublinCore: documents
    ◆ Schema.org: common things
    ◆ …
    ➔ Vocabs can be mixed together and extended
    ➔ RDF vocabs to define new vocabs:
    ◆ RDFS, OWL, SKOS…
    RDF Vocabularies

    View Slide

  36. 03
    01
    Build your Solid application
    02
    04
    Web 3 or Web 3.0?
    Save the web, decentralize!
    Solid

    View Slide

  37. View Slide

  38. ➔ Standalone PHP library
    ◆ OIDC and Solid OIDC client
    ◆ Solid pods client
    ➔ Symfony Bundle
    ◆ Passport authenticator
    ◆ User provider
    ◆ Pod client as a service
    ◆ HttpClient integration
    ➔ Early stage, experimental
    ➔ Some TODOs (contribs welcome)
    Solid Client PHP

    View Slide

  39. Login Using a WebID

    View Slide

  40. View Slide

  41. Create and Access Files

    View Slide

  42. Built on top of awesome PHP libraries:
    ➔ jumbojett/openid-connect-php:
    OIDC client
    ➔ web-token/jwt-core:
    JOSE implementation
    ➔ easyrdf/easyrdf:
    RDF parser, serializer and converter
    ➔ symfony/http-client:
    HttpClient
    Free Software ❤

    View Slide

  43. Contributing Upstream

    View Slide

  44. 15
    16
    SEPTEMBRE
    2022
    LILLE
    & ONLINE
    ➔ api-platform.com/con
    SAVE
    THE DATE!

    View Slide

  45. Thanks!
    ➔ Try building your Solid app:
    dunglas/solid-client-php
    dunglas.fr
    @dunglas

    View Slide