All Projects → SammyLiang97 → Mikey

SammyLiang97 / Mikey

Licence: other
For TinyProgram Based On TypeScript , Koa + MongoDB + Mocha TEST

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Mikey

hardhat-gas-reporter
Gas usage per unit test. Average gas usage per method. (eth-gas-reporter for Hardhat)
Stars: ✭ 233 (+1564.29%)
Mutual labels:  mocha
WeChatMiniAppSignalRClient
微信小程序 Asp.net Core SignalR Client 代码片段演示
Stars: ✭ 27 (+92.86%)
Mutual labels:  wechat-mini-program
swipeTab
微信小程序的swipetab
Stars: ✭ 23 (+64.29%)
Mutual labels:  wechat-mini-program
miniprogram-template
a wechat miniprogram template project the best practice with miniprogram-build 小程序模板最佳实践(TypeScript)
Stars: ✭ 46 (+228.57%)
Mutual labels:  wechat-mini-program
alexa-skill-boilerplate
An easy to use Amazon Alexa Skill Boilerplate for fast skill creation
Stars: ✭ 54 (+285.71%)
Mutual labels:  mocha
mp-progress
专注于小程序圆环形进度条的小工具
Stars: ✭ 72 (+414.29%)
Mutual labels:  wechat-mini-program
MP-CU
MP-CU, colorui3.x 微信小程序原生版
Stars: ✭ 141 (+907.14%)
Mutual labels:  wechat-mini-program
react-multi-context
Manage multiple React 16 contexts with a single component.
Stars: ✭ 19 (+35.71%)
Mutual labels:  mocha
classmate-map
🧭 一款设计精美、体验优良的地图信息展示小程序,一个更有意思的同学录,可以在小程序中查看班级同学的毕业去向以及地域分布,多联(蹭)系(饭)。
Stars: ✭ 79 (+464.29%)
Mutual labels:  wechat-mini-program
cucumber-steps
🥒 Quick start for testing with Cucumber.js
Stars: ✭ 15 (+7.14%)
Mutual labels:  mocha
tic-tac-toe-game-using-bit
Simple Tic Tac Toe game built with react-typescript components
Stars: ✭ 19 (+35.71%)
Mutual labels:  mocha
Expenses
Keep track of your expenses the smart way 💰
Stars: ✭ 15 (+7.14%)
Mutual labels:  mocha
react-ssr-spa
Server side rendered single page app using reactjs official libraries.
Stars: ✭ 30 (+114.29%)
Mutual labels:  mocha
WeBlog
typecho微信小程序插件+微信小程序源码
Stars: ✭ 36 (+157.14%)
Mutual labels:  wechat-mini-program
Taro-ParserRichText
适用于 Taro 的小程序富文本组件
Stars: ✭ 32 (+128.57%)
Mutual labels:  wechat-mini-program
patrick-wechat
⭐️🐟 questionnaire wechat app built with taro, taro-ui and heart. 微信问卷小程序
Stars: ✭ 74 (+428.57%)
Mutual labels:  wechat-mini-program
ember-boilerplate
👓 The stable base upon which we build our Ember.js projects at Mirego.
Stars: ✭ 33 (+135.71%)
Mutual labels:  mocha
spectron-typescript-starter
Spectron TypeScript Starter for e2e testing electron applications
Stars: ✭ 15 (+7.14%)
Mutual labels:  mocha
graphql-starter
Node, Express, GraphQL, Neo4j, Mocha and ES6
Stars: ✭ 17 (+21.43%)
Mutual labels:  mocha
cheers-mp
Almost 零配置微信原生小程序脚手架,vue-cli般的体验~ (゜-゜)つロ 干杯~
Stars: ✭ 32 (+128.57%)
Mutual labels:  wechat-mini-program

Mikey

这是参加腾讯全国小程序比赛的项目的公共后端库

技术栈

应用环境

Nodejs v 9.11.1

TypeScript v 2.8.3

核心应用环境

Koa v 2.5.1

MongoDB v 3.6.4

Mocha v 5.2.0

目录结构

|
|---src                   --------- 后端核心代码库
|    |
|    |
|    |---- config         --------- 配置文件
|    |
|    |---- controllers    --------- 控制器,分发请求
|    |
|    |---- helpers        --------- 帮助(扩展)工具,和业务逻辑并不强相关
|    |
|    |---- model          --------- 数据模型ORM以及模型接口定义
|    |
|    |---- service        --------- 服务。通过依赖注入被服务或者控制器使用 
|    |
|    |---- app.ts         --------- 工厂函数,创造Koa Server
|
|
|---- index.ts            --------- 入口

基本架构


                                                                         
                                                           取得APP配置信息  |--------> production.ts
                                                          |-------------> |--------> development.ts
                                                          |               |--------> test.ts
                                |-------------------------|------------------------------------|
                                |                     MIKEY APP                                |
                                |                                                              |
                                |                                           |->Restful Core    |
    |-------|                   |                |--->Router--->Controller->|->Utils Handle    |
    |       |                   |                |                      ^   |->Render HTML     |
    |       |    HTTP REQUEST   |                |                      ^                      |
    |  USER |     ---------->   |   中间件parse ->|--->Logger            ^                      |
    |       |                   |                |                      |----Service 依赖注入   |
    |       |                   |                |--->ErrorHandle                              |
    |-------|                   |                                                              |
                                |                                                              |
                                |                                                              |
                                |--------------------------------------------------------------|


用户分享的行为逻辑


|------------------
|                 |       |----> 生成一次性shareKey (含有过期时间) ----
|                 |       |                                         |
|    用户点击分享   |——-- > |                                         | ---- > 产生分享元数据传回分享接口
|                 |       |                                         |
|                 |       |----> 取得数据,构造URl                ————|
|-----------------|




|-------------————|          | ------ > 校验shareKey
|                 |          |
|                 |          |
|   用户打开某分享  | ------ > |                            ------ > 取得shareData,生成sharePage
|                 |          |
|                 |          | ------ > 请求URl
|-----------——————|    
                       
                       
                  
            

运行须知

  • 目前版本并未提供单元测试,以后会提供基于Mocha的单元测试
  • 由于隐私问题已经移除src/config/目录下的相关配置文件。具体有weChat.ts以及seniverse.ts文件。 如果需要和微信小程序搭配使用需自行添加
interface WeChatConfig {
  appid: string,
  appsecret: string
}

interface SeniverseConfig {
  apiKey: string
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].