{"id":18979527,"url":"https://github.com/andyliwr/mbook","last_synced_at":"2025-04-05T11:10:29.346Z","repository":{"id":72159200,"uuid":"71529353","full_name":"Andyliwr/mbook","owner":"Andyliwr","description":"毕业设计--基于微信小程序的在线免费小说应用","archived":false,"fork":false,"pushed_at":"2023-02-21T12:30:51.000Z","size":42442,"stargazers_count":392,"open_issues_count":11,"forks_count":98,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-03-29T10:08:19.158Z","etag":null,"topics":["js","reader","wechat-mini-program"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/Andyliwr.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}},"created_at":"2016-10-21T04:19:18.000Z","updated_at":"2025-03-24T09:57:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"5b7e12fb-fcef-461b-8f9f-86cc3f22f3a2","html_url":"https://github.com/Andyliwr/mbook","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Andyliwr%2Fmbook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Andyliwr%2Fmbook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Andyliwr%2Fmbook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Andyliwr%2Fmbook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Andyliwr","download_url":"https://codeload.github.com/Andyliwr/mbook/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247325693,"owners_count":20920714,"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":["js","reader","wechat-mini-program"],"created_at":"2024-11-08T15:43:59.767Z","updated_at":"2025-04-05T11:10:29.329Z","avatar_url":"https://github.com/Andyliwr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## **微书--小程序阅读应用**\r\n\r\n毕业设计--基于微信小程序的在线免费小说的开发，该项目借助微信小程序的便捷特性，为用户提供快速，并且舒适的阅读体验。负责项目的原型设计，和小程序代码的开发。实现了书城，我的书单，以及在线阅读器功能，目前该项目已经吸引了一批身边爱好阅读的好友用户。\r\n\r\n## 体验一下\r\n\r\n可以搜索小程序---美景阅读\r\n\r\n## 源码探讨\r\n\r\n如有疑问欢迎在issue里留言，作者看到了会第一时间回复\r\n\r\n## 运行\r\n\r\n考虑到很多新手同学都是使用的 windows 开发的，这里专门做了一个 windows 的教程，详情请查看 https://www.yuque.com/docs/share/43ad4ef6-dbd4-4fa7-89d9-488804dc0f6f\r\n\r\n### 安装 mongodb\r\n\r\nwindows 系统可以参考我写的[教程](https://blog.csdn.net/u014374031/article/details/80268582)，mac 自己捣鼓，总之你需要创建一个名为 myapp 的数据库，本地可以不开启认证，后端运行起来后可以正常连接 mongo 就行。\r\n\r\n\u003e ps: Mongo 的连接配置都在 `api/server/datasources.json` 里，需要安装具体情况自行修改\r\n\r\n### 安装 redis\r\n\r\n参考[教程](https://www.runoob.com/redis/redis-install.html)，安装成功之后启动 redis，后端运行起来可以正常连接 redis 就可以了\r\n\r\n\u003e ps：redis 的连接配置写在了 `api/server/models/my-app-user.js` 里，需要安装具体情况自行修改\r\n\r\n### 快捷启动\r\n\r\n因为本人以前也是用的 `windows` ，所以为了避免每次都敲代码启动 `mongo` 和 `redis` ，所以在 `autorun/windows`下写了一些脚本\r\n但是这个不是立即就能使用的，需要自行改下 mongo 和 redis 的启动路径，具体的自己去看，如果你配置 ok 的话可以在 cmd 中直接运行 `./autorun/windows/start.bat` 来图像化界面启动各种程序。\r\n\r\n## 启动后端程序\r\n\r\n```bash\r\ncd api\r\n# 安装依赖，可以使用yarn或者cnpm\r\n# cnpm不会装的参考 https://developer.aliyun.com/mirror/NPM?from=tnpm\r\ncnpm install\r\n# 启动程序\r\nnpm run start\r\n#\r\n```\r\n\r\n如果打印 `Web server listening at: http://localhost:9001`，恭喜你启动成功了\r\n\r\n打开 `http://localhost:9001/explorer/` 就能看到项目下的所有接口\r\n\r\n## 运行小程序\r\n\r\n去[微信小程序官网](https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html)下载一个开发者工具，然后打开项目下的 `weixin` 目录即可\r\n\r\n\u003e ps 为了方便运行登录接口都是使用的 mock 数据，如果你有自己的小程序 ID，可以到 `api/server/models/my-app-user.js` 自行修改\r\n\r\n![2020-05-03-21-08-44](https://file.lantingshucheng.com/2020-05-03-21-08-44.png)\r\n\r\n## 爬虫\r\n\r\n[爬虫部分说明](https://github.com/Andyliwr/mbook/blob/develop/reptile/README.md)\r\n\r\n### **目录说明**\r\n\r\n```\r\nreptile --- 所有的爬虫目录\r\n  |- config.js --- 配置文件\r\n  |- index.js --- 主程序\r\n  |- init-database.js --- 初始化数据库，主要是往数据库写入一些书籍数据\r\n  |- utils\r\n    |- chineseToNum.js --- 解析数字，比如一千二百会变成1200\r\n    |- fakeUserAgent.js --- 随机userAgent，反爬虫\r\n    |- log.js --- 打日志到本地\r\n    |- proxy.js --- ip代理\r\n    |- redis.js --- redis方法\r\n  |- models\r\n    |- book.js --- 书籍表定义\r\n    |- chapter.js --- 章节表定义\r\n  |- package.json --- npm\r\n```\r\n\r\n### 其他\r\n\r\n爬虫的原理是扫描数据库中所有的书籍，然后根据书籍的最新章节字段-newest，以及配置在 source 字段里的书籍来源去分析需要更新哪些章节。\r\n这个爬虫可以用来初始化整本书，newest 默认为 0\r\n\r\n### 运行\r\n\r\n第一次下载项目可以运行 `npm run init`，这会往书籍表中写入测试书籍\r\n修改 mongo 配置文件就可以运行爬虫了\r\n执行爬虫可以运行 `npm run start`\r\n\r\n## 项目截图\r\n\r\n### 小程序\r\n\r\n\u003cdiv\u003e\r\n\u003cimg src=\"https://file.lantingshucheng.com/1521214550813.png\" alt=\"\" style=\"width: 180px; height: auto\"\u003e\r\n\u003cimg src=\"https://file.lantingshucheng.com/1521214553929.png\" alt=\"\" style=\"width: 180px; height: auto\"\u003e\r\n\u003cimg src=\"https://file.lantingshucheng.com/1521214558128.png\" alt=\"\" style=\"width: 180px; height: auto\"\u003e\r\n\u003cimg src=\"https://file.lantingshucheng.com/1521214565101.png\" alt=\"\" style=\"width: 180px; height: auto\"\u003e\r\n\u003cimg src=\"https://file.lantingshucheng.com/1521214567465.png\" alt=\"\" style=\"width: 180px; height: auto\"\u003e\r\n\u003cimg src=\"https://file.lantingshucheng.com/1521214571074.png\" alt=\"\" style=\"width: 180px; height: auto\"\u003e\r\n\u003cimg src=\"https://file.lantingshucheng.com/1521214572862.png\" alt=\"\" style=\"width: 180px; height: auto\"\u003e\r\n\u003cimg src=\"https://file.lantingshucheng.com/1521214576135.png\" alt=\"\" style=\"width: 180px; height: auto\"\u003e\r\n\u003cimg src=\"https://file.lantingshucheng.com/1521214578084.png\" alt=\"\" style=\"width: 180px; height: auto\"\u003e\r\n\u003cimg src=\"https://file.lantingshucheng.com/1521214580699.png\" alt=\"\" style=\"width: 180px; height: auto\"\u003e\r\n\u003cimg src=\"https://file.lantingshucheng.com/1521214583072.png\" alt=\"\" style=\"width: 180px; height: auto\"\u003e\r\n\u003cimg src=\"https://file.lantingshucheng.com/1521214585790.png\" alt=\"\" style=\"width: 180px; height: auto\"\u003e\r\n\u003c/div\u003e\r\n\r\n### 后台\r\n\r\n![2020-05-03-20-56-31](https://file.lantingshucheng.com/2020-05-03-20-56-31.png)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandyliwr%2Fmbook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandyliwr%2Fmbook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandyliwr%2Fmbook/lists"}