{"id":14066334,"url":"https://github.com/Appsilon/experimental-plumber-example","last_synced_at":"2025-07-29T22:34:04.040Z","repository":{"id":200818689,"uuid":"695113208","full_name":"Appsilon/experimental-plumber-example","owner":"Appsilon","description":null,"archived":false,"fork":false,"pushed_at":"2023-12-15T05:30:37.000Z","size":137,"stargazers_count":14,"open_issues_count":1,"forks_count":1,"subscribers_count":15,"default_branch":"main","last_synced_at":"2024-08-13T07:11:13.369Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Appsilon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-09-22T11:38:46.000Z","updated_at":"2024-05-14T11:23:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"853a3359-7598-4875-b810-04821b5f34d8","html_url":"https://github.com/Appsilon/experimental-plumber-example","commit_stats":null,"previous_names":["appsilon/experimental-plumber-example"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Appsilon%2Fexperimental-plumber-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Appsilon%2Fexperimental-plumber-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Appsilon%2Fexperimental-plumber-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Appsilon%2Fexperimental-plumber-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Appsilon","download_url":"https://codeload.github.com/Appsilon/experimental-plumber-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228060043,"owners_count":17863358,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-13T07:05:02.895Z","updated_at":"2024-12-04T06:30:38.075Z","avatar_url":"https://github.com/Appsilon.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"## Plumber Example\n\n\u003e Plumber API paired with a Shiny App that displays data and plots renders in API\n\nThe Plumber API implemented in this repository is a simple wrapper over the `EuStockMarkets` dataset allowing to query and plot this dataset.\n\nIt shows the potential usages of Plumber by creating a REST api that is async _(handles multiple requests in parallel)_ and caches the results.\n\n#### Plumber technical features:\n\n- Using `{future}` to allow for async requests;\n- Using `{memoise}` to allow for caching of the results;\n  - re-using the results cache on following request with same parameters.\n\n#### Endpoints\n\n  - `/plot` :: returns HTML that can be embedded in a Web page;\n  - `/query` :: returns the data that supports the plot;\n  - `/ranges` :: returns metadata for the available date ranges;\n  - `/indexes` :: returns metadata that provides the available indexes in the data.\n\n##### Example links\n\nNote: it needs `connect.appsilon.com` creadentials.\n\n- API documentation: https://connect.appsilon.com/plumber-example/\n- Shiny example (see below): https://connect.appsilon.com/plumber-example-shiny/\n- Sample plot: https://connect.appsilon.com/plumber-example/plot?from=1990-01-01\u0026to=2000-01-01\n- Sample metadata _(date ranges)_: https://connect.appsilon.com/plumber-example/ranges\n\n\n#### Security\n\nThe example also implements a origin validation check when configured.\nA secret key shared known only to the Plumber API and the client allows the creation of a token that validates that the requests originated from a trusted source.\n\nThe example Plumber API is deployed via the Posit Connect infrastructure, which ensures that the traffic is encrypted behind the HTTPS protocol.\n\n#### Load Balancing\n\nMultiple instances of the Plumber API can be run behind a load balancer to provide with more capacity to a stateless service.\n\nFor example, this can be achieved via a `Docker`-based solution `haproxy`.\n\n#### Shiny _(paired with Plumber)_\n\nShiny _(or any other web application)_ can be paired with Plumber to render plots or perform complex data-manipulations.\n\nAs an add-on to the plumber example we implement a web application that uses the API for all it's data and plotting needs.\n\n- Calls Plumber API to retrieve metadata\n- Plot is rendered by the browser (bypassing Shiny server)\n  - Using an `iframe` HTML element _(browser calls on Plumber API endpoint and renders it)_\n  - Shiny process is not blocked by the rendering of the plot\n\nA diagram of the communication happening once the page is loaded _(and everytime the parameters are modified)_:\n\n```mermaid\nsequenceDiagram;\n    autonumber\n    participant Browser\n    participant Shiny\n    participant Plumber API\n    Browser-\u003e\u003eShiny: Open App\n    Shiny-\u003e\u003ePlumber API: Get metadata\n    Plumber API--\u003e\u003eShiny: Return metadata\n    Note over Plumber API,Shiny: Available\u003cbr/\u003e\"Date ranges\" \u0026 \"Indexes\"\n    Shiny--\u003e\u003eBrowser: Render App\n    Note over Shiny,Browser: Input slider \u0026\u003cbr/\u003eParameters for plot (iframe)\n    Browser-)Plumber API: GET iframe contents\n    Plumber API--)Browser: Render Plot\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAppsilon%2Fexperimental-plumber-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAppsilon%2Fexperimental-plumber-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAppsilon%2Fexperimental-plumber-example/lists"}