Source code structure

From Ethora iOS & Android ERC-20 & NFT tokenized community platform
Revision as of 23:07, 16 November 2021 by Taras.filatov (talk | contribs)
Jump to navigation Jump to search

Ethora engine GIT repo link

https://github.com/dappros/ethora/

JWT Authentication

Ethora engine uses JWT for authentication. All API requests are signed with this token.

Application JWT

Your Application has its own JWT which is permanent. You obtain this JWT after registering your Owner account and creating a new Application - this is done via Dappros platform backend:

User JWT

Users have their own JWT which expire over time and are re-issued by authenticating the User again.

Owners

When you register your account at our cloud backend (Dappros Platform) you become an Owner User.

Owners are Users with maximum privileges to the Applications they have created.

Social sign-in and Firebase role

Ethora cloud backend (Dappros Platform) handles JWT operations.

Firebase integration helps to support Social sign-in functionality.

ACL

Access Control List table is available here: ACL

Redux

Currently Ethora engine uses Redux for session state management.

Realm

Realm is being used as a persistent local storage for caching data.

App.js

Typical contents, implements the Redux store.

Routes.js (/src/routes.js)

Typical contents. Handles the Screens, navigation etc.

Components (/src/components/)

  • AppIntro - (optional) if enabled, this implements the static on-boarding screens to explain to the User the main concepts / how to use the App. By default this is disabled as the UX is pretty self explanatory.
  • shared/* - a number of reusable UI components
  • shared/defaultHeader.js - the main nav bar (header) of the App
  • shared/customHeader.js - the header for Chat Rooms and Profile screen
  • MessageBody - (more like Room Body, name is inherited from GiftedChat) chat screen container, includes processing / parsing particular messages and parts of their UI
  • MessageBubble - container for a particular message
  • SystemMessage - the area for system messages in the bottom of the chat room
  • TransactionListComponents - used to display transactions in Profile (and deprecated Transactions screen)
  • pushController - (may be redundant) was used for push notifications initiation

Helpers:  (/src/helpers/)

  • downloadFileLogic.js - handles file attachments
  • underscoreLogic.js - handles conversion between Ethereum hash and XMPP JID formats
  • xmppCentral.js - handles XMPP connection + XMPP listener
  • xmppStanzaRequestMessages.js - converts app/user actions into XMPP language and sends requests to XMPP server

XMPP listener

TO DO: XMPP listener requires further description / breakdown into subcomponents

Realm storage (/src/components/realmModels/allSchemas.js)

Local storage - handles caching for data received from the server.

stores schemas:

  • TransactionSchema - for blockchain transactions (Coin and Item transfers)
  • ChatListSchema - list of chat Rooms/Spaces for our Lobby screen
  • MessageSchema - messages within chat Rooms/Spaces