Git Product home page Git Product logo

koa2-template's Introduction

koa2-template

介绍

koa2-template是一个后端服务的解决方案,他基于koa-generator实现,但是koa-gengrator搭建的项目只有最基本的服务,如果我们使用它的话,还需要添加自己的配置,每次新建项目都要重复劳动,所以我就想着把我自己在实际工作中所搭建的项目模版开源出来,供大家参考学习,希望能对大家有所帮助。

软件架构

本项目已经为你生成了一个基本的后端开发框架,下面是整个项目的目录结构。

├── .husky                     # Git Hook 工具
├── bin                        # 启动目录
│   │── www                    # 启动文件配置
├── src                        # 源代码
│   ├── cache                  # 连接方法
│   ├── conf                   # 全局常量配置
│   ├── controller             # 控制层
│   ├── db                     # 数据库
│   ├── middlewares            # 中间件
│   ├── model                  # 响应模型
│   ├── public                 # 静态资源
│   ├── routes                 # 路由
│   ├── services               # 服务层
│   ├── utils                  # 工具函数
│   ├── validator              # 校验
│   ├── views                  # 前端模版文件-只做服务端忽略
│   ├── app.js                 # 入口文件
├── test                       # 测试
├── .cz-config.js              # 集成 Commitizen 实现规范提交配置文件
├── .editorconfig              # 编辑相关配置
├── .eslintignore              # eslint忽略文件
├── .eslintrc.js               # eslint 配置
├── .prettierrc                # Prettier 配置
├── commitlint.config.js       # 集成 commitlint 验证提交规范
├── package.json               # package.json 依赖

安装教程

前序准备

你需要在本地安装 node ,Koa 依赖 node v7.6.0 或 ES2015及更高版本和 async 方法支持。

安装依赖

npm install

启动本地开发环境(自带热启动)

npm run dev

构建生产环境

npm run prd

运行单元测试

npm run test

参与贡献

  1. Fork 本仓库
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request

License

MIT License

koa2-template's People

Contributors

sankeyangshu avatar

Stargazers

lzz avatar  avatar

Watchers

 avatar

koa2-template's Issues

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.