{"id":15040543,"url":"https://github.com/biaochenxuying/blog-node","last_synced_at":"2025-04-04T21:09:39.714Z","repository":{"id":33464037,"uuid":"158551622","full_name":"biaochenxuying/blog-node","owner":"biaochenxuying","description":"基于 node + express  + mongodb 的博客网站后台","archived":false,"fork":false,"pushed_at":"2022-12-09T07:25:39.000Z","size":221,"stargazers_count":554,"open_issues_count":17,"forks_count":167,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-28T20:08:39.437Z","etag":null,"topics":["blog","express","mongodb","mongoose","node","node-mongodb"],"latest_commit_sha":null,"homepage":"https://biaochenxuying.cn","language":"JavaScript","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/biaochenxuying.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}},"created_at":"2018-11-21T13:24:39.000Z","updated_at":"2025-03-23T14:59:45.000Z","dependencies_parsed_at":"2023-01-15T01:02:01.154Z","dependency_job_id":null,"html_url":"https://github.com/biaochenxuying/blog-node","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biaochenxuying%2Fblog-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biaochenxuying%2Fblog-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biaochenxuying%2Fblog-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biaochenxuying%2Fblog-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/biaochenxuying","download_url":"https://codeload.github.com/biaochenxuying/blog-node/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247249530,"owners_count":20908212,"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":["blog","express","mongodb","mongoose","node","node-mongodb"],"created_at":"2024-09-24T20:44:43.310Z","updated_at":"2025-04-04T21:09:39.683Z","avatar_url":"https://github.com/biaochenxuying.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![项目结构图](https://upload-images.jianshu.io/upload_images/12890819-3348be07c69aa2b9.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)\n\n## 前言\n\nblog-node 是采用了主流的前后端分离思想的，主里只讲 后端。\n\n效果请看 [https://biaochenxuying.cn](https://biaochenxuying.cn)\n\n项目详情请看这篇文章：[基于 node + express + mongodb 的 blog-node 项目文档说明](https://biaochenxuying.cn/articleDetail?article_id=5bf8c57185e0f13af26e7d0d)\n\n## 已经实现功能\n\n- [x] 登录\n- [x] 文章管理\n- [x] 标签管理\n- [x] 评论\n- [x] 留言管理\n- [x] 用户管理\n- [x] 友情链接管理\n- [x] 时间轴管理\n- [x] 身份验证\n- [x] 项目展示\n- [x] 第三方 github 授权登录\n- [x] 文章归档\n\n## 待实现功能\n\n- [ ] 个人中心（用来设置博主的各种信息）\n- [ ] 工作台（ 接入百度统计接口，查看网站浏览量和用户访问等数据 ）\n\n## 技术\n\n- node\n- cookie-parser : \"~1.4.3\"\n- crypto : \"^1.0.1\"\n- express: \"~4.16.0\"\n- express-session : \"^1.15.6\",\n- http-errors : \"~1.6.2\",\n- mongodb : \"^3.1.8\",\n- mongoose : \"^5.3.7\",\n- mongoose-auto-increment : \"^5.0.1\",\n- yargs : \"^12.0.2\"\n\n## 注意点\n\n- 文章是分类型的：文章类型 =\u003e 1: 普通文章，2: 简历，3: 管理员介绍；而且简历和管理员介绍的文章只能是各自一篇（因为前台展示那里有个导航 关于我 ，就是请求管理员介绍这篇文章的，简历也是打算这样子用的），普通文章可以是无数篇。\n- 点赞的用户 like_users 那里应该只保存用户 id 的，这个后面修改一下。\n- 评论功能是实现了简单的三级评论的，第三者的评论（就是别人对一级评论进行再评论）放在 other_comments 里面。\n- 评论是有状态的：状态 =\u003e 0 待审核 / 1 通过正常 / -1 已删除 / -2 垃圾评论。\n- 管理一级和三级评论是设置前台能不能展示的，默认是展示，如果管理员看了，是条垃圾评论就 设置为 -1 或者 -2 ，进行隐藏，前台就不会展现了。\n\n## Build Setup ( 构建安装 )\n\n```\n# install dependencies\nnpm install\n\n# serve with hot reload at localhost: 3000\nnpm start\n\n# build for production with minification\n请使用 pm2 ，可以永久运行在服务器上，且不会一报错 node 程序就挂了。\n```\n\n## 项目常见问题\n\n\n### 管理后台登录\n\n管理后台登录是用 **邮箱加密码** 进行登录\n\n\n### 管理员账号创建\n\n![](https://upload-images.jianshu.io/upload_images/12890819-67861a912768e646.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)\n\n管理后台的登录账号并不是 admin/user ，也不是搭建 mongodb 数据库时创建的 user 用户，这里的账号和密码要自己创建，至于怎样创建呢？\n\n#### 用 postman 调接口注册\n\n如果是本地的可以像这样子创建，如果是服务器上的，请把 url 修改一下，\n\n![注册](https://upload-images.jianshu.io/upload_images/12890819-3772744f72b8ed3e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)\n\n- 1.  url\n\n```\nhttp://127.0.0.1:3000/register\n```\n\n- 2. param\n\n```\n{\n \"name\": \"BiaoChenXuYing\",\n \"password\": \"888888\",\n \"email\": \"admin@qq.com\",\n \"phone\": 1380013800,\n \"type\": 0,\n \"introduce\":\"加班到天明，学习到昏厥!!! 微信公众号：【 BiaoChenXuYing 】，分享 WEB 全栈开发等相关的技术文章，热点资源，全栈程序员的成长之路。\"\n}\n```\n\n这里的 type 为 0 是管理员账号，为 1 时，是普通用户。\n\n## 项目地址与文档教程\n\n**项目地址：**\n\n\u003e [前台展示: https://github.com/biaochenxuying/blog-react](https://github.com/biaochenxuying/blog-react)\n\n\u003e [前台展示: https://github.com/biaochenxuying/blog-vue-typescript](https://github.com/biaochenxuying/blog-vue-typescript)\n\n\u003e [管理后台：https://github.com/biaochenxuying/blog-react-admin](https://github.com/biaochenxuying/blog-react-admin)\n\n\u003e [后端：https://github.com/biaochenxuying/blog-node](https://github.com/biaochenxuying/blog-node)\n\n\u003e [blog：https://github.com/biaochenxuying/blog](https://github.com/biaochenxuying/blog)\n\n**本博客系统的系列文章：**\n\n- 1. [react + node + express + ant + mongodb 的简洁兼时尚的博客网站](https://biaochenxuying.cn/articleDetail?article_id=5bf57a8f85e0f13af26e579b)\n- 2. [react + Ant Design + 支持 markdown 的 blog-react 项目文档说明](https://biaochenxuying.cn/articleDetail?article_id=5bf6bb5e85e0f13af26e57b7)\n- 3. [基于 node + express + mongodb 的 blog-node 项目文档说明](https://biaochenxuying.cn/articleDetail?article_id=5bf8c57185e0f13af26e7d0d)\n- 4. [服务器小白的我,是如何将 node+mongodb 项目部署在服务器上并进行性能优化的](https://biaochenxuying.cn/articleDetail?article_id=5bfa728bb54f044b4f9da240)\n- 5. [github 授权登录教程与如何设计第三方授权登录的用户表](https://biaochenxuying.cn/articleDetail?article_id=5c7bd34e42b55e2ecc90976d)\n- 6. [一次网站的性能优化之路 -- 天下武功，唯快不破](https://biaochenxuying.cn/articleDetail?article_id=5c8ca2d3b87b8a04f1860c9a)\n- 7. [Vue + TypeScript + Element 搭建简洁时尚的博客网站及踩坑记](https://biaochenxuying.cn/articleDetail?article_id=5c9d8ce5f181945ddd6b0ffc)\n- 8. [前端解决第三方图片防盗链的办法 - html referrer 访问图片资源403问题](https://biaochenxuying.cn/articleDetail?article_id=5cfcc6798090bd3c84138a08)\n\n\n## 服务器\n\n笔者觉得每个开发者都应该拥有自己的网站和服务器，这可是很酷的事情，学习 Linux、跑跑脚本、建站、搭博客啥的都行啊。\n\n因为笔者就有自己的服务器，而且有两台了，用于平时的学习，还搭建了自己的网站。\n\n有不少读者问过我，为什么我学的那么快的呢 ？ 怎么在一年内学了那么知识的...\n\n其实也没什么秘决，就是平时有自己的服务器了，就爱折腾，学到的知识能很快得到验证，所以学起来兴致高一点。\n\n特别是大三和大四的学生，买了服务器，搭建个项目给面试官看也香，对找工作和面试都加分，还可以熟悉技术栈。\n\n[想学得快，就得有自己的服务器来折腾才行（低于 1 折、89/年、229/3年，比学生机还便宜）](https://biaochenxuying.cn/articleDetail?article_id=5de65dd90283dc742f8f633a)\n\n比如笔者的两个网站：\n\n\u003e https://biaochenxuying.cn/\n\n\u003e https://www.kwgg2020.com/\n\n\n## 最后\n\n如果您觉得本项目和文章不错或者对你有所帮助，请给个星吧，你的肯定就是我继续创作的最大动力。\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiaochenxuying%2Fblog-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbiaochenxuying%2Fblog-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiaochenxuying%2Fblog-node/lists"}