4. Architecture Specifications - Pug-Life-INFO-461/allowance-gamification-app GitHub Wiki

Libraries & Frameworks

React Native was chosen as it simplifies the process of creating a mobile application. This means that we can build using React how we would normally build a React web application but this uses the same building blocks to construct iOS and Android mobile applications. With just the application of JavaScript and React, the building blocks can come together to build out this project.

Utilization of Bootstrap will be used throughout the entire project. This is because it allows a quick and easy application of Bootstrap components already built for the front end. Formatting (e.g. columns, grids, etc.) is another big reason that Bootstrap will be used instead of custom CSS for all HTML elements. Any application of Bootstrap that does not satisfy our needs, additional CSS can be applied.

Firebase serves as the database feature that we need to store information regarding users, tasks, rewards, badges, etc. This will serve as a backend-as-a-service, so that we do not need to deal with the server and access real-time directly. Data is similar to accessing JSON which the team all have experience manipulating.

User

Properties

Stores all relevant user data that is needed to create users in a family.

User object:

Name Type Description
UserID int The unique ID associated to a particular user differing from all other users
Name string This name is a combination of the user input of first name and last name separated by a space
UserName string The stored name that the user chooses to assign to themself
Password string The stored password from user input that they need to sign in
Picture string The link to the image where it is stored
Email string Optional value for children.

Child object: Child implements user (includes properties from above)

Name Type Description
level int Contains the integer value for the current level of the child
badgeList List<Badge> Stores the badge objects in an array contained badges the child has been awarded

Badge Object

Properties

Specifies all relevant information that a badge is needed to be created when awarded to a user.

Name Type Description
BadgeID int The unique ID associating the particular badge differing from all other badges
Name string This name is a combination of the user input of first name and last name separated by a space
Image string This is a link to the stored image corresponding to the badge image
Description string Description of the earned badge (e.g. how it is earned)
CreatedAt datetime The date and time the badge was awarded to the specific user

Family Manager

Properties

Handles the creation of families, addition/removal of users to families, and manages the flow of tasks and rewards within that family.

Name Type Description
Name string The name of the family that shows up on the top bar of the screen (e.g. “The Oh Family”)
InviteCode string The code created to invite users to this family
Users List<User> Contains the list of users in the family
Admins List<User> Contains the list of users that are admins in the family
TaskManager TaskManager The TaskManager object that will allow tasks to be managed within the family
RewardManager RewardManager The RewardManager object that will allow rewards to be managed within the family

Functionality

Name Parameter Return Description
addUser() User user void Adds a user into the list of users that are in the family
addAdmin() User user void Adds a user into the list of users that is a admin in that family or someone who assigns tasks and rewards
createFamily() string familyName void Creates the family name taking in the last name as a parameter and concatenating “The” and “family” between the last name
getUsers() void List<User> Gets all the users currently in that family
getAdmins() void List<User> Gets all the admins currently in that family
removeUser() User user void Removes the user from the list of users that match the given name passed in, case insensitive
removeAdmin() User user void Removes the admin from the list of admins that match the given name passed in, case insensitive

Connections

Inputs

  • TaskManager - provides the tasks to be delegated to users
  • RewardManager - provides the rewards to be delegated to users

Outputs

  • Users - provides the list of users to update users of task or reward assignment/completion

Task Object

Properties

The relevant information that is needed to create a task object. Rewards cannot be distributed until tasks are constructed which gives important information, like how much reward points are associated with that task.

Name Type Description
name string name Simple name/title of the task
createdTime datetime createdTime The time in which the task is created
updatedTime datetime updatedTime The time in which the task is updated  
dueDate datetime dueDate The due date in which the task has to be completed by
rewardPoint int rewardPoint The amount of reward points
description string description Description of the task informing the children in a more elaborated manner.
category string category Category of the tasks (Bedroom, Bathroom, Kitchen, Living room, pets, outdoor…)
assignedTo User user A variable to keep track of users in this case children through identification name/ID.
completedBy User user Similarly to assignedTo & acceptedBy it keeps track of the users who completed this specific task.
status TaskStatus taskStatus Keeps track of the status of the Task

Task Status Object

Properties

The TaskStatus keeps track of the status of the Task when a user accpets will update the coresponding inUnclaimed to true and so on.

