Skip to content

Latest commit

 

History

History
135 lines (96 loc) · 2.35 KB

README.md

File metadata and controls

135 lines (96 loc) · 2.35 KB

介绍

这是一个由nodejs搭建的博客系统,不断完善中,后端采用nodejs最好的框架nestjs,使用typescript开发,,以及使用MongoDB数据库,认证部分使用JWT认证,上传接入阿里OSS,接入swagger,内容不断完善中。。。

上线

v0.0.1已上线 使用docker虚拟化的nodejs+mongodb+pm2,构建于阿里云服务器

api地址:http://api.forpad.net

TO DO LIST

  • 用户模块

    • 用户注册
    • 用户登录
    • 用户权限认证
    • 用户权限细分
  • 公共模块

    • 接入oss文件上传
    • 网站信息配置
  • 认证模块

    • 用户组区分
    • 用户组权限管理
  • META模块(标签/分类)

    • meta查看(根据type)
    • META及分页查询
    • META删除
    • META修改
  • 文章模块

    • 文章查看
    • 文章列表查询分页
    • 文章新增
    • 文章删除
    • 文章修改
    • 上传的数据进行用pipe做校验
    • 文章归档
    • 热门文章
    • 相册
    • 随机文章
  • 评论模块

    • 评论新增
    • 最新评论
    • 评论删除
    • 所有评论查询
  • 文件存储

    已经接入阿里云oss上传

  • 服务端日志系统

    API DOCUMENT

接口采用RESTful API设计规范

文档说明

有auth的接口表示需要token认证,token默认有效期为30天

文章模块

/article/

  1. @GET query({pageSize=10,pageCurrent=1} ) 拉取文章列表
  2. @GET /param(_id:string) param 读取文章详情
  3. @PUT /param(_id:string) + body(article:Article) [auth] 修改文章详情
  4. @POST body(article:Article) [auth] 创建文章
  5. @DELETE /param(_id:string) [auth] 删除文章

用户模块

/user/

  1. POST body({name:string,passwd:string}) 注册用户
  2. POST param /login body({name:string,passwd:string}) 用户登录

META模块

/meta/

根据RESTful风格的增删改查

评论模块

@post /article/:id/comment

公共模块

图片上传

@post /publish/upload

起步

$ npm install

development

$ npm run start

watch mode

$ npm run start:dev

production mode

$ npm run start:prod

Test

unit tests

$ npm run test

e2e tests

$ npm run test:e2e

test coverage

$ npm run test:cov