Plogalong is an app for iOS and Android designed to encourage new and existing ploggers to record the litter they pick up while walking, running, or exercising outdoors.
We're in the beginning stages of development, but we have a very detailed Mockup.
React-Native + Expo: React Native is built on the same bones as React for web, except that instead of building user interfaces from DOM elements, you use platform-native views (UIViews on iOS, Views on Android). Expo is a managed version of React Native that includes a library of components known to be compatible with each other. It adds some tooling that help in the development cycle.
Redux for managing local state
Database - Firebase
Authentication - Firebase
Clone this repository (How To Clone A Git Repository)
Node (10.x or 12.x) -- ensure that you have a recent version installed - https://nodejs.org/en/download/ Please use a LTS (even) version
Make sure that /usr/local/bin is in your $PATH by opening Terminal and typing in echo $PATH (if it's not, follow directions here: https://opensource.com/article/17/6/set-path-linux)
(iOS) Install Xcode This may take a while... why not go plogging for an hour?
...then launch it at least once so that you can agree to its Terms and Conditions.
(Android) Install Android Studio and create a virtual device.
See here for detailed instructions To create a virtual device from the Android welcome screen, click configure>AVD Manager To edit your virtual device selection from somewhere other than the welcome screen, click on the AVD Manager icon in the toolbar on the top right (looks like a phone with a green android alien)
n.b. Since this app will be deployed on the Google Play Store, when creating a virtual device in the AVD Manager, try to choose a device that has the triangular Google Play Store icon next to it. Download an available system image
npm install expo-cli --globalor
yarn global add expo-clinpm install expo-cli --global)
Configure Firestore connection: create a new file in the
firebase/folder, name it
config.js. Add the proper values to
firebase/config.jsby copying in the new config info (which you can find pinned in the #plogalong Slack channel).
Install node modules:
If you need to install an additional dependency, that dependency's documentation may give you instructions for using
yarn. If you encounter problems with the npm installation, using the yarn installation might work better. There are also instances when you may need to do
npm installafter pulling in new changes from the CfB master branch.
If you're planning on running this on an Android simulator, you'll have to install the Expo app via the simulated device's Google Play Store. To do so, open Android Studio, open the AVD Manager (icon looks like a phone with a green Android alien in the top right toolbar), click the Play button under "Actions" to launch the simulator. You can then open the Google Play Store on the simulated device. Now search for the Expo app and install it to the simulated device. You may have to launch the simulator from Android Studio each time you want to run the app via Expo.
In a terminal window, navigate to the root directory of your local clone of this repository. Type
expo startto launch Metro bundler and Expo's browser-based developer tools.
While Expo runs, you can type
ito run the app in the iOS simulator. In order to use the Android emulator, launch the Android Virtual Device emulator via Android studio (described above), then type
aat the terminal to run the app in the Android emulator. You can also use Expo's local web interface to launch the app.
If you type 'i' and get an error, run 'sudo xcode-select -s /Applications/Xcode.app'
To run Plogalong on an iOS device:
1. Install Expo on your iOS device from the App Store.
2. Connect both your computer and your iOS device with same Wi-Fi.
3. In Expo XDE in your browser, select Connection > LAN
4. Use the Camera App on your iOS (iOS 11+)Device or any QR code reader (iOS 9 & 10) to scan the QR Code.
5. Your QR code reader / Camera App, will ask if you want to launch the App in Expo Client App, select "Yes"
6. Plogalong should load accordingly
To run Plogalong on an Android device:
1. Install Expo on your Android device from the Google play store.
2. In Expo XDE in your browser, select Connection > Tunnel. Wait for a new link and QR code to generate below the connection options, and then click on the link to copy it to your clipboard.
3. Open Expo on your Android device. If you are on an emulated Android device, then select Open from Clipboard. Otherwise, select Scan QR Code.
5. Boom! You're ready to Plog.
Using the shared Firebase project
Check on our Slack channel for the shared configuration file. Save it to
Setting up your own Firebase project
- Install Firebase CLI:
npm install -g firebase-tools
- In the
firebase login. If prompted, log in to your Firebase account.
- Choose the project to use:
- An existing project: Run
firebase use --addand follow the prompts. (I use the alias
- A new project: Run
firebase projects:createand follow the prompts
- An existing project: Run
- Deploy with
firebase deploy. (See
firebase deploy --helpfor additional options.)
Additional setup: see the section on SendGrid below.
Some Firebase features require additional configuration in the shared app config
app.config.js). When building, you can optionally specify a
LOCAL_CONFIG_FILE environment variable. If given, it should be set to the path
(relative to the working directory) of a JS module that exports a config object.
app.config.js for the keys you can override.
What it's for: this API is used to send certain transactional emails: for example, user feedback.
Get API Key
- Create an account
- In the SendGrid dashboard, open API keys
- Create a new API key. If you choose to customize the access levels, set "Mail Send" to Full Access.
- Copy the API key
- Open the Sender Authentication page under Settings
- Choose "Authenticate Your Domain" and follow the instructions
- In this repo, cd to
- Set the email configuration options:
SG.xxxxxxx with the API key you got earlier. The
plogalong.admin_email option determines the email address that will receive
admin alerts (comment submissions, for instance). It will also be the sender
email unless you provide a separate
plogalong.sender_email option. In either
case, you must complete "Sender Authentication" (above) for the sender domain
What it's for: this API is used to populate the Current Weather box on the Plog screen
What to do: Register for a free account on Open Weather. Copy your key
from the "API Keys" tab and paste it into the
openWeatherMapKey of your
After a pull request is merged, it may specify that node_modules will need to be deleted. When this is the case, delete the
node_modulesfolder on your local repo and execute
yarn installin your terminal.
n.b. if you are using npm, execute
npm installinstead of
The time may come when you will have to update Expo on your simulator. To do so on the iOS simulator, execute
expo client:install:iosin your terminal. If it doesn't take on the first try, try once more. If you're still stuck after two times, consult an expert.
Debugging Plogalong should be no different than debugging any other React Native project, but below are some useful tools for your convenience.
Option 1: React-DevTools
If you're already familiar with debugging React web apps via Chrome DevTools, this is pretty similar. The React Native documentation points out that "the React Developer Tools Chrome extension does not work with React Native" and offers a standalone version of React Developer Tools for debugging.
The steps for installation can be found here.
Option 2: React Native Debugger
Similar to React-DevTools is the React Native Debugger published on GitHub by user jhen0409. This standalone app is based on the DevTools in Option 1 above, but may provide more functionality.
For installation via Homebrew, you can follow the README instructions.
Otherwise, you can simply download the appropriate prebuild binary from the release page (choose the .dmg file for macOS and .exe for Windows)
- Open React Native Debugger app, and notice that the default port is set to 8081. With this default window open, select Debugger > New Window (or more simply ⌘T or Ctrl+T) to change the port to 19001. Confirm the new packager port.
- Fire up the Plogalong app via
expo startjust like you always do.
- Navigate to the Expo Developer Menu with a shake gesture (Ctrl ⌘ Z in an iOS Simulator, Cmd+M in an Android Emulator), and select "Debug Remote JS" from the menu that pops up on the device.
- The React Native Debugger should connect and you'll see console.log() statements print in the console, be able to inspect elements by triggering the Expo Developer Menu (shake gesture > Toggle Element Inspector), and set breakpoints in the Debugger by navigating to Sources > Page > RNDebuggerWorker.js
- When you're finished, you'll save yourself some trouble the next time you start Plogalong if you remember to "Stop Remote Debugging" via the Expo Developer Menu (shake gesture).
How to Contribute
Join us on the Code for Boston Slack. We're in the #plogalong channel.