Skip to content

Developer Environment Setup

Dileep Gadiraju edited this page Mar 15, 2023 · 6 revisions

Software Prerequisites

Optional software

Other tools used

Frontend Setup

  • 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.

Backend Setup

  • 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

Swagger Documentation URL

Backend DevOps

Backend Data Load

  • 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

Backend Data Setup

Useful Developer Tools

https://www.npmjs.com/package/react-devtools Note: For current version of saral execute npm i -g react-devtools@"<4.11.0"

Clone this wiki locally