@neur0base/app-sdk v0.1.19
ECHOPF-App-SDK
Directory
/src/data/
data formatters are contained in this directory. A data formatter for each data types is in /src/data/types/.
/src/form/
form elements are contained in this directory. A form element for each data types is in /src/form/types/.
/src/languages/
The dictionary file for each language is in this directory. They are loaded at /src/provider/EPFProvider via /src/utils/usei18n.
The dictionary file must follow the below rule. If you'd like to add new rule, please consult with the code owner.
- Error/{ModuleName}/{ErrorCode} : Define message per module per error code.
- UI/{UIName}/{LabelName} : Define label for each UI module.
- Model/{ModelName}/{FieldId} : Define label for each model field.
- Format/{FormatType} : Define formats.
- Common/{LabelName} : Define common labels.
/src/layout/
abbrev.
/src/plugin/
The plugin directory must follow the below directory sturucture.
- /plugin/{PluginName}/data/ : Store data formatter related only to the plugin.
- /plugin/{PluginName}/form/ : Store form elements related only to the plugin.
- /plugin/{PluginName}/languages/ : Store dictionary file for each language related only to the plugin.
- /plugin/{PluginName}/view/: Store view components. The view component is used by the user of this framework (used at DynamicLayoutBuilder, /example/ or imported project).
- /plugin/{PluginName}/widget/ : Store widget components.
/src/provider/
Store global variables.
- AppProvider : Combines other providers. The user of this framework calls this provider initially.
- EPAProvider : Store config file related to this framework.
- InstancesProvider : Store schema of all EPJ instances used in this framework.
- UserProvider : Store & manage user's credentials.
/src/ui/
The UI elements are in this directory. An UI element is used in the other UI elements or View components or Widget components or Form elements. The JSX must be defined in /theme/ui/.
/utils/
abbrev.
/theme/
The JSX or stylesheet files must be defined in this directory in order to separate between logic and visual.
/example/
The example directory is for debugging this framework.
Prerequisites:
- Nodejs (v12.18.3):
- React Native(0.63.2):
- Yarn (1.22.5)
For iOS build:
- xcode
- cocoapods
For android development:
- Android Studio
Build and run the app
Clone this repository by this command
git clone git@github.com:neur0base/ECHOPF-App-SDK.git
Navigate to the project root directory run
yarn install
- If you're on a Mac and developing for iOS, you need to install the pods (via Cocoapods) to complete the linking
If you're on a Mac and developing for Android, you need install JDK using Homebrewcd ios && pod install
brew cask install adoptopenjdk/openjdk/adoptopenjdk8
Start your application
- IOS
You should see your new app running in the iOS Simulator shortly.yarn ios
- Android
yarn android
If everything is set up correctly, you should see your new app running in your Android emulator shortly.
- IOS
Install package
- Install
oryarn add @neur0base/app-sk @echopf/sdk @echopf/frontend-model
npm install @neur0base/app-sdk @echopf/sdk @echopf/frontend-model
Install
peerDependencies
Package includes other dependencies as:
@react-native-community/push-notification-ios
,react-native-maps
,@react-native-community/datetimepicker
, ...Run the command below to install all the dependencies
yarn add react-native-maps @react-native-community/checkbox @react-native-community/datetimepicker @react-native-community/masked-view @react-native-community/picker native-base react-native-date-picker react-native-document-picker react-native-vector-icons react-native-localize @react-native-picker/picker react-native-reanimated react-native-safe-area-context react-native-screens @react-native-community/push-notification-ios @react-navigation/bottom-tabs @react-navigation/drawer @react-navigation/native @react-navigation/stack react-native-gesture-handler react-native-push-notification react-native-svg react-navigation i18next react-i18next
Link the dependency with iOS
cd ios && pod install
or
npx pod-install
and rebuild your project
General Usage
- Config App, Layout ( i18n, theme, client, ...)
<EPAProvider client={yourClient} i18n={yourI18n} style={yourThemeStyle}> <DynamicLayoutBuilder screens={screens} language={'en-US'} common={commonConfig} layout={layoutConfig} theme={themeConfig} /> </EPAProvider>
- Setup
react-native-vector-icons
follow doc