## Click & Push Mobile

Click&Push's mobile app, built with React Native/Typescript. Acts as a client for [Click & Push's Rest API](https://git.clicknpush.ca/apps/webapp).

### Downloading and running the app

Reading the React Native CLI Quickstart guide on the official docs is highly recommended, however the process is very straight forward. https://reactnative.dev/docs/environment-setup

Click & Push Mobile uses [Expo's Bare workflow](https://docs.expo.dev/bare/exploring-bare-workflow/), so it leverages Expo's powerful CLI, but also allows for essential native modules to be added (i.e. voice recognition)

#### General
1. Clone the repository
2. Make sure you have execute permissions set on your project folder ``sudo chmod -R 755 atlas-mobile-ts/``
2. Install node and npm if needed https://nodejs.dev/learn/how-to-install-nodejs
3. Run ```npm install -g expo-cli``` if you don't have the expo-cli installed already.
4. Run ```npm install``` to install dependencies from package.json.

After these steps, you need to perform some additional platform-specific steps (note: the ios and android folders in the repo have important modifications that enable certain dependencies in the app to function properly, so its important to keep them intact when pushing and pulling the repo):

#### Android
1. Set up an android device (you'll need to use a physical device in order to use the voice to text capabilities), go [here](https://www.embarcadero.com/starthere/xe5/mobdevsetup/android/en/enabling_usb_debugging_on_an_android_device.html) if you need information on how to set up a physical device for development. 
3. Install and configure the a compatible JDK and android SDK (go [here](https://reactnative.dev/docs/environment-setup) and choose React Native CLI Quickstart -> \<your OS\> -> Android for comprehensive instructions on how to do that).
2. Check the atlas-mobile-ts/android/build.gradle file to make sure that compileSdkVersion and targetSdkVersion are set to the Android API level that matches your device (i.e. Android 12 = API 31)
3. Run ``expo run:android`` in the app root folder, which will install the app on your device and run it.

#### iOS
1. Set up an iOS device (you'll need to use a physical device in order to use the voice to text capabilities), go [here](https://reactnative.dev/docs/running-on-device#running-your-app-on-ios-devices) if you need information on how to set up a physical device for development. 
2. Install and configure the Xcode and cocoapods (go [here](https://reactnative.dev/docs/environment-setup) and choose React Native CLI Quickstart -> macOS -> iOS for comprehensive instructions on how to do that)   
3. It is recommended run the project using xcode, as it will provide some extra code quality checks.

For technical information about the project structure and explainations of the code, see the [wiki](https://git.clicknpush.ca/apps/atlas-mobile-ts/wiki/_pages).

        

