{"id":15169993,"url":"https://github.com/terashim/shinyexample","last_synced_at":"2026-02-20T19:31:16.879Z","repository":{"id":170228609,"uuid":"397244152","full_name":"terashim/shinyexample","owner":"terashim","description":"Shiny アプリケーション開発プロジェクトのサンプル. golem, renv, Docker を使用.","archived":false,"fork":false,"pushed_at":"2021-08-17T12:17:40.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-01T10:56:05.896Z","etag":null,"topics":["docker","golem","r","renv","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/terashim.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}},"created_at":"2021-08-17T12:17:27.000Z","updated_at":"2023-09-08T18:25:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"1004b432-78e4-43ee-9387-6c9500b23c45","html_url":"https://github.com/terashim/shinyexample","commit_stats":{"total_commits":1,"total_committers":1,"mean_commits":1.0,"dds":0.0,"last_synced_commit":"51df8272abbd9421fc660d5202f6b72a983c8dfa"},"previous_names":["terashim/shinyexample"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/terashim/shinyexample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terashim%2Fshinyexample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terashim%2Fshinyexample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terashim%2Fshinyexample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terashim%2Fshinyexample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/terashim","download_url":"https://codeload.github.com/terashim/shinyexample/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terashim%2Fshinyexample/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29661594,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T16:33:43.953Z","status":"ssl_error","status_checked_at":"2026-02-20T16:33:43.598Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["docker","golem","r","renv","shiny"],"created_at":"2024-09-27T07:44:25.020Z","updated_at":"2026-02-20T19:31:16.861Z","avatar_url":"https://github.com/terashim.png","language":"R","readme":"shinyexample\n==================================================\n\nShiny アプリケーション開発プロジェクトのサンプル.\ngolem のプロジェクトテンプレート\n[shinyexample](https://github.com/ThinkR-open/golem/tree/master/inst/shinyexample)\nを元に作成.\n\n## 特徴\n\n- [golem](https://thinkr-open.github.io/golem/) による Shiny アプリ開発\n- [renv](https://rstudio.github.io/renv/) によるパッケージ管理\n- [Docker](https://www.docker.com/) / [rocker](https://www.rocker-project.org/) による開発環境およびアプリケーションのコンテナ化\n\n## 構成\n\n* 開発環境用 RStudio Server コンテナ\n    * [`dev/docker/Dockerfile`](./dev/docker/Dockerfile) でビルドされる Docker イメージ\n    * [`rocker/rstudio`](https://hub.docker.com/r/rocker/rstudio) をベースとする\n    * パッケージはイメージ内に含まれず, renv のパッケージキャッシュを使って Docker ホストからボリュームとしてマウントする\n    * Shiny アプリケーションの開発時にブラウザで [localhost:8787](http://localhost:8787) からアクセスして使用する\n* Shiny アプリケーションコンテナ\n    * [`./Dockerfile`](./Dockerfile) でビルドされる Docker イメージ\n    * [`rocker/r-ver`](https://hub.docker.com/r/rocker/r-ver) をベースとする\n    * 開発したパッケージ (Shiny アプリ) と依存関係パッケージがインストールされた状態でイメージに含まれる\n    * RStudio を含まない\n    * 開発した Shiny アプリのサービスがポート 80 で起動する\n\n## 初期設定\n\n次のようにして開発環境の初期設定を行う.\n\n- このプロジェクトの GitHub リポジトリをローカル環境の適当な場所（例: `~/ghq/github.com/username/shinyexample`）にクローンする.\n- [`.env.example`](./.env.example) ファイルをコピーして `.env` ファイルを作成する.\n- `.env` ファイルを編集して下記の項目を設定する.\n\n| 環境変数                 | 意味                                            | デフォルト         | 変更例                                      |\n|:-------------------------|:------------------------------------------------|:-------------------|:--------------------------------------------|\n| `RENV_PATHS_CACHE_HOST`  | renv パッケージキャッシュのディレクトリパス     | `./dev/renv/cache` | `~/Library/Application Support/renv/cache`  |\n| `DOTFILES_ROOT`          | dotfiles のディレクトリパス （任意）            | `./dev/dotfiles`   | `~/ghq/username/rproject-dotfiles`          |\n| `GITHUB_SSH_IDENTITY`    | GitHub 接続用 SSH 秘密鍵のファイルパス （任意） | `/dev/null`        | `~/.ssh/id_rsa`                             |\n\nrenv のパッケージキャッシュはホストマシンに１つ作成して固定し, プロジェクト間で共有するのが推奨.\nDotfiles や GitHub 用 SSH 鍵は設定しなくても開発可能.\n\n## 開発フロー\n\n### 開発環境の起動〜終了\n\n1. このディレクトリで `docker compose up -d` を実行して RStudio Server の Docker コンテナを起動する\n2. ブラウザで \u003chttp://localhost:8787\u003e を開き RStudio Server に接続する\n3. RStudio Server 上で開発を行う\n    - RStudio でこのプロジェクトを開く\n    - [`dev/00_renv.R`](./dev/00_renv.R) の内容に従って renv 環境をロードする\n    - 初回は [`dev/01_start.R`](./dev/01_start.R) の内容に沿って初期設定を行う\n    - [`dev/02_dev.R`](dev/02_dev.R) にあるヘルパー関数を利用しながらソースコードの編集, テストなどを行う\n4. 開発を中断するときは, このディレクトリで `docker compose down` を実行して Docker コンテナを停止する\n\n### アプリケーションイメージのビルドと動作確認\n\n1. このディレクトリで `docker compose build` を実行して, Shiny アプリケーションのイメージをビルドする\n2. `docker compose restart shiny` でビルドしたイメージからコンテナを起動する\n3. ブラウザで \u003chttp://localhost:8080\u003e を開き, Shiny Server に接続する\n4. Shiny アプリケーションの動作を確認する\n\n## 参考リンク\n\n* [Engineering Production-Grade Shiny Apps](https://engineering-shiny.org/)\n* [Using renv with Docker • renv](https://rstudio.github.io/renv/articles/docker.html)\n* [terashim/rproject: Git/GitHub、Docker、RStudio、renv を利用した R プロジェクトのひな形](https://github.com/terashim/rproject)\n* [renv と Docker の相互運用パターン - terashim.com](https://terashim.com/posts/renv-docker-patterns/)\n* [RStudio のオプション設定を dotfiles で管理する - terashim.com](https://terashim.com/posts/rstudio-dotfiles/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterashim%2Fshinyexample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterashim%2Fshinyexample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterashim%2Fshinyexample/lists"}