Examples of full CRUD egg MongoDB, websocket

Project Address github.com/richard1015...

Technology stack eggjs, MongoDB, swagger, websocket, Amap

Demo Address:

Function Description

  • 1. Target Navigation
  • 2. Compute the latitude and longitude AutoPlay
  • 3. The API provides background
  • 3.1 file upload token verification
  • 3.2 Login Interface
  • 3.3 acquire school-related interfaces (CRUD) token verification
  • 3.4 punctuation obtain relevant interface (CRUD) token verification
  • 3.5 Get user interfaces (CRUD) authentication token
  • 4. Background WebSocket log real-time push token verification
  • 5.swaager document plug-in integration

Screenshot function

QuickStart

see egg docs for more detail.

Development

$ npm i
$ npm run dev
$ open http://localhost:7002/
复制代码

Deploy

$ npm start
$ npm stop
复制代码

npm scripts

  • Use npm run lint to check code style.
  • Use npm test to run unit test.
  • Use npm run autod to auto detect dependencies upgrade, see autod for more detail.

doc tree

├── README.md 说明文件
├── app
│   ├── contract swagger文档model类
│   │   └── model.js
│   ├── controller 控制器
│   │   ├── base.js  基类 token检查逻辑  通用返回标识符逻辑
│   │   ├── common.js 通用类
│   │   ├── home.js 默认首页逻辑
│   │   ├── school.js  院校相关逻辑
│   │   ├── spot.js  标点相关逻辑
│   │   └── user.js 用户相关逻辑
│   ├── public 静态资源存放处
│   │   ├── css
│   │   │   └── reset.css
│   │   ├── images
│   │   │   ├── offAuto.png
│   │   │   ├── onAuto.png
│   │   │   ├── play1.gif
│   │   │   ├── play2.png
│   │   │   └── play3.png
│   │   ├── lib
│   │   │   ├── jquery-3.3.1.js
│   │   │   ├── layer_mobile
│   │   │   │   ├── layer.js
│   │   │   │   └── need
│   │   │   │       └── layer.css
│   │   │   └── rem.js
│   │   └── resources 上传文件 存放处
│   ├── router.js 项目路由
│   ├── service
│   │   ├── base.js 基类 MongoDB增删改查封装底层
│   │   ├── school.js 院校数据处理逻辑
│   │   ├── spot.js 标点数据处理逻辑
│   │   └── user.js 后台用户数据处理逻辑
│   └── view
│       └── map.html 后台展示首页
├── app.js 项目初始逻辑 MongoDB检测机制,websocket日志推送启动
├── appveyor.yml
├── config
│   ├── config.default.js 项目配置文件
│   └── plugin.js 插件配置
├── jsconfig.json
├── logs 日志文件
│   └── IntelligentTourMap
│       ├── IntelligentTourMap-web.log
│       ├── common-error.log
│       ├── egg-agent.log
│       ├── egg-schedule.log
│       └── egg-web.log
├── package-lock.json
├── package.json
├── run
│   ├── agent_config.json
│   ├── agent_config_meta.json
│   ├── agent_timing_31076.json
│   ├── application_config.json
│   ├── application_config_meta.json
│   ├── application_timing_31085.json
│   └── router.json
├── test
│   └── app
│       └── controller
│           └── home.test.js
└── typings
    ├── app
    │   ├── controller
    │   │   └── index.d.ts
    │   ├── index.d.ts
    │   └── service
    │       └── index.d.ts
    └── config
        ├── index.d.ts
        └── plugin.d.ts
复制代码

Reproduced in: https: //juejin.im/post/5d08a7e7f265da1bb003c0fa

Guess you like

Origin blog.csdn.net/weixin_33762321/article/details/93177407
Recommended