App Areas - ChrispyPeaches/FocusFriends GitHub Wiki

Shop

The shop page is where users can spend the currency they've gained from studying. They can choose to purchase Pets, App Sounds, and Furniture for their island studying experience.

The shop is formatted in a StackLayout, with 3 carousels holding the respective shop items. Upon clicking a shop item, the user is presented with a popup that gives them the option to purchase the item, or leave the item be.

The API's "GetAllShopItems" endpoint serves the information needed to populate the shop carousels.

  • Shop Item Persistence

    • When a user navigates to the shop screen, and their local DB is populated with the shop items, they will pull the shop items from the local DB as opposed to the server DB.
  • User Item Persistence

    • When a user purchases an item from the shop, the item is stored in the local database as well as the server database, and the user's balance is updated in both databases as well.

Diagram of the persistence flows:

ShopItemFlow drawio


Social

The social page is where users can view their added friends and add new ones. They can also access a popup interface by tapping their profile picture in the top right corner.

The social page is formatted in a grid, with the friends list making up the majority of the content.

Users can access a menu to add friends via a button in the top center of the page. This popup opens a menu containing an entry where users can enter their friend's email address to send them a friend request. They can cancel this request via a list of pending friend requests below the entry. The receiver of the friend request can choose to accept or reject the request. The friends list is updated automatically.

The API's "GetAllFriends" and "GetAllFriendRequests" endpoints serve the information needed to populate their respective lists.

The API also contains endpoints for the creation, acceptance, and deletion of friend relationships in the database.

Badges Page

The Badges Page allows users to view all the available badges to unlock. If the user taps on a badge, a popup will appear and the select state will depend if it is already selected

Screenshots

Badges Page

BadgePage

Selectable Badge (Popup)

SelectableBadge

Selected Badge (Popup)

SelectedBadge

Locked Badge (Popup)

LockedBadge

Badge Checkmark

BadgeCheckmark

The following item pages each possess methods for fetching and selecting the user's owned items. The fetch methods simply query the local database in the corresponding user item table. The selection methods update the user's selected item column in local and api databases. It also updates the authentication service so the change is reflected in the active session.

The following flowchart illustrates how the user item data is updated in each item page ItemPageFlow

Pets Page

The Pets Page allows users to view all their purchased pets. When the user taps on a pet, they will select it and it will be displayed on their island.

Decor Page

The Decor Page allows users to view all their purchased decor. When the user taps on a piece of decor, they will select it and it will be displayed on their island. Users can also select the none option to display no decor on their island.

Islands Page

The Islands Page allows users to view all their purchased islands. When the user taps on an island, they will select it and it will be displayed on the timer page

Mindfulness

Focus Session Ratings

The API's /Sync/MindfulnessTips endpoint takes in a list of the ids of the tips that the mobile database currently has stored, compares the list to the tips that the API has in its database, and sends back a list of tips that the API had, but the mobile database didn't.

Mindfulness Tips on Startup

When the app initially shows the timer page, a popup will appear to show the user a mindfulness tip

  • The user will be able to enable/disable this with a setting, which will be enabled by default

Session Rating

When the user completes a focus session, they will be greeted with a popup that asks them to rate the session.

If they do rate the session, they will be shown a mindfulness tip.

  • The tip that is shown depends on the rating the user gave the session.
  • So if the user rates the session as bad, they will be shown a tip that is meant to help in a more stressful situation.
  • Similarly, if the user rates the session as good, they'll be shown a tip that is tailored for a less stressful situation.

Sync

Mindfulness Tips

The API's /Sync/MindfulnessTips endpoint takes in a list of the ids of the tips that the mobile database currently has stored, compares the list to the tips that the API has in its database, and sends back a list of tips that the API had, but the mobile database didn't.

⚠️ **GitHub.com Fallback** ⚠️