Worked example apps ship in the package under
inst/examples/. Run any of them by pointing
aurora_run() at its directory:
library(aurora)
aurora_run(system.file("examples", "02-dashboard-echarts", package = "aurora"))01-hello
The smallest possible app: a bslib card, one input, and an echo
endpoint. Shows the request/response loop and that query strings are
read from the query argument.
- Route:
GET /api/echo/say(readsquery$msg) - UI → API:
aurora.json("api/echo/say?msg=...")inapp.js
02-dashboard-echarts
A bar chart fed by a JSON route — the canonical “dashboard” shape.
- Route:
GET /api/sales/data→{ categories, values } - UI → API:
aurora_component("api/sales/data", id = "chart")inbuild_ui.R;app.jsreadsdata-endpoint, fetches, and renders with ECharts (via CDN)
03-map
A MapLibre map driven by a GeoJSON route — the geospatial shape.
- Route:
GET /api/regions/geojsonreturns ansfobject via#* @serializer geojson(a validFeatureCollection) - UI → API:
aurora_component()wires the map container;app.jsinitialises MapLibre GL JS (OpenStreetMap base, no API key) and adds the fetched GeoJSON as a source + layer