Skip to content

Architecture

nshamit edited this page Jul 25, 2022 · 6 revisions

Overview

This document will explain the architecture of the Elixir System. There will be few areas we are discussing here and those areas are listed below.

High-Level Architecture of the Elixir System

Image of High-Level Architecture of the Elixir System

Architecture Block Diagram

Image of Architecture Block Diagram

Deployment Diagram

Screen Shot 2022-07-25 at 13 00 29

Signup Flow

  1. Send invitation to the User email
  2. Users will sign up for the system using the link available in the email.

Login Flow

  1. Login Action - User click on the login button
  2. Login Request of user - Login request of user will be sent to Asgardeo by Asgardeo SDK
  3. Users will be logged in to the system if there is an active session. If not, the user will be directed to the sign in page given by the 4. Asgardeo and prompt for password and username.
  4. User will proceed to login.

Backend API Call

  1. Request Access token for the user.
  2. Receive access token for the user from the Asgardeo.
  3. Exchange token with the Choreo STS.
  4. Receive the Choreo API access token.
  5. With API Access token attached, call the API
  6. Get the response from the API call.

Technical Specification

Overview

  • The Elixir System comprised the following components:
  1. Donor Portal - React web application
  2. Admin Portal - React web application
  3. API layer hosted in Choreo - APIs are written in Ballerina lang
  4. User Store and Authentication provided in Asgardeo with two applications
  5. Azure DB Instance

Web Applications

Donor Portal

This is a React application created using the create-react-app tool which will bundle a bunch of libraries when creating a default react app. All the technical specs are listed below.

Development Language:

  • typescript: 4.7.3

Base Level libraries are as listed below:

Testing Libraries:

  • @testing-library/react: 13.3.0
  • @testing-library/jest-dom: 5.16.4
  • @testing-library/user-event: 13.5.0
  • jest: 27.5.2

Authentication SDKs:

  • @asgardeo/auth-react: 1.1.11
  • @asgardeo/token-exchange-plugin: 0.1.3
  • @asgardeo/auth-spa: 0.4.4

Third-party component libraries:

  • moment: 2.29.4
  • react-icons: 4.4.0

Development time tools:

  • prettier: 2.7.1

Admin Portal

This is a React application created using the create-react-app tool which will bundle a bunch of libraries when creating a default react app. All the technical specs are listed below.

Development Language:

  • typescript: 4.7.3

Base Level libraries are as listed below:

Testing Libraries:

  • @testing-library/react: 13.3.0
  • @testing-library/jest-dom: 5.16.4
  • @testing-library/user-event: 13.5.0
  • jest: 27.5.2

Authentication SDKs:

  • @asgardeo/auth-react: 1.1.11
  • @asgardeo/token-exchange-plugin: 0.1.3

Third-party component libraries:

  • moment: 2.29.4
  • react-icons: 4.4.0
  • recharts: 2.1.10
  • react-table: 7.8.0
  • react-simple-toasts: 2.2.3
  • react-toastify: 9.0.5

Utility Libraries for UI:

  • clsx: 1.1.1

Development time tools:

  • prettier: 2.7.1

Elixir Backend on Choreo

All the APIs for Admin portal and Donor portal are created and hosted on WSO2 Choreo platform. All the APIs are written using Ballerina language.

  • Ballerina 2201.1.0 (Swan Lake Update 1)

User Store on Asgardeo

All the users are registered on Asgardeo and uses Asgardeo as the IDP for both of the web applications. Also API Access will be Authorized using Asgardeo.

Azure DB Instance

  • Azure MySQL : v8

Web Application Deployment

Web applications are deployed on Vercel under medicinesfor-lk organization (https://vercel.com/medicinesfor-lk). There are two deployments for the two Web applications (Donor portal and Admin Portal). And there will be two environments for each web application. One is the Development environment and the Production environment.

All the configs related to the IDP secrets are pushed when building using environment variables.