You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
3.2 KiB

4 years ago
4 years ago
3 years ago
  1. # WPD-MobileApp
  2. This project contains the components developed for a mobile app within the Waterproofing Data Project - WPD-WP6.
  3. # Tech stack
  4. - [React Native](https://reactnative.dev/)
  5. - [Expo](https://docs.expo.io)
  6. # Folder Structure Convention
  7. > Folder structure options and naming conventions for this project
  8. ### Directory layout
  9. ```
  10. .
  11. ├── LICENSE # License description file
  12. ├── README.md # Readme description file
  13. └── db # database files
  14. └── src # source files
  15. ├── App.js # app initial file
  16. ├── app # app custom folders and files
  17. │   ├── assets # assets folder (images and static)
  18. │   ├── components # basic components folder
  19. │   ├── config # common config files
  20. │   ├── hooks # custom hooks
  21. │   ├── navigation # navigation files and routes
  22. │   └── screens # screen files
  23. ├── app.json
  24. ├── babel.config.js
  25. ├── package-lock.json
  26. ├── package.json
  27. ├── web-build
  28. │   └── register-service-worker.js
  29. └── yarn.lock
  30. ```
  31. ## Setting up
  32. $ git clone https://github.com/IGSD-UoW/WPD-MobileApp.git
  33. $ cd WPD-MobileApp/src
  34. $ npm install
  35. ## Running
  36. $ cd WPD-MobileApp/src
  37. $ npm start
  38. ## Running unit tests with [Jest](https://docs.expo.io/guides/testing-with-jest/)
  39. $ cd WPD-MobileApp/src
  40. $ npm run test
  41. ## Run the app
  42. To run the app locally, you need to install the [Expo Go](https://expo.io/client) app on your mobile device and then scan the QR code that appears in the terminal after running the following command:
  43. Ensure you have Yarn installed globally:
  44. $ # on macOS
  45. $ sudo yarn install
  46. $
  47. $ # on Linux
  48. $ sudo apt update && sudo apt install yarn
  49. Via Yarn, you can Expo CLI globally:
  50. $ sudo yarn global add expo-cli
  51. $
  52. $ # It is possible that some extensions are needed
  53. $ sudo yarn add expo-build-properties
  54. Using Expo you can configure the app to run on a mobile OS. In this case Android:
  55. $ eas build:configure
  56. ## Run on Android Emulator
  57. To run the app using expoon an Android emulator, you need to install the [Android Studio](https://developer.android.com/studio) and then run the following command:
  58. $ cd WPD-MobileApp/src
  59. $ npm run android
  60. ## Build and publish the app
  61. To build and publish the Android app, you have to run the following commands:
  62. $ eas build -p android
  63. This uses the EAS Build service to build the app. You can check the status of the build in the [EAS Build dashboard](https://expo.io/dashboard/builds).
  64. Note that you might be asked to provide your Expo credentials. If you don't have an Expo account, you can create one by running the following command:
  65. $ expo register