Docs
Backend
Data Structure

Data Structure

Here outlines all the data models and structures to handle all the information on the platform.

Account

Account information related to user activity are classified into 3 categories:

  • User: The account authentication
  • Profile: The account information
  • Wallet: The account financial

User

The user model handles the account information for authentication and identification use. Data stored includes:

  • email: The account associated email address
  • password: The account password
  • verified: The verification state of the account (Not implemented)
  • timestamps: Timestamps when the account is created and last updated

Passwords are salted and hashed before storing in the database.

Profile

The user profile model is where information related to the account is stored. Information includes:

  • UID: The account user id generated from the user model
  • firstName: User's first name
  • lastName: User's last name
  • dob: User's date of birth (Not implemented)
  • country: User's country of residence for location specific projects (Not implemented)
  • sensors: A list of enabled sensors
  • rating: Public rating of the user (Not implemented)
  • hiddenRating: A hidden rating of the user that is used in the matchmaking (Not implemented)
  • projectsCompleted: The number of completed projects

Information from a user's profile can be used in matchmaking feature or analytics (Not implemented).

Wallet

The wallet model is how the account balance is tracked.

  • UID: The account user id generated from the user model
  • balance: The wallet balance

Project

The project model is used when a project is created and stores the project information.

  • ownerUID: The account user id generated from the user model of the project owner
  • title: The project title
  • description: A short project description to be displayed on project cards
  • details: The full project details
  • instructions: Directions for participants to follow when collecting data
  • end: The project deadline
  • status: The project status
Status code
0 - Inactive/Saved: Pending payment
1 - Active: Project is able to accept participants
2 - Completed: Project is completed
3 - Cancelled: Project is cancelled
  • private: Whether the project has public or private access
  • sensors: The list of required sensors for the project
  • lowFrequency: The list of sensors with low frequency polling
  • medFrequency: The list of sensors with medium frequency polling
  • highFrequency: The list of sensors with high frequency polling
  • maxParticipants: The participant limit for the project
  • participants: The current number of active participants who joined the project
  • serviceCost: The service cost to the platform for hosting the project
  • rewards: The amount of compensation for each participant who successfully collected the data
  • partialRewards: Whether participants can receive partial rewards for incomplete data (Not implemented)

Work

The work model is used when a user joins a project and work details are stored here.

  • UID: The account user id generated from the user model of the user working
  • projectID: The project id generated from the project model which the work is for
  • status: The work status
Status code
1 - Working: Project work accepted and pending data collection
2 - Completed: Project data successfully collected and submitted
3 - Cancelled: Work is cancelled
4 - Failed: Work cannot continue (i.e. expired project)
  • rated: Whether the submitted work has be rated by the project owner (Not implemented).

Sensor

The sensor model is used to synchronise the available supported sensors that the mobile application can collect and the project owner can request usage of.

  • value: The sensor id
  • label: The label for the sensor