{"id":13491511,"url":"https://github.com/liuxing/node-blog","last_synced_at":"2025-04-05T02:11:07.366Z","repository":{"id":83544691,"uuid":"130329575","full_name":"liuxing/node-blog","owner":"liuxing","description":":rocket:《Node.js从入门到上线》A blog build with Koa2.","archived":false,"fork":false,"pushed_at":"2019-03-29T01:34:41.000Z","size":3150,"stargazers_count":659,"open_issues_count":5,"forks_count":115,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-03-29T01:13:33.925Z","etag":null,"topics":["blog","koa","mongodb","nodejs","tutorial"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/liuxing.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":"2018-04-20T07:58:57.000Z","updated_at":"2024-12-21T05:01:29.000Z","dependencies_parsed_at":"2023-07-07T17:45:58.549Z","dependency_job_id":null,"html_url":"https://github.com/liuxing/node-blog","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/liuxing%2Fnode-blog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liuxing%2Fnode-blog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liuxing%2Fnode-blog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liuxing%2Fnode-blog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liuxing","download_url":"https://codeload.github.com/liuxing/node-blog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247276189,"owners_count":20912288,"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","koa","mongodb","nodejs","tutorial"],"created_at":"2024-07-31T19:00:57.706Z","updated_at":"2025-04-05T02:11:07.347Z","avatar_url":"https://github.com/liuxing.png","language":"HTML","readme":"# node-blog  \n\n[![License](https://img.shields.io/github/license/liuxing/abc-blog.svg)](https://github.com/liuxing/abc-blog/blob/master/LICENSE) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg) ](http://standardjs.com)  \n\n\u003e 《Node.js从入门到上线》—— Koa2 + MongoDB 搭建博客系统\n\n\n\n### 脚手架工具[![npm](https://img.shields.io/npm/v/koa2-starter.svg)](https://www.npmjs.com/package/koa2-starter) \n\n之前一个同学说，要新建这么多文件好麻烦。所以写了个脚手架工具： [koa2-starter-cli](https://github.com/liuxing/koa2-starter-cli) 可通过命令行接口自定义模板引擎以及ESLint，同时包含了nodemon、husky、lint-staged、commitizen之类的辅助工具。*(目录结构与本教程略微有不同)*\n\n使用方式：\n\n```bash\n# 下载脚手架工具\n$ npm install -g koa2-starter\n# 生成项目\n$ koa2 init \u003cproject-name\u003e\n# 进入项目\n$ cd \u003cproject-name\u003e\n$ git init\n$ npm install\n$ npm run dev\n```\n\n更多详细：[koa2-starter-cli](https://github.com/liuxing/koa2-starter-cli) \n\n## Table of contents\n\n### 入门篇\n\n[1.1  Node.js 的安装与配置](https://github.com/liuxing/abc-blog/tree/master/docs/1.1Node.js的安装与配置.md)\n\n- [安装Node.js](https://github.com/liuxing/abc-blog/tree/master/docs/1.1Node.js的安装与配置.md#安装nodejs)\n- [使用nvm](https://github.com/liuxing/abc-blog/tree/master/docs/1.1Node.js的安装与配置.md#使用-nvm)\n- [一些有用的工具](https://github.com/liuxing/abc-blog/tree/master/docs/1.1Node.js的安装与配置.md#一些有用的工具)\n- [hello-node](https://github.com/liuxing/abc-blog/tree/master/docs/1.1Node.js的安装与配置.md#hello-node)\n\n[1.2 Node.js 基础概览](https://github.com/liuxing/abc-blog/tree/master/docs/1.2Node.js基础概览.md)\n\n- [node模块](https://github.com/liuxing/abc-blog/tree/master/docs/1.2Node.js基础概览.md#node模块)\n- [npm包管理器](https://github.com/liuxing/abc-blog/tree/master/docs/1.2Node.js基础概览.md#npm模块管理器)\n\n[2.1 Koa2初体验](https://github.com/liuxing/abc-blog/tree/master/docs/2.1Koa2初体验.md)\n\n- [Hello Koa2](https://github.com/liuxing/abc-blog/tree/master/docs/2.1Koa2初体验.md#hello-koa2)\n\n- [使用supervisor 或者 nodemon](https://github.com/liuxing/abc-blog/tree/master/docs/2.1Koa2初体验.md#使用supervisor-或者-nodemon)\n\n[2.2 MongoDB的安装及使用](https://github.com/liuxing/abc-blog/tree/master/docs/2.2MongoDB安装及使用.md)\n\n[3.1 开发前的项目配置](https://github.com/liuxing/abc-blog/tree/master/docs/3.1开发前的项目配置.md)\n\n- [规划项目目录结构](https://github.com/liuxing/abc-blog/tree/master/docs/3.1开发前的项目配置.md#规划项目目录结构)\n- [使用editorconfig](https://github.com/liuxing/abc-blog/tree/master/docs/3.1开发前的项目配置.md#使用editorconfig)\n- [使用commitizen](https://github.com/liuxing/abc-blog/tree/master/docs/3.1开发前的项目配置.md#使用commitizen)\n- [使用eslint](https://github.com/liuxing/abc-blog/tree/master/docs/3.1开发前的项目配置.md#使用eslint)\n- [使用Git hooks自动检查代码](https://github.com/liuxing/abc-blog/tree/master/docs/3.1开发前的项目配置.md#使用git-hooks自动检查代码)\n\n[3.2 把项目跑起来](https://github.com/liuxing/abc-blog/tree/master/docs/3.2把项目跑起来.md)\n\n- [router](https://github.com/liuxing/abc-blog/tree/master/docs/3.2把项目跑起来.md#router)\n- [配置模板引擎](https://github.com/liuxing/abc-blog/tree/master/docs/3.2把项目跑起来.md#配置模板引擎)\n- [配置静态资源](https://github.com/liuxing/abc-blog/tree/master/docs/3.2把项目跑起来.md#配置静态资源)\n\n[3.3 使用mongoose操作数据库](https://github.com/liuxing/abc-blog/tree/master/docs/3.3操作数据库.md)\n\n- [设计Schema](https://github.com/liuxing/abc-blog/tree/master/docs/3.3操作数据库.md#设计schema)\n\n- [使用model](https://github.com/liuxing/abc-blog/tree/master/docs/3.3操作数据库.md#使用model)\n\n[3.4用户注册与登录](https://github.com/liuxing/abc-blog/blob/master/docs/3.4用户注册与登录.md)\n\n- [cookie与session](https://github.com/liuxing/abc-blog/blob/master/docs/3.4用户注册与登录.md#cookie与session)\n- [用户注册](https://github.com/liuxing/abc-blog/blob/master/docs/3.4用户注册与登录.md#用户注册)\n- [用户登录](https://github.com/liuxing/abc-blog/blob/master/docs/3.4用户注册与登录.md#用户登录)\n- [用户登出](https://github.com/liuxing/abc-blog/blob/master/docs/3.4用户注册与登录.md#用户登出)\n\n[3.5 koa2中间件开发](https://github.com/liuxing/abc-blog/blob/master/docs/3.5koa2中间件开发.md)\n\n- [koa2 中间件机制](https://github.com/liuxing/abc-blog/blob/master/docs/3.5koa2中间件开发.md#koa2-中间件机制)\n\n- [消息闪现中间件](https://github.com/liuxing/abc-blog/blob/master/docs/3.5koa2中间件开发.md#消息闪现中间件)\n\n[3.6 文章增删改查](https://github.com/liuxing/abc-blog/blob/master/docs/3.6文章增删改查.md)\n\n- [文章模型设计](https://github.com/liuxing/abc-blog/blob/master/docs/3.6文章增删改查.md#文章模型设计)\n- [文章发表](https://github.com/liuxing/abc-blog/blob/master/docs/3.6文章增删改查.md#文章发表)\n- [文章列表与详情](https://github.com/liuxing/abc-blog/blob/master/docs/3.6文章增删改查.md#文章列表与详情)\n- [文章编辑与删除](https://github.com/liuxing/abc-blog/blob/master/docs/3.6文章增删改查.md#文章编辑与删除)\n\n[3.7 用户权限控制](https://github.com/liuxing/abc-blog/blob/master/docs/3.7用户权限控制.md)\n\n- [登录状态检查](https://github.com/liuxing/abc-blog/blob/master/docs/3.7用户权限控制.md#登录状态检查)\n- [管理权限控制](https://github.com/liuxing/abc-blog/blob/master/docs/3.7用户权限控制.md#管理权限控制)\n\n[3.8 评论功能](https://github.com/liuxing/abc-blog/blob/master/docs/3.8评论功能.md)\n\n- [设计评论的模型](https://github.com/liuxing/abc-blog/blob/master/docs/3.8评论功能.md#设计评论的模型)\n- [发布留言](https://github.com/liuxing/abc-blog/blob/master/docs/3.8评论功能.md#发布留言)\n- [显示留言](https://github.com/liuxing/abc-blog/blob/master/docs/3.8评论功能.md#发布留言)\n- [删除留言](https://github.com/liuxing/abc-blog/blob/master/docs/3.8评论功能.md#删除留言)\n\n[3.9 一些安全问题](https://github.com/liuxing/abc-blog/blob/master/docs/3.9一些安全问题.md)\n\n- [XSS的防范](https://github.com/liuxing/abc-blog/blob/master/docs/3.9一些安全问题.md#xss的防范)\n- [CSRF的防范](https://github.com/liuxing/abc-blog/blob/master/docs/3.9一些安全问题.md#csrf-的防范)\n\n[3.10 分类管理](https://github.com/liuxing/abc-blog/blob/master/docs/3.10文章分类.md)\n\n- [分类模型](https://github.com/liuxing/abc-blog/blob/master/docs/3.10文章分类.md#分类模型设计)\n- [分类管理主页](https://github.com/liuxing/abc-blog/blob/master/docs/3.10文章分类.md#分类管理主页)\n- [新增与删除](https://github.com/liuxing/abc-blog/blob/master/docs/3.10文章分类.md#新增分类)\n\n[3.11 分页功能](https://github.com/liuxing/abc-blog/blob/master/docs/3.11分页功能.md)\n\n- [MongoDB分页原理](https://github.com/liuxing/abc-blog/blob/master/docs/3.11分页功能.md#mongodb-实现分页原理)\n- [实现一个基本的分页器](https://github.com/liuxing/abc-blog/blob/master/docs/3.11分页功能.md#实现一个基本的分页器)\n- [高级一点儿的分页器](https://github.com/liuxing/abc-blog/blob/master/docs/3.11分页功能.md#高级一点儿的分页器)\n\n[3.12 koa2错误处理及404](https://github.com/liuxing/abc-blog/blob/master/docs/3.12koa2错误处理及404.md)\n\n- [ ] 3.13 测试\n- [ ] 3.14 持续集成\n\n### 上线篇\n\n[4.1 域名与服务器](https://github.com/liuxing/abc-blog/blob/master/docs/4.1域名与服务器.md)\n\n- [IP与域名](https://github.com/liuxing/abc-blog/blob/master/docs/4.1域名与服务器.md#IP与域名)\n- [域名与服务器选购](https://github.com/liuxing/abc-blog/blob/master/docs/4.1域名与服务器.md#域名选购)\n- [连接服务器](https://github.com/liuxing/abc-blog/blob/master/docs/4.1域名与服务器.md#连接服务器)\n- [域名解析](https://github.com/liuxing/abc-blog/blob/master/docs/4.1域名与服务器.md#域名解析)\n\n## License\n\n[MIT](https://github.com/liuxing/abc-blog/blob/master/LICENSE) .  Copyright (c) Liu Xing\n\n本作品采用[知识共享 署名-非商业性使用 4.0 国际许可协议](http://creativecommons.org/licenses/by-nc/4.0/) 进行许可。\n\n[![知识共享许可协议](https://i.creativecommons.org/l/by-nc/4.0/88x31.png)](http://creativecommons.org/licenses/by-nc/4.0/)\n","funding_links":[],"categories":["HTML"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliuxing%2Fnode-blog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliuxing%2Fnode-blog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliuxing%2Fnode-blog/lists"}