Published using Google Docs
User Analytics
Updated automatically every 5 minutes

User Analytics

Requirements and Team Policies

1 - Team info & policies

Team Members

Project Artifacts

Communication Channels

2 - Product Description

UserAnalytics is a Chrome extension that allows users to easily view their Chrome usage trends. Through stylized and interactive visualizations, they should be able to see what domains they visit the most, the volume of internet usage throughout the day by hours, and the time for each category of website. We want UserAnalytics to be easy to use and install, allow user customization in domain tracking, store data securely, and be respectful of users’ privacy.

Four Main features:

  1. User can visualize usage for each domain in the timesheet
  2. User can visualize usage for each day of the week in hours.
  3. User can configure whitelist to turn off tracking on certain domains.
  4. Extension categorizes time spent automatically (social media, reading/reference, and productivity)
  5. User can visualize time spent per category of websites for each day of the week with a running average.
  6. Users can toggle whether or not they want their browsing habits to be tracked.

Stretch Goals:

  1. Focus/Relax mode that can be suggested on/off based on user actions (ML) or manually turned on.
  2. Block sites at certain times, set time limits for certain sites.
  3. ✅ Users can customize the categorization of their browsing habits by associating specific domains with specific categories of website (e.g. associating bitbucket with the Productivity category)
  4. ✅ Users can clear their browsing data from our extension’s storage at any time.

