egovernments / health-campaign-field-worker-app

1 stars 15 forks source link

Unable to set up the code locally #351

Closed gaurav2010ec closed 9 months ago

gaurav2010ec commented 9 months ago

Hi, i tried to setup this code in my local machine, but unable to do so, i am getting the following error while setting up: $ melos exec └> melos run generate-flutter --no-select && melos run generate-dart --no-select └> FAILED (in 7 packages) └> digit_components (with exit code 1) └> digit_entity_hooks (with exit code 1) └> digit_firebase_services (with exit code 1) └> digit_showcase (with exit code 1) └> forms_engine (with exit code 1) └> freezed_bloc_hooks (with exit code 1) └> health_campaign_field_worker_app (with exit code 1)

melos run generate └> melos exec --concurrency 1 -- "melos run generate-flutter --no-select && melos run generate-dart --no-select" └> FAILED ScriptException: The script generate failed to execute.

Please help me on setting up the environment locally.

I think this error is in the following package:

forms_engine: Failed to build build_runner:build_runner:

../../../../../../../AppData/Local/Pub/Cache/hosted/pub.dev/watcher-1.0.2/lib/src/constructable_file_system_event.dart:7:57: Error: The class 'FileSystemEvent' can't be extended, implemented, or mixed in outside of its library because it's a sealed class. abstract class _ConstructableFileSystemEvent implements FileSystemEvent {

Please check and revert, if possible send me the steps for setting up the same.

Regards, Gaurav Kumar, email: er.gaurav2010ec@gmail.com

naveen-egov commented 9 months ago

@gaurav2010ec :

switch to 3.10.0 flutter version. and run that should work.

We are working on upgrade will release it soon.

gaurav2010ec commented 9 months ago

Thanks Naveen for your prompt response.

gaurav2010ec commented 9 months ago

Is there any more commands required for setting up the code locally. If possible can you please share the same.

naveen-egov commented 9 months ago

@gaurav2010ec :

Front Line Worker App Setup : This guide provides step-by-step instructions to clone and run the Health Campaign Field Worker App locally on your machine. The Health Campaign Field Worker App is a Flutter application developed for health campaigns.

Prerequisites Before you begin, ensure that you have the following installed on your PC:

Flutter 3.10.0 version - Flutter SDK

Android Studio or VS Code any preferred IDE for Flutter development Android device or emulator for testing Run flutter doctor command ensure all the required checklist is tickmarked

Run the application Open a terminal and run the following commands:

git clone https://github.com/egovernments/health-campaign-field-worker-app.git cd health-campaign-field-worker-app

Product Repo: egovernments/health-campaign-field-worker-app

Open the project in your preferred IDE (e.g., Android Studio, Visual Studio Code). Make sure that your IDE is configured with the Flutter and Dart plugins. Run install_bricks.sh bash script which is located in tools folder

Navigate to the root folder of the project in the terminal and run the following command to initialize the packages using Melos: melos bootstrap (-or-) melos bs

This command fetches and links all the necessary dependencies for the project.

Now create a .env file inside the apps/health_campaign_field_worker_app folder

Sample .env file

BASE_URL={replace with base url} MDMS_API_PATH="egov-mdms-service/v1/_search" TENANT_ID="default" SYNC_DOWN_RETRY_COUNT="3" RETRY_TIME_INTERVAL="5" CONNECT_TIMEOUT="120000" RECEIVE_TIMEOUT="120000" SEND_TIMEOUT="120000"

Again create another file as pubspec_overrides.yaml in the same folder

melos_managed_dependency_overrides: digit_components,digit_firebase_services,forms_engine,intl, digit_showcase

dependency_overrides: digit_components: path: ..\..\packages\digit_components digit_firebase_services: path: ..\..\packages\digit_firebase_services digit_showcase: path: ..\..\packages\digit_showcase forms_engine: path: ..\..\packages\forms_engine intl: ^0.18.0

Note:: Check all the folder names should be present in packages folder,

before overriding the dependencies

Navigate to the app's folder from the terminal:

cd apps/health_campaign_field_worker_app

Connect your Android device or start an emulator. Ensure that it is visible by running: flutter devices

Now, run the following command to launch the app: flutter run

This command will build the app and install it on the connected device or emulator.

gaurav2010ec commented 9 months ago

Hi Naveen, i have successfully configured and run the application but noting is visible in the application. Can you please share a demo BASE_URL, so that i will check and run the application properly. If possible can you please give me a time too, so that i will understand the login of the application.

Regards, Gaurav Kumar, Mo:8468869333

naveen-egov commented 9 months ago

@gaurav2010ec : we don't have any demo server running in our environment.

I can share the demo application video link : Link )