-
Notifications
You must be signed in to change notification settings - Fork 2
SARA version 2 code organization
Last updated on October 16 2022
SARA v2 code is divided into two parts: (1) phone code and (2) server side code. As the name implies, the phone code is for the phone. The phone code is largely written in ionic 5--a cross-platform language that is deployable on Android and iPhones without extensive platform-specific changes. The server-side code is written in python. The server-side code is broadly categorized into two categories: (i) micro-services written in flask and docker, which act as API endpoints for the phone app to grab information from the server (ii) cron jobs that periodically run tasks, for example parsing survey data.
- Both server-side and phone codes were initially written to maximize modularity. Maximum modularity is a core principle for large code bases. However, the modules must interact at some point, and some states of the app must be managed (especially on the phone code). We are yet to converge on a good plan for micro-service communication and state management.
- The code has to be commented, and we need better test coverage to protect against accidental code changes.
- Oct 16, 2022: Latest version of the code is at main
- May 28, 2020: Latest version of the CHOP deployment of the code is at AdaptsBranchV3
The phone code uses angular modules, components and services to modularize the code. The data upload functionality is currently supported for AWS S3 and HTTP post messages to flask endpoints.
-
Survey module: The goal of this module is to create a survey. A step-by-step guide to creating a survey is linked here.
- Example 1: AYA survey for ADAPTS. This survey renders this JSON-fromatteed question set
- Example 2: Caregiver survey for ADAPTS
- Dynamic survey: This component renders a JSON file as a survey
-
Incentive module This module contains several sub-modules to create the aquariums, memes, altruistic messages, money, life-insights, etc. "Other pages" section aggregates the incentives presented.
- Levels (This code is built on Phaser 2 game engine)
- Money
- Memes
- Altruistic message
- Life-insights: Needs work.
-
Other pages
- Info page contains details how to earn incentives
- Collection pages: The following views contain lists of unlocked reinforcements
-
User profile module Handles user login and keeps user-specific information, e.g., points, unlocked memes, etc.
- Todo: add
ngrxfor state management. That should handle most of the connection issues.
See the docs in the readme to see how the different pieces of the server side codes.
- Todo: Use Kubernates to put all the micro-services together.