{"id":27122105,"url":"https://github.com/yianandcode/gallery","last_synced_at":"2025-04-07T11:25:47.599Z","repository":{"id":285355657,"uuid":"956021345","full_name":"YianAndCode/gallery","owner":"YianAndCode","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-31T08:23:14.000Z","size":47,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T09:23:24.187Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://gallery.yian.me","language":"TypeScript","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/YianAndCode.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":"2025-03-27T15:14:30.000Z","updated_at":"2025-03-31T08:23:18.000Z","dependencies_parsed_at":"2025-03-31T09:33:29.222Z","dependency_job_id":null,"html_url":"https://github.com/YianAndCode/gallery","commit_stats":null,"previous_names":["yianandcode/gallery"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YianAndCode%2Fgallery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YianAndCode%2Fgallery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YianAndCode%2Fgallery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YianAndCode%2Fgallery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YianAndCode","download_url":"https://codeload.github.com/YianAndCode/gallery/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247641877,"owners_count":20971810,"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":"2025-04-07T11:25:47.069Z","updated_at":"2025-04-07T11:25:47.589Z","avatar_url":"https://github.com/YianAndCode.png","language":"TypeScript","readme":"# Gallery\n\n一个单文件的相册浏览程序，可以作为摄影爱好者的个人作品展示网站，又或是 NAS 上浏览图库的工具\n\n## 安装/部署\n\n### 本地编译\n\n编译要求：\n\n - `go` ≥ 1.23\n - `nodejs` 建议用 22 或更高版本（React 19 能兼容的版本应该就可以，需要自行测试）\n\n*如果上述环境你不方便准备，可以使用 Docker 编译，见文档下文*\n\nmacOS/Linux 用户可以直接用 `make` 命令编译整个项目，编译后的可执行程序在 `bin/gallery`。如果需要单独构建前端或者后端，或者是 Windows 用户，可以参考下面的步骤：\n\n**单独构建前端：**\n\nmacOS/Linux:\n\n```bash\nmake frontend\n```\n\nWindows:\n\n```bat\ncd ui\nnpm install \u0026\u0026 npm run build\n```\n\n**单独构建后端：**\n\n```bash\nmake backend\n```\n\nWindows:\n```bat\ngo build -o bin/gallery ./cmd/server\n```\n\n### Docker\n\n使用 Docker 编译的话只需要执行 `./docker-build.sh` 即可。\n\n如果想指定镜像名，可以通过在项目根目录添加 `.env` 文件，并在里面添加：\n\n```\nIMG_NAME=\u003cYOUR_IMAGE_NAME\u003e\n```\n\n## 配置\n\n配置只有两个：本地图片路径 `IMG_DIR` 和监听端口 `PORT`，通过环境变量指定即可。\n\n其中 `IMG_DIR` 是必传的，`PORT` 如果不传则默认监听 `9394`。\n\n**图片必须放在 `IMG_DIR` 下的子文件夹，一个文件夹表示一个图集；暂时不支持子图集，如果有需要可以提 issue 说明下使用场景**\n\n## 运行\n\n### 直接运行\n\n```bash\nIMG_DIR=/path/to/images ./bin/gallery\n\n# 或者自定义端口\nIMG_DIR=/path/to/images PORT=9395 ./bin/gallery\n```\n\n### Docker compose\n\n参考 `compose.yml`，修改相应的镜像名、端口、图片路径等，然后执行\n\n```bash\ndocker compose up -d\n\n# 如果 Docker 的版本比较旧，则执行\ndocker-compose up -d\n```\n\n然后用浏览器访问 http://127.0.0.1:9394/ （不是在本地运行的自行替换 IP 地址）就可以享用了😉","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyianandcode%2Fgallery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyianandcode%2Fgallery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyianandcode%2Fgallery/lists"}