{"id":13670277,"url":"https://github.com/hezhongfeng/Koa2-Blog","last_synced_at":"2025-04-27T09:32:32.569Z","repository":{"id":98707337,"uuid":"60073452","full_name":"hezhongfeng/Koa2-Blog","owner":"hezhongfeng","description":"第一个web项目，仿照cnode，欢迎新建账号试用","archived":true,"fork":false,"pushed_at":"2019-10-29T12:21:34.000Z","size":22202,"stargazers_count":138,"open_issues_count":3,"forks_count":37,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-09-29T07:21:17.726Z","etag":null,"topics":["cloudinary","cnode","dota","ejs","heroku","koa2","koa2-blog","mysql","semantic-ui","sequelize"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/hezhongfeng.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}},"created_at":"2016-05-31T08:52:46.000Z","updated_at":"2024-01-15T09:50:02.000Z","dependencies_parsed_at":"2023-03-14T04:01:17.572Z","dependency_job_id":null,"html_url":"https://github.com/hezhongfeng/Koa2-Blog","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hezhongfeng%2FKoa2-Blog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hezhongfeng%2FKoa2-Blog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hezhongfeng%2FKoa2-Blog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hezhongfeng%2FKoa2-Blog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hezhongfeng","download_url":"https://codeload.github.com/hezhongfeng/Koa2-Blog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224067093,"owners_count":17250109,"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":["cloudinary","cnode","dota","ejs","heroku","koa2","koa2-blog","mysql","semantic-ui","sequelize"],"created_at":"2024-08-02T09:00:37.533Z","updated_at":"2024-11-11T07:31:23.727Z","avatar_url":"https://github.com/hezhongfeng.png","language":"HTML","funding_links":[],"categories":["HTML"],"sub_categories":[],"readme":"# koa2-Blog\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"http://hezfblog.herokuapp.com\"\u003e\n    \u003cimg src=\"https://rawgit.com/hezhongfeng/Koa2-Blog/master/images/icon.png\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n![issues](https://img.shields.io/github/issues/hezhongfeng/Koa2-Blog.svg)    ![stars](https://img.shields.io/github/stars/hezhongfeng/Koa2-Blog.svg)    ![forks](https://img.shields.io/github/forks/hezhongfeng/Koa2-Blog.svg)    ![juejin](https://badge.juejin.im/entry/587d8f4fb123db4d5e7e573d/likes.svg?style=flat-square)\n\n- [线上体验](http://hezfblog.herokuapp.com/)\n- 欢迎新建账号试用，有问题直接提issue,因为部署在heroku上面速度不会快\n\n## 简要说明\n1. 在学习Qt中QML的时候接触了JavaScript,后来知道可以用node做网站就有了一个想法，学习制作一个网站。公司的业务也是这方面的,自己独立制作会给我很大的帮助\n2. 选择做什么类型网站的时候，选择做一个简单的博客类网站，模仿对象是[cnode](https://cnodejs.org/)\n3. node框架选择的时候选择了Koa2，因为比较新，也有很多人说是未来的趋势\n\n## 涉及到的技术问题\n- 使用ES7的Async/Await,避免回调地狱\n- 模板引擎使用的ejs,因为比较简单,html也不熟\n- 数据库使用的mysql,ORM使用的sequelize\n- 前端框架使用的Semantic UI\n\n## 功能\n1. 新建、登录账户\n2. 账户基本信息设置,包括头像\n3. 发表主题文章\n4. 在文章下面回复，@别人进行回复，在别人回复下面直接回复\n5. 积分、积分系统\n6. 使用爬虫做的DOTA2比赛预告信息\n\n## 我做的时候涉及到的问题点\n1. 文件上传时寻找合适的 body 解析包，后来找到`koa-better-body`，其他的包可能是我没用明白\n2. 前端UI框架使用的`Semantic UI`因为，`nswbmw`写的教程里面使用的它，当时还不知道别的UI框架\n3. 写主题文章时想找比较好的markdown前端UI,最喜欢的是`segmentfault`上的，后来使用的`Houfeng`的[mditor](https://github.com/Houfeng/mditor)也挺不错的\n4. 头像上传用的[cloudinary](http://cloudinary.com/),现在估计会使用七牛云了\n5. 上传头像进行剪裁的库使用的[cropper](https://github.com/fengyuanchen/cropper)\n6. 爬虫使用的是`cheerio`和`node-schedule`非常简单，这里爬的DOTA2的比赛时间表，同时为了防止heroku休眠，我把自己的网站给爬了，因为可以唤醒......\n7. 实现at某用户时参考cnode的源码使用的atwho,然后后台读取数据时将@xx 替换成符合markdown的链接的格式 \n8. heroku是个好东西，git远程更新完就自动运行，同时提供了mysql和很多别的数据库\n\n## 感谢\n1. 感谢[koa2-easy](https://github.com/Lxxyx/koa2-easy)这个框架，是在此基础上做的很多功能的添加\n2. 感谢[nswbmw](https://github.com/nswbmw)大神的几个项目，我都学习了很多\n3. 感谢[cnode](https://cnodejs.org/)网站，在上面问了很多问题，有很多好心人照顾我这个小白\n4. 最后感谢各种包的作者，他们孜孜不倦的更新维护才能让我们拿来就用\n\n## 截图\n### 注册\n![注册](https://rawgit.com/hezhongfeng/Koa2-Blog/master/images/signup.png)\n### 登录\n![登录](https://rawgit.com/hezhongfeng/Koa2-Blog/master/images/login.png)\n### 首页\n![首页](https://rawgit.com/hezhongfeng/Koa2-Blog/master/images/home.png)\n### 发布文章页\n![发布](https://rawgit.com/hezhongfeng/Koa2-Blog/master/images/createTopic.png)\n### 查看文章页\n![查看](https://rawgit.com/hezhongfeng/Koa2-Blog/master/images/topic.png)\n### 未读消息\n![消息](https://rawgit.com/hezhongfeng/Koa2-Blog/master/images/message.png)\n### 设置\n![设置](https://rawgit.com/hezhongfeng/Koa2-Blog/master/images/setting.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhezhongfeng%2FKoa2-Blog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhezhongfeng%2FKoa2-Blog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhezhongfeng%2FKoa2-Blog/lists"}