{"id":50506354,"url":"https://github.com/renardeinside/databricks-apps-shiny-with-r","last_synced_at":"2026-06-02T16:30:28.776Z","repository":{"id":356573517,"uuid":"1233138566","full_name":"renardeinside/databricks-apps-shiny-with-r","owner":"renardeinside","description":"Example of running Shiny for R on Databricks Apps","archived":false,"fork":false,"pushed_at":"2026-05-08T16:42:56.000Z","size":208,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-08T18:39:33.982Z","etag":null,"topics":["databricks-apps","r-language","shiny"],"latest_commit_sha":null,"homepage":"","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/renardeinside.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,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-08T16:24:16.000Z","updated_at":"2026-05-08T16:43:01.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/renardeinside/databricks-apps-shiny-with-r","commit_stats":null,"previous_names":["renardeinside/databricks-apps-shiny-with-r"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/renardeinside/databricks-apps-shiny-with-r","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renardeinside%2Fdatabricks-apps-shiny-with-r","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renardeinside%2Fdatabricks-apps-shiny-with-r/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renardeinside%2Fdatabricks-apps-shiny-with-r/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renardeinside%2Fdatabricks-apps-shiny-with-r/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/renardeinside","download_url":"https://codeload.github.com/renardeinside/databricks-apps-shiny-with-r/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renardeinside%2Fdatabricks-apps-shiny-with-r/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33831622,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-02T02:00:07.132Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["databricks-apps","r-language","shiny"],"created_at":"2026-06-02T16:30:26.316Z","updated_at":"2026-06-02T16:30:28.761Z","avatar_url":"https://github.com/renardeinside.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📊 Shiny for R on Databricks Apps\n\nA sample [Shiny](https://shiny.posit.co/) app written in **R** that runs natively on [Databricks Apps](https://docs.databricks.com/en/apps/index.html) — deployed via DABs (Databricks Asset Bundles).\n\n![App screenshot](assets/example.png)\n\n## 🤔 What's the approach?\n\nDatabricks Apps instances are shipped with **Python and `uv`**, but unfortunately doesn't have a preinstalled R runtime. \n\nThis project shows how to use a lightweight Python launcher that bootstraps an R environment at startup using [micromamba](https://mamba.readthedocs.io/en/latest/user_guide/micromamba.html), then hands off execution to a Shiny app.\n\n## 🏗️ How it works\n\n```\nDatabricks App Instance\n=========================\n\nuv run scripts/launcher.py\n  |-- 1. Downloads micromamba\n  |-- 2. Creates conda env from environment.yml\n  |-- 3. Installs R + packages\n  '-- 4. Starts Shiny app via Rscript\n\napp/app.R  --\u003e  serves on $DATABRICKS_APP_PORT\n```\n\nThe Shiny app queries **Databricks SQL** using the forwarded user token (`HTTP_X_FORWARDED_ACCESS_TOKEN`), so each user sees data scoped to their own permissions.\n\n## 📁 Project structure\n\n```\n├── app/\n│   └── app.R                # Shiny app (UI + server)\n├── scripts/\n│   └── launcher.py          # Python bootstrap script\n├── environment.yml          # Conda env: R + packages\n└── databricks.yml           # DABs bundle definition\n```\n\n## ✅ Prerequisites\n\n- [Databricks CLI](https://docs.databricks.com/en/dev-tools/cli/install.html) installed and authenticated\n- A Databricks SQL Warehouse ID\n- Access to a Databricks workspace\n\n## 🚀 Deploy\n\n**1. Validate the bundle**\n\n```bash\ndatabricks bundle validate\n```\n\n**2. Deploy to your workspace**\n\n```bash\ndatabricks bundle deploy -var=\"sql_warehouse_id=\u003cYOUR_WAREHOUSE_ID\u003e\"\n```\n\n**3. Launch the app**\n\n```bash\ndatabricks bundle run shiny-app-r\n```\n\nThat's it — the app will be live on your workspace's Apps URL. 🎉\n\n## 🔧 Configuration\n\nThe bundle is defined in `databricks.yml`. Key settings:\n\n| Setting         | Value                                                     |\n| --------------- | --------------------------------------------------------- |\n| App name        | `shiny-app-r`                                             |\n| Start command   | `uv run scripts/launcher.py`                              |\n| User API scopes | `sql`                                                     |\n| Variable        | `sql_warehouse_id` — passed as `SQL_WAREHOUSE_ID` env var |\n\nR dependencies live in `environment.yml` and are installed at container startup via micromamba.\n\n## 🔑 Authentication\n\nDatabricks Apps handle auth automatically. The app reads the user's token from the `X-Forwarded-Access-Token` header injected by the Apps proxy — no secrets management needed.\n\n## 💡 Adapting this for your own Shiny app\n\n1. Replace `app/app.R` with your Shiny application\n2. Add any new R packages to `environment.yml`\n3. Update the SQL query or data source as needed\n4. Re-deploy with `databricks bundle deploy`\n\n## 📚 References\n\n- [Databricks Apps](https://docs.databricks.com/en/apps/index.html)\n- [micromamba](https://mamba.readthedocs.io/en/latest/user_guide/micromamba.html)\n- [Shiny](https://shiny.posit.co/)\n- [R](https://www.r-project.org/)\n- [uv](https://docs.astral.sh/uv/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenardeinside%2Fdatabricks-apps-shiny-with-r","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frenardeinside%2Fdatabricks-apps-shiny-with-r","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenardeinside%2Fdatabricks-apps-shiny-with-r/lists"}