{"id":13498606,"url":"https://github.com/serverless-plus/photo-album","last_synced_at":"2025-03-29T01:32:16.487Z","repository":{"id":66317525,"uuid":"358552269","full_name":"serverless-plus/photo-album","owner":"serverless-plus","description":"Serverless 相册应用","archived":false,"fork":false,"pushed_at":"2021-05-12T05:07:23.000Z","size":506,"stargazers_count":1,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-01T21:47:36.571Z","etag":null,"topics":["photo","photo-album","serverless","taro"],"latest_commit_sha":null,"homepage":"https://photo.sls.plus/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/serverless-plus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-04-16T09:51:38.000Z","updated_at":"2021-05-14T02:30:39.000Z","dependencies_parsed_at":"2024-01-18T23:04:51.704Z","dependency_job_id":"75309f3a-d687-49a7-bb3b-411c6a39c2ef","html_url":"https://github.com/serverless-plus/photo-album","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless-plus%2Fphoto-album","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless-plus%2Fphoto-album/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless-plus%2Fphoto-album/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless-plus%2Fphoto-album/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serverless-plus","download_url":"https://codeload.github.com/serverless-plus/photo-album/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222445128,"owners_count":16985764,"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":["photo","photo-album","serverless","taro"],"created_at":"2024-07-31T21:00:37.893Z","updated_at":"2024-10-31T16:30:28.703Z","avatar_url":"https://github.com/serverless-plus.png","language":"TypeScript","funding_links":[],"categories":["开发模板"],"sub_categories":[],"readme":"# Serverless 相册\n\n[在线体验](https://photo.sls.plus) (使用手机访问体验最佳)\n\n[![Build Status](https://github.com/serverless-plus/photo-album/workflows/Validate/badge.svg?branch=master)](https://github.com/serverless-plus/photo-album/actions?query=workflow:Validate+branch:master)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n\nServerless 相册应用，**上传照片可以智能识别，添加属性标签**。\n\n\u003e 注意：目前并未添加用户登录逻辑，只是在用户第一次访问应用时，自动生成了一个 `uuid` 作为唯一标识，然后存放到了 LocalStorage 中，如果是发布到小程序，开发者可以自行添加登录逻辑。\n\n## 功能\n\n- [x] [Serverless](https://github.com/serverless/serverless)\n- [x] [Taro](https://github.com/nervjs/taro)\n- [x] [Taro UI](https://github.com/NervJS/taro-ui)\n- [x] [Express](https://github.com/expressjs/express)\n- [x] [Typescript](https://github.com/microsoft/TypeScript)\n- [x] [Github Actions](https://github.com/features/actions)\n- [x] [Eslint](https://github.com/eslint/eslint)\n- [x] [Prettier](https://github.com/prettier/prettier)\n- [x] [Jest](https://github.com/facebook/jest)\n- [x] [semantic-release](https://github.com/semantic-release/semantic-release)\n\n### 使用的云端服务\n\n- [x] [对象存储](https://console.cloud.tencent.com/cos)\n- [x] [云函数](https://console.cloud.tencent.com/scf)\n- [x] [API 网关](https://console.cloud.tencent.com/apigateway)\n- [x] [Serverless MYSQL 数据库](https://console.cloud.tencent.com/cynosdb)\n- [x] [图像识别](https://console.cloud.tencent.com/tiia/detectlabel)\n\n\u003e 注意：由于图片识别依赖腾讯云的 [图像标签](https://console.cloud.tencent.com/tiia/detectlabel) 服务，使用前请到控制台开通。\n\n## TODO\n\n- [x] 列表页\n- [x] 图片上传\n- [x] 图片自动添加标签\n- [x] 图片自动添加描述\n- [ ] 相册分类\n- [ ] 用户登录\n- [ ] 小程序授权登录（将单独使用 `weapp` 分支开发）\n\n## 目录介绍\n\n```\n.\n├── README.md               // 说明文档\n├── client                  // 客户端代码\n├── cos                     // Serverless cos 组件配置\n├── db                      // Serverless cynosdb(mysql) 组件配置\n├── docker-compose.yml      // Docker compose 配置，方便本地模拟数据库链接\n├── layer                   // Serverless layer 组件配置\n├── serverless.yml          // Serverless express 组件配置\n├── sls.ts                  // 云函数入口文件\n├── src                     // 服务端代码\n├── tsconfig.json           // Typescript 配置\n└── vpc                     // Serverless vpc 组件配置\n```\n\n## 演示\n\n\u003ccenter\u003e\n\u003cimg src=\"./demo/1.jpg\" width=\"600\"\u003e\n\u003c/center\u003e\n\n## 使用\n\n```bash\n$ git clone https://github.com/serverless-plus/photo-album.git\n```\n\n或者通过 [serverless](https://github.com/serverless/serverless) 命令初始化：\n\n```bash\n$ sls init photo-album\n```\n\n\u003e 注意：通过 `sls init` 命令初始化时，会自动安装项目的依赖（执行 `npm install`），时间可能比较长，请耐心等待。如果由于网络原因导致依赖安装失败，可以重新进入项目目录，执行 npm install 来安装依赖。\n\n## 本地开发\n\n安装依赖:\n\n```bash\n$ npm install \u0026\u0026 cd client \u0026\u0026 npm install\n```\n\n创建用来存储相片的存储桶：\n\n```bash\n$ npm run deploy:cos\n```\n\n本地启动 Docker 服务：\n\n```bash\n$ npm run docker:up\n```\n\n复制 `.env.example` 为 `.env`，然后配置成个人账号，主要需要配置（`TENCENT_APP_ID`、`TENCENT_SECRET_ID`、`TENCENT_SECRET_KEY`）:\n\n```bash\n$ cp .env.example .env\n```\n\n启动服务端\n\n```bash\n$ npm run dev:server\n```\n\n启动客户端：\n\n```bash\n$ npm run dev:client\n```\n\n## 部署应用\n\n### 部署数据库\n\nServerless MYSQL 数据库，需要配置私有网络（VPC），隐私我们需要先创建私有网络：\n\n```bash\n$ npm run deploy:vpc\n```\n\nVPC 创建成功后，再部署数据库\n\n```bash\n$ npm run deploy:db\n```\n\n### 创建存储桶\n\n创建用来存储相片的存储桶：\n\n```bash\n$ npm run deploy:cos\n```\n\n### 部署层\n\n针对 Node.js 项目, 我们可以将 `node_modules` 文件夹部署到层，第一次将 `node_modules` 部署到层后，就不用再次重复部署了，这样可以打打减少代码上传体积。\n\n```bash\n$ npm run deploy:layer\n```\n\n\u003e **注意**： 层部署成功后，如果我们新增了模块依赖（改变了 `node_modules`）就需要再次执行部署层命令。\n\n### 部署服务端代码\n\n```bash\n$ npm run deploy:server\n```\n\n### 部署客户端代码\n\n```bash\n$ npm run deploy:client\n```\n\n## 常见问题\n\n## License\n\nMIT License\n\nCopyright (c) 2020 Serverless Plus\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserverless-plus%2Fphoto-album","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserverless-plus%2Fphoto-album","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserverless-plus%2Fphoto-album/lists"}