{"id":13933068,"url":"https://github.com/fantasticit/wipi","last_synced_at":"2025-04-04T06:08:30.314Z","repository":{"id":40459959,"uuid":"116479365","full_name":"fantasticit/wipi","owner":"fantasticit","description":"A blog system written by next.js, nest.js and MySQL.","archived":false,"fork":false,"pushed_at":"2024-07-03T14:54:00.000Z","size":13221,"stargazers_count":624,"open_issues_count":0,"forks_count":121,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-03-28T05:09:28.923Z","etag":null,"topics":["nestjs","nextjs","nysql","react","sass"],"latest_commit_sha":null,"homepage":"https://blog.codingit.cn/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fantasticit.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":"2018-01-06T12:00:41.000Z","updated_at":"2025-03-15T13:26:00.000Z","dependencies_parsed_at":"2023-01-22T04:50:01.123Z","dependency_job_id":"d2f77da6-c78f-473d-aa26-54eebe97b513","html_url":"https://github.com/fantasticit/wipi","commit_stats":{"total_commits":457,"total_committers":3,"mean_commits":"152.33333333333334","dds":"0.026258205689277947","last_synced_commit":"9e3c15b67149aaf11cd7894a2b2d4524a3abc362"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fantasticit%2Fwipi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fantasticit%2Fwipi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fantasticit%2Fwipi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fantasticit%2Fwipi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fantasticit","download_url":"https://codeload.github.com/fantasticit/wipi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247128744,"owners_count":20888235,"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":["nestjs","nextjs","nysql","react","sass"],"created_at":"2024-08-07T21:01:33.096Z","updated_at":"2025-04-04T06:08:30.296Z","avatar_url":"https://github.com/fantasticit.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# Wipi\n\n## 简介\n\nWipi 是一个面向个人的开源的集成文章发表、页面创建、知识小册等功能的 CMS 系统。涉及到的技术如下：\n\n- `MySQL`：数据存储\n- `next.js`：前端页面框架\n- `nest.js`：服务端框架\n- `AliyunOSS`：对象存储\n\n## 链接\n\n- [Github 源码](https://github.com/fantasticit/wipi)\n- [前台页面](https://blog.codingit.cn/)\n- [管理系统](https://admin.blog.codingit.cn/)：支持访客注册\n\n## 功能点\n\n- 文章管理\n- 页面管理\n- 知识小册\n- 评论管理\n- 邮件管理\n- 访问统计\n- 文件管理\n- 系统设置\n\n更多功能，欢迎访问系统进行体验。\n\n## 预览\n\n\u003cul\u003e\n  \u003cli\u003e\u003cimg width=\"240\" alt=\"文章列表\" src=\"https://wipi.oss-cn-shanghai.aliyuncs.com/2021-06-13/3402/image.png\"/\u003e\u003c/li\u003e\n  \u003cli\u003e\u003cimg width=\"240\" alt=\"文章详情\" src=\"https://wipi.oss-cn-shanghai.aliyuncs.com/2021-06-12/815/image.png\"/\u003e\u003c/li\u003e\n  \u003cli\u003e\u003cimg width=\"240\" alt=\"动态页面\" src=\"https://wipi.oss-cn-shanghai.aliyuncs.com/2021-06-12/3124/image.png\"/\u003e\u003c/li\u003e\n  \u003cli\u003e\u003cimg width=\"240\" alt=\"知识小册\" src=\"https://wipi.oss-cn-shanghai.aliyuncs.com/2021-06-12/6485/image.png\"/\u003e\u003c/li\u003e\n  \u003cli\u003e\u003cimg width=\"240\" alt=\"后台管理\" src=\"https://wipi.oss-cn-shanghai.aliyuncs.com/2021-06-12/754/image.png\"/\u003e\u003c/li\u003e\n  \u003cli\u003e\u003cimg width=\"240\" alt=\"文章编辑\" src=\"https://wipi.oss-cn-shanghai.aliyuncs.com/2021-06-12/6587/image.png\"/\u003e\u003c/li\u003e\n  \u003cli\u003e\u003cimg width=\"240\" alt=\"小册编辑\" src=\"https://wipi.oss-cn-shanghai.aliyuncs.com/2021-06-12/1864/image.png\"/\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n## 项目运行\n\n### 数据库\n\n首先安装 `MySQL`，推荐使用 docker 进行安装。\n\n```bash\ndocker image pull mysql:5.7\ndocker run -d --restart=always --name wipi -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root mysql:5.7\n```\n\n然后在 `MySQL` 中创建数据库。\n\n```bash\ndocker container exec -it wipi bash;\nmysql -u root -p;\nCREATE DATABASE  `wipi` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;\n```\n\n### 本地运行\n\n首先，clone 项目。\n\n```bash\ngit clone --depth=1 https://github.com/fantasticit/wipi.git your-project-name\n```\n\n然后，安装项目依赖。\n\n```bash\n# 全局安装 pnpm\nnpm i -g pnpm\n\npnpm install\n```\n\n- 启动项目\n\n```bash\npnpm run dev\n```\n\n前台页面地址：`http://localhost:3001`。\n后台管理地址：`http://localhost:3002`。\n服务接口地址：`http://localhost:3003`。\n\n首次启动，默认创建管理员用户：admin，密码：admin（可在 `.env` 文件中进行修改）。\n[PS] 如服务端配置启动失败，请先确认 MySQL 的配置是否正确，配置文件在 `.env`。\n\n### 系统设置\n\n\u003cul\u003e\n  \u003cli\u003e\u003cimg width=\"240\" alt=\"系统设置\" src=\"https://wipi.oss-cn-shanghai.aliyuncs.com/2021-06-13/FURY8457EB0K41T6ABMBCSP1N9HUUFAB/image.png\"/\u003e\u003c/li\u003e\n  \u003cli\u003e\u003cimg width=\"240\" alt=\"前台页面\" src=\"https://wipi.oss-cn-shanghai.aliyuncs.com/2021-06-13/ICS41W05E4XRKLEAF9YO99A48CWGRP9X/image.png\"/\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n项目初次启动时，需要在后台进行系统设置。随着内容的丰富，页面内容也会丰富起来。\n\n### 配置文件\n\n默认加载 `.env` 文件，生产环境会尝试加载 `.env.prod` 文件。\n\n```bash\n# 客户端运行端口\nCLIENT_PORT=3001\n# 客户端站点地址（假设部署到 https://xx.com, 就将 CLIENT_SITE_URL 设置为 https://xx.com）\nCLIENT_SITE_URL=http://localhost:3001\n# 客户端资源地址（假设部署到 https://xx.com，就将 CLIENT_ASSET_PREFIX 设置为 https://xx.com，如果将资源上传到 cdn ，那就改为 cdn 地址）\nCLIENT_ASSET_PREFIX=/\n\n# 管理后台运行端口\nADMIN_PORT=3002\n# 管理后台资源地址（假设部署到 https://xx.com，就将 CLIENT_ASSET_PREFIX 设置为 https://xx.com，如果将资源上传到 cdn ，那就改为 cdn 地址）\nADMIN_ASSET_PREFIX=/\n\n# 服务端运行端口\nSERVER_PORT=3003\n# 服务端完整访问路径\nSERVER_API_URL=http://localhost:3003/api\n# 服务端接口前缀（假设将希望通过 http://xx:com/api 来访问，那就设置为 /api；如果 http://xx:com，那就设置为 / ）\nSERVER_API_PREFIX=/api\n# 默认管理员账户名\nADMIN_USER=admin\n# 默认管理员账密码\nADMIN_PASSWD=admin\n# 以下为数据库配置，请先创建好表\nDB_HOST=127.0.0.1\nDB_PORT=3306\nDB_USER=root\nDB_PASSWD=root\nDB_DATABASE=wipi\n\n# Github 第三方登录配置\n# 关于 Github OAuth 可参考 https://www.ruanyifeng.com/blog/2019/04/github-oauth.html\nGITHUB_CLIENT_ID=0 # Github OAuth 登录 Id\nGITHUB_CLIENT_SECRET=0 # Github OAuth 登录 Secret\n```\n\n### 项目部署\n\n生产环境部署的脚本如下：\n\n```bash\n\nnode -v\nnpm -v\n\nnpm config set registry http://registry.npmjs.org\n\nnpm i -g pm2 @nestjs/cli pnpm\n\npnpm install\npnpm run build\npnpm run pm2\n\npm2 startup\npm2 save\n```\n\n### nginx 配置\n\n采用反向代理进行 `nginx` 配置，**同时设置 `proxy_set_header X-Real-IP $remote_addr;` 以便服务端获取到真实 ip 地址**。\n\n```bash\nupstream wipi_client {\n  server 127.0.0.1:3000;\n  keepalive 64;\n}\n\n# http -\u003e https 重定向\nserver {\n  listen  80;\n  server_name 域名;\n  rewrite ^(.*)$  https://$host$1 permanent;\n}\n\nserver {\n  listen 443 ssl;\n  server_name 域名;\n  ssl_certificate      证书存放路径;\n  ssl_certificate_key  证书存放路径;\n\n  location / {\n    proxy_http_version 1.1;\n    proxy_set_header Upgrade $http_upgrade;\n    proxy_set_header Connection \"upgrade\";\n    proxy_set_header Host $host;\n    proxy_set_header X-Nginx-Proxy true;\n    proxy_cache_bypass $http_upgrade;\n    proxy_pass http://wipi_client; #反向代理\n    proxy_set_header X-Real-IP $remote_addr;\n    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n  }\n}\n```\n\n## 资料\n\n- next.js 源码：https://github.com/vercel/next.js\n- next.js 文档：https://nextjs.org/\n- nest.js 源码：https://github.com/nestjs/nest\n- nest.js 文档：https://nestjs.com/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffantasticit%2Fwipi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffantasticit%2Fwipi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffantasticit%2Fwipi/lists"}