3 - Use Cases

  1. Case: User wants to check his usage for each domain (Yukai)
  1. Actors: users who downloaded our plugin and uses Chrome, can be anyone.
  2. Triggers: start our plugin manually in Chrome, or automatically triggered as Chrome started.
  3. Preconditions: Use Chrome as a default browser, have downloaded and configured plugins.
  4. Postconditions (success scenario): the usage data being recorded in our database upon the termination of Chrome.
  5. List of steps (success scenario):
  1. The user started Chrome and downloaded the plugins.
  2. The user configured plugins to start monitoring usage.
  3. The user is free to start surfing at this point.
  4. The user can check his usage history on each domain by clicking on the plugins anytime it wants.
  5. A detailed analysis with the visual representation will be displayed.
  6. The user closes Chrome, the plugin will terminate and data will be kept in the database.
  1. Extensions/variations of the success scenario
  1. Variation1: the user wants the plugin to automatically record the data.
  1. At step ii, the user can set the plugin to run as Chrome started.
  1. Variation2: the user does not want data to be saved.
  1. At step vi, the plugin will not record data into the database
  2. The plugin will not use this data for analysis on domains.
  1. Exceptions: failure conditions and scenarios
  1. Exception1: Chrome updates
  1. Chrome can perform updates automatically and our plugin may no longer be compatible with the newer version of Chrome
  1. Exception2: database errors
  1. The database may fail to record data, hence discard any usage the user has this time

  1. Case: User wants to configure black/white lists for domain tracking (Zhennan)
  1. Actors: Users who downloaded and installed the plugin on their Chrome browser.
  2. Triggers: launch the plugin manually by pressing the plugin icon
  3. Preconditions: Chrome is used as the primary browsing tool. Incognito mode is turned off. The plugin is successfully installed.
  4. Postconditions (success scenario): The plugin keeps track of browsing data based on user-configured whitelist/blacklist.  
  5. List of steps (success scenario):
  1. The user launches Chrome and installs the plugin.
  2. The user launches the plugin page by clicking the icon in the Chrome toolbar and choosing going to the dashboard.
  3. The user navigates to plugin setting -> black/white list
  4. Making changes to lists of domains they want the system to avoid/track.
  5. The user saves the changes and closes the page.
  6. Plugin page reflects which list(s) are currently in effect.
  7. The user quits Chrome and the black/white list are saved to local storage as well.
  1. Extensions/variations of the success scenario
  1. User wants to modify domain/websites to black/white list without launching the dashboard and changing manually
  1. At step ii, choose either adding/removing current webpage to whitelist or blacklist
  1. User wants to export and save current black/white list
  1. At step iii, output the list(s) by pressing the download button.
  2. A file download will be triggered automatically and file(s) will be stored on the user's local machine.
  1. Users wants to import existing black/white list
  1. At step iv, import the existing list instead of manually recording any domains.
  1. Exceptions: failure conditions and scenarios:
  1. Exception1: User inputs incorrect domains/websites format
  1. At step v, before saving the changes, notify the user any incorrectness.
  1. Exception2: User imports incorrect list config files
  1. At step iv, notify the user that they need to select the correct file in correct format.
  1. Exception3: User forgets to save changes before quitting
  1. At step v, show the user an alert, telling them the consequences of any unsaved changes.

  1. Case: User wants to check his usage for each day of the week (Richard)
  1. Actors: users who downloaded our plugin, can be anyone.
  2. Triggers: start our plugin manually in Chrome, or automatically triggered as Chrome started.
  3. Preconditions: Use Chrome as a default browser, have downloaded and configured plugins.
  4. Postconditions (success scenario): the usage data per day of the week being recorded in our database upon the termination of Chrome.
  5. List of steps (success scenario):
  1. The user started Chrome and downloaded the plugins.
  2. The user configured plugins to start monitoring usage.
  3. The user is free to start surfing at this point.
  4. The user can check his usage history per day by clicking on the plugins anytime it wants.
  5. A detailed breakdown of hours per day will be displayed.
  6. The user closes Chrome, the plugin will terminate and data will be kept in the database for up to 3 weeks.
  1. Extensions/variations of the success scenario
  1. Variation1: the user wants the plugin to automatically record the data.
  1. At step ii, the user can set the plugin to run as Chrome started.
  1. Variation2: the user does not want data to be saved.
  1. At step vi, the plugin will not record data into the database
  2. The plugin will only display daily usage for the current day, the data will be lost when Chrome is terminated
  1. Exceptions: failure conditions and scenarios
  1. Exception1: Chrome updates
  1. Chrome can perform updates automatically and our plugin may no longer be compatible with the newer version of Chrome
  1. Exception2: database errors
  1. The database may fail to record data, hence discard any usage the user has this time

  1. Case: User wants to see their browsing habits batched by category (e.g. social media, productivity, entertainment, education) (Patrick)
  1. Actors: Any user.
  2. Triggers:  After starting our Chrome extension manually, or automatically when Chrome is launched.
  3. Preconditions: Use Chrome as a default browser, have our Chrome extension downloaded and enabled, have some existing usage data in our database to show the user.
  4. Postconditions (success scenario): The user getting a better understanding of how long they spend doing different kinds of internet browsing.
  5. List of steps (success scenario):
  1. The user launches Chrome with our extension installed.
  2. The user clicks a button in our extension to visualize their browsing habits by category.
  3. Our extension displays a detailed breakdown of the user’s browsing habits by category, visualized in an easy-to-understand way. This might be a bar graph or pie chart for example. The extension also displays a list of all websites that make up a category (e.g. youtube, netflix, hulu for entertainment).
  4. The user views a visualization of how long they spend on each category of website over the course of a day and gains a greater understanding of their browsing habits.
  5. The user clicks outside the visualization window or presses the escape key to terminate the visualization.
  1. Extensions/variations of the success scenario
  1. At step iv, the user views the breakdown of their browsing habits over the course of a week rather than a day.
  1. The user can click a button to change which time period they want to visualize data over.
  1. At step iv, the user views the breakdown of their browsing habits over the course of a month rather than a day.
  1. The user can click a button to change which time period they want to visualize data over.
  1. Exceptions: failure conditions and scenarios:
  1. Exception1: Chrome updates
  1. Chrome can perform updates automatically and our plugin may no longer be compatible with the newer version of Chrome
  1. Exception2: Backend error
  1. If the user is loading their data from the backend, the database may not have as much data as they require. We only store the user’s data for the most recent 3 week period, meaning that if a user is loading their data from the backend instead of locally, the backend might not have all of the data they want to visualize.
  2. If the user is loading their data from the backend, the backend may fail to respond.

  1. Case: User wants to block certain sites or a category of sites during certain times
  1. Actors: Any user
  2. Triggers: When the user opens the extension
  3. Preconditions: Chrome installed, extension installed, extension configured
  4. Postconditions (success scenario): The user is not able to access the specified websites
  5. List of steps (success scenario):
  1. User opens chrome
  2. User installs extension
  3. User configures websites/category they do not want to visit and sets a timer
  4. User confirms and continues browsing
  5. User attempts to access a blocked site, and is redirected to page notifying them why the site is blocked and shows the time remaining
  1. Extensions/variations of the success scenario
  1. User does not visit site before the timer expires
  1. Exceptions: failure conditions and scenarios:
  1. User does not set specific websites
  1. In this case when the blocking mode is on, nothing will change
  1. Website is mis-categorized
  1. The user turns on blocking mode
  2. User tries to visit a site that should not be blocked, but is blocked
  1. Subdomains are not treated properly        
  1. Users turns on blocking mode
  2. User visits a sub-domain of a site and the site should be blocked, but is not blocked

