Skip to content

SARA version 2 code organization

ms2749 edited this page Oct 17, 2022 · 1 revision

Last updated on October 16 2022

Introduction

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.

Current limitations

  1. 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.
  2. The code has to be commented, and we need better test coverage to protect against accidental code changes.

Latest code

  • 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

Modules

Phone code modules

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.

Connection codes

  • Todo: add ngrx for state management. That should handle most of the connection issues.



Server-side codes

See the docs in the readme to see how the different pieces of the server side codes.

Kubernates

  • Todo: Use Kubernates to put all the micro-services together.



Quick links:

Clone this wiki locally