<commit_before># React Native - Meteor Boilerplate

A starting point for integrating a React Native app with a Meteor app. I've used this file structure in large, multi-developer projects.

_Note #1:_ This project only specifies an opinion on the *React Native* project architecture.

## Getting started with Meteor

1. Make sure you have [Meteor](https://www.meteor.com/) installed.
2. After cloning the repo, `cd MeteorApp/ && meteor`


## Getting started with React Native

1. Make sure you have [React Native](https://facebook.github.io/react-native/) installed.
2. After cloning the repo, `cd RNApp/ && npm install`

## Running on iOS

### In the Simulator

From the `RNApp/` directory you can run `npm run ios`. This will start the react native packager and open up Xcode. The default configurations in `app/config.js` should work fine for you. The press the play button in Xcode.

### On a Device

In `RNApp/ios/RNApp/AppDelegate.m` change the the `jsCodeLocation` line and swap out `localhost` for your machine's IP Address. You can get your IP Address by running `ipconfig getifaddr en1`.

You'll also have to change the `host` option in `app/config.js` to be your machine's IP Address.

Then `npm run ios` to open Xcode.

Then plug your phone into your machine and select your device in Xcode. Press the play button in Xcode. Make sure you device is unlocked

## Running on Android

### In the Simulator

First you'll have to change the `host` option in `RNApp/app/config.js` to your Meteor server's IP address. While developing this will likely be your machine. On OSX you can get your IP address by running `ipconfig getifaddr en1` in a terminal window.

Once you've done that (and following successful completion of the [React Native Android Installation](https://facebook.github.io/react-native/docs/android-setup.html#content)) you can run `react-native run-android` to get the app running.

_Note:_ You have to have the android simulator running before running `react-native run-android`.

### On a Device

__HELP REQUESTED__: I don't have an Android device so I can't test this out.

## Project Organization

If you're interested in seeing why the React Native project is organized the way it is please [refer to this document](/docs/react-native-project-organization.md).

The Meteor project is completely up to you at this point.

## Technologies Used

- [Meteor](https://www.meteor.com/)
- [React Native](https://facebook.github.io/react-native/)
- [Node DDP Client](https://github.com/hharnisc/node-ddp-client) (at version 0.1.1)
- [EJSON](https://github.com/primus/ejson)
- [lodash](https://lodash.com/)
<commit_msg>adding instructions for running app on device in linux<commit_after># React Native - Meteor Boilerplate

A starting point for integrating a React Native app with a Meteor app. I've used this file structure in large, multi-developer projects.

_Note #1:_ This project only specifies an opinion on the *React Native* project architecture.

## Getting started with Meteor

1. Make sure you have [Meteor](https://www.meteor.com/) installed.
2. After cloning the repo, `cd MeteorApp/ && meteor`


## Getting started with React Native

1. Make sure you have [React Native](https://facebook.github.io/react-native/) installed.
2. After cloning the repo, `cd RNApp/ && npm install`

## Running on iOS

### In the Simulator

From the `RNApp/` directory you can run `npm run ios`. This will start the react native packager and open up Xcode. The default configurations in `app/config.js` should work fine for you. The press the play button in Xcode.

### On a Device

In `RNApp/ios/RNApp/AppDelegate.m` change the the `jsCodeLocation` line and swap out `localhost` for your machine's IP Address. You can get your IP Address by running `ipconfig getifaddr en1`.

You'll also have to change the `host` option in `app/config.js` to be your machine's IP Address.

Then `npm run ios` to open Xcode.

Then plug your phone into your machine and select your device in Xcode. Press the play button in Xcode. Make sure you device is unlocked

## Running on Android

### In the Simulator

First you'll have to change the `host` option in `RNApp/app/config.js` to your Meteor server's IP address. While developing this will likely be your machine. On OSX you can get your IP address by running `ipconfig getifaddr en1` in a terminal window.

Once you've done that (and following successful completion of the [React Native Android Installation](https://facebook.github.io/react-native/docs/android-setup.html#content)) you can run `react-native run-android` to get the app running.

_Note:_ You have to have the android simulator running before running `react-native run-android`.

### On a Device

#### For Linux
##### Enable USB Debugging

Enable USB Debugging on your phone. If already connected to your computer unplug and replug the USB connection afterwards. Android 5 steps below:

> Settings > About Phone > Build number > Tap it 7 times to become developer;
> Settings > Developer Options > USB Debugging.

##### Setup Device on Linux

Configure how the device will connect to the meteor server. See [running android on a device](https://facebook.github.io/react-native/docs/running-on-device-android.html) to pick from the options.

Plug in your device and use _lusb_ to find the first 4 digits of  your device ID.
> lsusb
Bus 001 Device 003: ID 04e8:2e76 Motorola PCS

Enter this in udev rules. In the example we are copying over `04e8`
> echo SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666", GROUP="plugdev" | sudo tee /etc/udev/rules.d/51-android-usb.rules

Check that your device is properly connecting to ADB, the Android Debug Bridge, by using:
> adb devices

These steps are abstracted from the pages [running on device](https://facebook.github.io/react-native/docs/running-on-device-android.html) and [getting started](https://facebook.github.io/react-native/docs/getting-started-linux.html#setting-up-an-android-device) on linux. 

##### Install App and Run on Device for Linux

Build and install on your device, launch the react server, and then launch the app on your phone:
> react-native android
> react-native run-android

## Project Organization

If you're interested in seeing why the React Native project is organized the way it is please [refer to this document](/docs/react-native-project-organization.md).

The Meteor project is completely up to you at this point.

## Technologies Used

- [Meteor](https://www.meteor.com/)
- [React Native](https://facebook.github.io/react-native/)
- [Node DDP Client](https://github.com/hharnisc/node-ddp-client) (at version 0.1.1)
- [EJSON](https://github.com/primus/ejson)
- [lodash](https://lodash.com/)

{'fraction_non_alphanumeric': 0.09278350515463918, 'fraction_numerical': 0.007022262064843867, 'mean_word_length': 4.254317111459969, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 19, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1478242', 'n_tokens_mistral': 1983, 'n_tokens_neox': 1871, 'n_words': 877}