4 - Non-functional Requirements

  1. User-Analytics will protect its users' privacy by only storing browsing data for up to 1 week. The user’s data will be securely stored through Chrome sync storage.
  2. User-Analytics will correctly collect and represent a user’s data, so as not to mislead them with false visualizations and conclusions.
  3. User-Analytics’ will have an intuitive user interface, have minimal impact on performance of Chrome, and have close to real time updates on the visualizations.

5 - External Requirements

  1. The product must be robust against errors that can reasonably be expected to occur during the course of normal Chrome usage, such as browser crashes, slow-loading pages, invalid user requirements, null settings, or unparsable user inputs.
  2. The product must be installable by a user as a chrome extension and interfaced with by clicking its icon in the chrome extension menu.
  3. The product should be available either in the google extension store or in the package that we published in our github repository.
  4. The software (all parts, including clients and servers) will be buildable from source by others. The instruction for setting up should be included in our top-level Readme file. The link to the github repository will be made publicly available, enabling new developers to make enhancements.
  5. The scope and feature set of our chrome extension should match the complexity that a 5-person team is capable of building.

6 - Team Process

Software Toolset

Team Member Roles

Schedule

Start Week

Milestones

Dependencies

Est. Work

3

Build an test extension

None

2 weeks

3

Design data viz/UI

None

1 weeks

3

Backend Implementation

Build an test extension

5 weeks

4

Backend Design Document

None

1 week

5

All Middleware functions

Backend Design Document

2 weeks

5

Static Mock Frontend

Design data viz/UI

2 weeks

5

Test Infrastructure

Backend Implementation

2 weeks

6

Front End reads live data

Backend Implementation

2 weeks

6

Live Frontend and backend integration

Front End reads live data, Static Frontend

2 weeks

8

Beta Release

Live Frontend and backend integration

1 week

8

Implement User Settings

Beta Release

1 week

8

Data Management & Privacy

Beta Release

1 week

8

Iterate on feedback

Beta Release

1 week

9

Final Release (6.1)

Implement User Settings, Data Management & Privacy

1 Week

Five Major Risks

External Feedback

Test Plan & Bugs

Service

Pros

Cons

GitHub Actions

- Requires no additional tools

- Easy to understand UI

- Lots of available templates and guides

- Good documentation

- Triggered through simple YAML files

- Heavy customization of actions requires using specific javascript packages, meaning we would have to start using a package manager.

- No debugging of jobs while they’re in progress

Microsoft Azure Pipelines

- Integrated with GitHub due to Microsoft ecosystem

- Extensive documentation

- Integrates with other Azure DevOps services

- Requires an additional tool

- Heavyweight and complicated due to being part of the Azure ecosystem

- Fewer online guides than others.

CircleCI

- Easy to configure with YAML files

- Integrates well with GitHub

- Streamlined user interface

- Can run jobs through SSH for easy command-line debugging

- Users report inconsistent time of execution

- Some users report that the free tier’s features are a bit limited

- Requires an additional tool

Documentation Plan

7 - Software Architecture

Major Components

Interfaces

Data Storage in Chrome

Chrome storage is a key-value store.

Key

Value

Date

Json object:

{

    domain: time spent in seconds

}

I.e. { google.com: 123}

lastDomain

Json object:

{

    domain: last visited domain,

    openedTime: timestampœ of when the domain was opened,

    lastInactiveTime: timestamp of when chrome was inactive,

    totalInactiveTime: total time chrome was inactive

}

Category

Json object:

{

    Entertainment: [],

    Social: [],

    Reading: [],

    Productivity:[],

    Uncategorized:[]

}

doTrack

Boolean

whitelist

Array:

[

   url1, url2, …

]

Assumptions

Alternatives

8 - Software Design

Units of Abstraction

Software Component Responsibilities

9 - Coding Guidelines

https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode

Our group works in VSCode, so we can use the VSCode extension for the prettier code formatting tool. Prettier formats html, css, and javascript according to a very specific specification. Using prettier as a vscode extension is very convenient and lightweight.

If needed, we can also use the prettier NPM package to format code in exactly the same way. Since prettier is opinionated and automatic, it means all members of the team can format their code to a specific style without lengthy code reviews or editing processes. All team members can make their code conform to the same style guidelines with the press of a button. This will save us time enforcing the style guidelines.

Prettier is widely used in industry to keep a consistent code style.