这是一个由nodejs搭建的博客系统,不断完善中,后端采用nodejs最好的框架nestjs,使用typescript开发,,以及使用MongoDB数据库,认证部分使用JWT认证,上传接入阿里OSS,接入swagger,内容不断完善中。。。
v0.0.1已上线 使用docker虚拟化的nodejs+mongodb+pm2,构建于阿里云服务器
api地址:http://api.forpad.net
-
用户模块
- 用户注册
- 用户登录
- 用户权限认证
- 用户权限细分
-
公共模块
- 接入oss文件上传
- 网站信息配置
-
认证模块
- 用户组区分
- 用户组权限管理
-
META模块(标签/分类)
- meta查看(根据type)
- META及分页查询
- META删除
- META修改
-
文章模块
- 文章查看
- 文章列表查询分页
- 文章新增
- 文章删除
- 文章修改
- 上传的数据进行用pipe做校验
- 文章归档
- 热门文章
- 相册
- 随机文章
-
评论模块
- 评论新增
- 最新评论
- 评论删除
- 所有评论查询
-
文件存储
已经接入阿里云oss上传
-
服务端日志系统
接口采用RESTful API设计规范
有auth的接口表示需要token认证,token默认有效期为30天
/article/
- @GET query({pageSize=10,pageCurrent=1} ) 拉取文章列表
- @GET /param(_id:string) param 读取文章详情
- @PUT /param(_id:string) + body(article:Article) [auth] 修改文章详情
- @POST body(article:Article) [auth] 创建文章
- @DELETE /param(_id:string) [auth] 删除文章
/user/
- POST body({name:string,passwd:string}) 注册用户
- POST param /login body({name:string,passwd:string}) 用户登录
/meta/
根据RESTful风格的增删改查
@post /article/:id/comment
@post /publish/upload
$ npm install
$ npm run start
$ npm run start:dev
$ npm run start:prod
$ npm run test
$ npm run test:e2e
$ npm run test:cov