anesmu / BACKEND-WorkFlow

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Work Flow( API )

This is an API server for Work Flow. Development was done using Node.js with express.

Features

  • User management
  • Board CRUD
  • List CRUD
  • Card CRUD
  • Comment function
  • Activity logging function

Feature Implementation

  • Model definition
  • Controller definition
  • Route definition
  • User - Login / Sign up
  • User - Change password
  • User - Forgot password
  • Board - Retrieve board
  • Board - Update board
  • Board - Delete board
  • Board - Create board
  • Board - Change background color
  • Board - Member list
  • Board - Add member
  • Board - Remove member
  • List - Retrieve list
  • List - Create list
  • List - Delete list
  • List - Edit list title
  • List - Move list
  • Card - Retrieve card
  • Card - Create card
  • Card - Delete card
  • Card - Edit card
  • Card - Move card
  • Comment - Retrieve comment
  • Comment - Create comment
  • Comment - Edit comment
  • Comment - Delete comment
  • Activity - Log events
  • Activity - Retrieve event logs

ER Diagram

er diagram

Model

User

{
  uid: {
    field: "uid",
    type: DataTypes.UUID,
    defaultValue: DataTypes.UUIDV4,
    primaryKey: true,
    allowNull: false
  },
  username: {
    field: "username",
    type: DataTypes.STRING(10),
    allowNull: false,
  },
  password: {
    field: "password",
    type: DataTypes.STRING(100),
    allowNull: false
  },
  email: {
    field: "email",
    type: DataTypes.STRING(50),
    allowNull: false,
  },
  photo: {
    field: "photo",
    type: DataTypes.STRING(20),
    allowNull: false
  },
  reset_code: {
    field: "reset_code",
    type: DataTypes.UUID,
    allowNull: true
  },
  reset_code_expiredate: {
    field: "reset_code_expiredate",
    type: DataTypes.DATE,
    allowNull: true
  }
}

Board

{
  bid: {
    field: "bid",
    type: DataTypes.UUID,
    defaultValue: DataTypes.UUIDV4,
    primaryKey: true,
    allowNull: false
  },
  user_id: {
    field: "user_id",
    type: DataTypes.UUID,
    allowNull: false,
  },
  title: {
    field: "title",
    type: DataTypes.STRING(30),
    allowNull: false
  },
  bg_type: {
    field: "bg_type",
    type: DataTypes.ENUM,
    values: ['image', 'color'],
    defaultValue: 'color',
    allowNull: false
  },
  background: {
    field: "background",
    type: DataTypes.STRING(100),
    defaultValue: 'rgb(0, 121, 191)',
    allowNull: false
  }
}

List

{
  lid: {
    field: "lid",
    type: DataTypes.UUID,
    defaultValue: DataTypes.UUIDV4,
    primaryKey: true,
    allowNull: false
  },
  bid: {
    field: "bid",
    type: DataTypes.UUID,
    allowNull: false,
  },
  title: {
    field: "title",
    type: DataTypes.STRING(30),
    allowNull: false
  },
  position: {
    field: "position",
    type: DataTypes.DOUBLE,
    allowNull: false,
    defaultValue: 65535
  }
}

Card

{
  cid: {
    field: "cid",
    type: DataTypes.UUID,
    defaultValue: DataTypes.UUIDV4,
    primaryKey: true,
    allowNull: false
  },
  lid: {
    field: "lid",
    type: DataTypes.UUID,
    allowNull: false,
  },
  title: {
    field: "title",
    type: DataTypes.STRING(30),
    allowNull: false
  },
  description: {
    field: "description",
    type: DataTypes.STRING(500),
    allowNull: true
  },
  position: {
    field: "position",
    type: DataTypes.DOUBLE,
    allowNull: false,
    defaultValue: 65535
  }
}

Comment

{
  comment_id: {
    field: "comment_id",
    type: DataTypes.UUID,
    defaultValue: DataTypes.UUIDV4,
    primaryKey: true,
    allowNull: false
  },
  uid: {
    field: "uid",
    type: DataTypes.UUID,
    allowNull: false,
  },
  cid: {
    field: "cid",
    type: DataTypes.UUID,
    allowNull: false
  },
  comment: {
    field: "comment",
    type: DataTypes.STRING(50),
    allowNull: false
  }
}

Activity

{
  activity_id: {
    field: "activity_id",
    type: DataTypes.UUID,
    defaultValue: DataTypes.UUIDV4,
    primaryKey: true,
    allowNull: false
  },
  type: {
    field: "type",
    type: DataTypes.ENUM,
    values: ['move', 'add', 'delete', 'edit', 'comment'],
    allowNull: false,
  },
  bid: {
    field: "bid",
    type: DataTypes.UUID,
    allowNull: false,
  },
  uid: {
    field: "uid",
    type: DataTypes.UUID,
    allowNull: false
  },
  cid: {
    field: "cid",
    type: DataTypes.UUID,
    allowNull: true
  },
  message: {
    field: "message",
    type: DataTypes.STRING(300),
    allowNull: false,
  }
}

About


Languages

Language:JavaScript 100.0%