-
Notifications
You must be signed in to change notification settings - Fork 26
Developer Environment Setup
- React Native https://reactnative.dev/
- Node , NPM , OpenJDK 8
- Android Studio https://developer.android.com/
- Vysor https://www.vysor.io/download
- NDK old Version 20.0.5594570 needed to be compatible.
Use command
sdkmanager 'ndk;20.0.5594570'
to switch to ndk 20.0.5594570. (This command is handy on Mac or Linux) - Saral SDK (This SDK is embedded in SaralApp code base). Refer below documentation. https://github.com/Sunbird-Saral/react-native-saral-sdk
- Docker to bring up backend as a container (https://docs.docker.com/desktop/)
- Microsoft VoTT(Visual Object Tagging Tool) https://github.com/microsoft/VoTT VoTT Project Setup Video : https://www.youtube.com/watch?v=uXxE4Sas3uQ
- Jupyter Notebook for transforming VoTT raw json to Saral ROI json. Refer repo specs\v1\README.md file for more details. https://jupyter.org/
- PostMan to invoke Rest APIs
-
Install React Native and other software as per instructions @ https://reactnative.dev/docs/environment-setup
-
Download NDK 20.0.5594570 and extract archive to %ANDROID_HOME%\ndk folder. Source: https://androidsdkoffline.blogspot.com/p/android-ndk-side-by-side-direct-download.html
-
In Android Studio , navigate to File\Project Structure\SDK Location and set Android NDK location to %ANDROID_HOME%\ndk\android-ndk-r20 (extracted in last step).
-
Register on google firebase (https://firebase.google.com/), add saral project on firebase dashboard and download corresponding google-services.json.
-
Place downloaded google-services.json under %FRONTEND_FOLDER%/SaralApp/android/app folder.
-
Once Vysor and AVD are configured as per the instructions follow below to build and run commands to bring up the application.
-
Open command prompt in %FRONTEND_FOLDER%/SaralApp and run "npm i" command.
-
cd android && gradlew clean && cd..
-
npx react-native run-android
-
Make sure backend BASE_URL is configured in %FRONTEND_FOLDER%/SaralApp/src/configs/config.js file.
-
Successful frontend deployment should show SARAL OCR login screen on AVD.
- Install node and mongodb in your local machine.
- After taking pull of project from git , Install npm packages by running
npm i
from %BACKEND_FOLDER%. - Create a sub folder inside backend folder name it as config .
- Now create a file in config\dev.env and paste below commands
PORT=3000
.
MONGODB_URL=mongodb://localhost:27017/saraldata_dev
.
JWT_SECRET=SARALDATA_NODE
.
- npm run dev
- Successful backend local deployment should show Server is up on port 3000
-
Make sure backend server is running
-
Command to delete/clean existing data:
node ./data/import-data.js --delete
-
Command to load data from data files in ./backend/data folder.
node ./data/import-data.js --import
https://www.npmjs.com/package/react-devtools
Note: For current version of saral execute npm i -g react-devtools@"<4.11.0"