Name State Description
isCompleted boolean isCompleted This is the status of if the task is completed, defaults to false
isPending boolean isPending This is the status of if the task is pending, defaults to false
isUnclaimed boolean isUnclaimed This is the status of if the task is unclaimed, defaults to false
isInProgress boolean isInProgress This is the status of if the task is in progress, defaults to false

Task Manager

Properties

Task handles the creation, deletion, edition and assignment of tasks by taking input from parents primarily and child secondary and connect both user parties together to create a smooth user interactions and data flow in order for tasks to be completed and a rewards to be awarded to children.

Name Type Description
UnclaimedTasks List<Task> List of tasks which have not been accepted yet.
CompletedTasks List<Task> List of tasks which have been completed.

Functionality

Name Parameters Return Behaviour
addTask() Task task void Takes in task object and adds it to the unclaimed list of tasks.
updateTask() Task task void Updates the task that users want to update with new information with the ‘pen’ icon.
deleteTask() void void Removes a task from the list of unclaimed tasks when a user swipes left.
acceptTask() Task task void Adds a task to list of tasks to do in the children's in progress list when a child swipes right.  
completeTask() Task task boolean prove a task has been completed when a child clickes ‘complete’ button.
verifyTask() Task task boolean This is the transitional functionality that is going be used to both verify a task has been completed and is ready for reward.   
notifyParent() User user void Send notification to parents and store that notification as a completed task in the completed section of the upper nav bar.
notifyChild() User user void Send notification to children that a task has been assigned to them and prompt them to accept or decline.
editTast() Task task void When a parents click the edit icon it will take them back to edition/creation mode so they are able to edit the properties of that task.

Connections

Inputs

  • The inputs are task objects that are going to be processed and assigned to a child based on that child's userID.

Outputs

  • The output is the status of those tasks whether they are completed or not and sending an approval to parents to get a reward.

Reward Object

Property

The relevant information that is needed to create a reward object. Rewards are what the parents create so that they can be awarded to children.

Name Type Description
RewardID int
Name string Name of the reward
createdTime datetime The datetime of when the reward is created.
dueDate datetime Optional value, where is the task must be completed before a certain date, will set a datetime of the due date.
rewardPoint int The amount of point that would be rewarded when completed.
description string The description of the task if any further description is needed.
category string The category of the reward.
assignedTo List<User> Optional value where if a task must be set to a specific child, could be set. Will only be displayed to the assigned child.

Reward Manager

Property

Stores all the rewards into lists to keep track of their status.

Name Type Description
UnclaimedRewards List<Reward> List of rewards which have not been claimed yet.
RedeemedRewards List<Reward> List of rewards which have been rewarded.

Functionality

Manages all actions regarding create, update, delete of Reward objects. When a reward is created it is added to the UnclaimedRewards list initially. When a Reward is redeemed, it will be moved to the RedeemedRewards list.

Name Parameter Return Description
AddReward() Reward reward boolean Adds the reward to the list of unclaimed rewards list.
RemoveReward() int ID boolean Removes the reward from the unclaimed rewards list. Already claimed rewards cannot be removed.
UpdateReward() int ID , Reward reward Reward reward Updates the reward with updated information.
RedeemReward() int ID , User user void Given the rewardID and claimed child user object, moves the reward from unclaimed list to claimed list with the user who was rewarded.
GetReward() int ID Reward reward Gets the reward object given the rewardID.
GetAllUnclaimedRewards() void List<Reward> Returns the unclaimed reward list.
GetAllRedeemedRewards() void List<Reward> Returns the rewarded reward list.

Database Handler

Functionality

This is an interface for the database, by having an interface, future implementations can switch between different vendors without having to strip any of the code in the logic tier. The database is abstracted away, only exposing functions such as Insert, Get, Update, Delete which would be leveraged frequently.

Name Parameter Return Description
Insert() int ID, string Table, object Object object Object Given the id, table, and object, it will insert to the attached database
Get() int ID, string Table object Object Given the id, table, it will query to the attached database
Update() int ID, string Table, object Object object Object Given the id, table, and object, it will update to the attached database
Delete() int ID, string Table int ID Given the id, table, it will delete the object in the attached database
⚠️ **GitHub.com Fallback** ⚠️