Git Product home page Git Product logo

crowdsourcing-platform-server's Introduction

Build Status

目录

1 关于

这是一个在线众包平台的服务端,作为我们软件工程(3)的大作业项目。以下是项目的相关链接。

1.1 项目目录简介

文档主要是有一下几个部分:

  • docs/:存放文档(不同于自动生成文档)
  • README.md:自动生成文档的首页

自动文档会依据注释生成,具体格式可以参照Use JSDoc: Getting Started with JSDoc 3

代码主要是:

  • test/:项目测试代码
  • src/:项目核心代码
    • models/:model数据层
    • core/:controller控制层,操纵数据层
    • api/:RESTful API的事件处理
    • socket/:Socket.io的事件处理
    • wechat/:微信消息推送的事件处理
    • server.js:整个服务端的对象
  • app.js:启动src/server.js
  • config.json:项目的配置文件(在.gitignore中)
  • package.jsonnpm的配置文件

因而整个项目模块之间的依赖如下:

模块依赖图

此外还有额外的配置:

  • .editorconfig:编辑器配置
  • .eslintrc:代码风格检查工具配置(这是强制的,不通过就报错)
  • .jsdoc.json:自动文档生成配置
  • .travis.yml:Travis CI配置

1.2 项目启动及部署

本项目依赖两个数据库:

  • MongoDB
  • Redis

配置完这两个数据库后,可以通过如下命令启动server:

# Install Dependencies
npm install
# Start Server
node app # Or `npm start`

建议提交前应当跑一下测试:

# Check coding style
npm run lint
# Unit test
npm run test

部署项目自动文档到GitHub上可以采用如下方式:

# Generate documentation from code
npm run docs
# Deploy documentation to GitHub Pages
npm run gh-pages

当然每次提交之后会有CI自动测试并部署文档。

2 设计

2.1 数据表

2.1.1 users

models/users~User

2.1.2 tasks

models/tasks~Task

2.1.3 assignments

用户到作业和任务到作业都是一对多的关系。通过引入作业表,问题得以简化。

models/assignments~Assignment

2.2 接口设计

借口主要以两种方式接入:

  1. AJAX请求:见api
  2. Socket.IO事件:见socket

2.1.1 用户模块

注意:用户的邮箱注册请参考邮箱模块,用户的登录请参照认证模块。

core/user

2.1.2 邮箱模块

core/email

2.1.3 认证模块

core/auth

2.1.4 任务模块

core/task

2.1.5 作业模块

core/assignment

crowdsourcing-platform-server's People

Contributors

chehthss avatar chiawei-liu avatar gary-thu avatar sunziping2016 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

fengh16

crowdsourcing-platform-server'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.