Giter Club home page Giter Club logo

koa-mongodb's Introduction

koa2

node yarn MIT

✨✨koa2框架,mongodb作为数据库,Es6/7语法编写,babel编译ES语法。


增加ts语法支持,进行ing

前后端分离,后台管理系统, Koa后端

系统目前包含 文章发布管理系统、标签系统、评论系统、用户系统,四大模块

技术栈

使用koa+mongoose 开发;

  • 使用koa2.0作为开发框架
  • mongoose作为数据库,保存数据
  • 使用jwt进行token的生成和校验
  • 通过Es6语法进行项目编写
  • 文件结构采用MC拆分
  • babel-register编译Es6/7/8
  • esLint语法规则

server下为目录结构:

.
|——server
|  |—— config                     全局配置
|  |—— constant                   常量
|  |   |—— index.js               暴露全部常量
|  |   └── user.js                用户常量
|  |—— controller                 对应路由的逻辑处理
|  |   |—— article.js             文章 控制器 接口
|  |   └── comment.js             评论 控制器 接口
|  |   └── tag.js                 标签 控制器 接口
|  |   └── user.js                用户 控制器 接口
|  |—— middleware                 路由中间件
|  |—— model                      mongoose数据库模型
|  |   |—— ArticleModel.js        文章模型
|  |   |—— TagModel.js            标签模型
|  |   └── UserModel.js           用户模型
|  |   └── CommentModel.js        评论模型
|  |—— mongoose                   数据库方法暴露
|  |—— public                     静态资源目录
|  |—— router                     路由文件
|  |   |—— index.js               路由
|  |   |—— api.js                 api路由
|  |   └── user.js                user路由
|  |—— utils                      公共方法
|  |—— app.js                     app入口文件

调试运行

$ yarn install 

<!-- 需要开启管理权限设置 -->
$ mongod  //开启mongoDB

$ npm run dev //本地测试服务

API接口

后端 接口文档

LICENSE

MIT

koa-mongodb's People

Contributors

herrylo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.