diff --git a/docs/source/app_architecture.png b/docs/source/app_architecture.png new file mode 100644 index 00000000..2b6e7d76 Binary files /dev/null and b/docs/source/app_architecture.png differ diff --git a/docs/source/app_architecture.rst b/docs/source/app_architecture.rst new file mode 100644 index 00000000..610497d7 --- /dev/null +++ b/docs/source/app_architecture.rst @@ -0,0 +1,52 @@ +.. _TeleMesh App Architecture: +.. _Room: https://developer.android.com/topic/libraries/architecture/room +.. _RxJava: https://www.toptal.com/android/functional-reactive-android-rxjava +.. _SQL: https://www.khanacademy.org/computing/computer-programming/sql-documentation + +TeleMesh App Architecture +------------------------- + +We can use the ``Message Module`` to explain this App architecture. + +1. In case of an Outgoing message, a message data will be sent from ``ChatActivity`` to +the ``ChatViewModel`` directly. + +2. Then the message data will be saved in ``MessageSourceData`` . + +3. We are using `Room`_ for storing data. As Room operate in background thread that’s why the message data will +be sent using `RxJava`_. Because it manages both background and foreground +task smoothly. All messages will be stored in the Message Table. All `SQL`_ +is executed in MessageDao. + +4. In the next step, message data will be sent to **Communication Layer**. +The ``Source`` will get the message from **MessageDao** as **RxJava observer** is +attached to it. Automatically ``RmDataHelper`` will get the message data +because **RxJava(Flowable)** is being used for getting last inserted data. + +5. ``RmDataHelper`` will send the message to MeshDataSource and this will +prepare this message data into JSON data to pass via the Mesh Network. + +6. In the case of an Incoming message, when any message will be available +in this network, it will be discovered in the application’s +Communication Layer. ``MeshDataSource`` will receive this message data and +send to ``RmDataHelper`` directly. ``Source`` will receive the data from +``RmDataHelper``. Now message data will be saved in Message table using +MessageDao. + +7. Now, View Layer will get the event of the message data. +``MessageSourceData`` will get the message data from MessageDao as **RxJava observer** +is attached to it. To show message in view level, the message +data will be provided to ``ChatViewModel`` automatically using +**RxJava(Flowable)**. After that, message will be seen in UI i.e.: +ChatActivity, through LiveData. + +8. ``RMDataHelper`` is directly connected with ``NotificationUtil``. When any data +is available to RMDataHelper, notification will be triggered as per +app’s requirements. + + + +.. figure:: app_architecture.png + :scale: 50 % + :alt: map to buried treasure + diff --git a/docs/source/conf.py b/docs/source/conf.py index 33410278..8157c564 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -44,8 +44,10 @@ 'sphinx.ext.coverage', 'sphinx.ext.mathjax', 'sphinx.ext.ifconfig', + 'sphinx.ext.autosectionlabel', 'sphinx.ext.viewcode', ] +autosectionlabel_prefix_document = True # Add any paths that contain templates here, relative to this directory. templates_path = ['ntemplates'] diff --git a/docs/source/index.rst b/docs/source/index.rst index 9ba58197..b6862f34 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -3,6 +3,8 @@ You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. +.. _app_architecture: + Project Overview ---------------- @@ -141,10 +143,8 @@ Minimum API: 19 (KitKat - 4.4.x) Development Guideline --------------------- -Please follow this link -https://docs.google.com/document/d/1W8joisx_mD6Rpa5aS-2hU16V2bgQ92V4VJDg_2tmlsE/edit?usp=sharing -to get an overview of telemesh app architecture and how the specific -module should be designed. +Hey, read the `App Architecture`_ section. + Developers Guideline step by step --------------------------------- @@ -451,4 +451,6 @@ our community manager through [media@telemesh.net] & [info@telemesh.net] .. _Contributing Guideline: https://github.com/w3-engineers/telemesh/blob/master/CONTRIBUTING.md .. _here: https://github.com/w3-engineers/telemesh/blob/master/CONTRIBUTING.md#reportissue +.. _App Architecture: app_architecture.rst +