redbadger / pride-london-app

Pride in London mobile app
MIT License
85 stars 22 forks source link
react react-native

Pride in London App

CircleCI Maintainability Test Coverage

iOS: https://itunes.apple.com/gb/app/pride-in-london/id1250496471

Android: https://play.google.com/store/apps/details?id=org.prideinlondon.festival

Installation and setup

Prerequisites

More information on getting started can be found here: https://facebook.github.io/react-native/docs/getting-started.html under the Building projects with React Native tab.

General

Clone the repository

$ git clone git@github.com:redbadger/pride-london-app.git

And install dependencies

$ yarn

iOS

To develop on a real device locally you will need to install the development provisioning profile from fastlane.

Install fastlane using

[sudo] gem install fastlane -NV

or alternatively using brew cask install fastlane

You can then run the following command from the ios folder:

fastlane match development --readonly

You will need access to the private match-ios-certificates repo and will be prompted for the passphrase. Ask on the channel to get this sent to you in a secure way ;) On success you should be presented with the installed certificates and provisioning profile for org.prideinlondon.festival.

Next, open Xcode and the PrideLondonApp.xcodeproj. Plug in your device via USB, and select it in the device dropdown in the top left of Xcode. Then hit the build (Play) button.

Android

Environment Variables

In order to run the application locally you will need to find and add some environment variables to the project. These can be found in .env.example. Copy this file into another file called .env:

cp .env.example .env

And fill in the required variables from the appropriate developer portals (e.g. app.contentful.com/spaces/\<space-id>/api/keys) - use the Delivery API key.

Running

iOS

Android

Debugging

The recommended tool for debugging is React Native Debugger which has built in support for Redux Devtools.

To install React Native Debugger:

brew update && brew cask install react-native-debugger

Then to debug:

  1. Close any other debugger windows you have open
  2. Open the App from your Applications folder
  3. Start debugging in the app using one of the following methods:
Platform Command
iOS Press Cmd+R to reload, Cmd+D or shake for dev.
Android Double tap R on your keyboard to reload, shake or press menu button for dev menu.

Generating test data

Note: You do not need to do this if you are just getting your environment set up. This is for filling the remote CMS with mock data for testing purposes.

In order to fill the test CMS space with test data you can use our generate-content script. It goes without saying make sure you are doing this on a test CMS rather than production.

To generate test data:

node ./scripts/generate-content.js generate -s <space_id> -a <access_token>

To specify a specific number of items to generate just pass a number as the first argument:

node ./scripts/generate-content.js generate -s <space_id> -a <access_token> 5

To delete the generated data again:

node ./scripts/generate-content.js delete -s <space_id> -a <access_token>

For both commands you can skup the -s and -a flags by setting the environment variables CONTENTFUL_SPACE_ID and CONTENTFUL_MANAGEMENT_KEY respectively. E.g.

export CONTENTFUL_SPACE_ID=<space_id>
export CONTENTFUL_MANAGEMENT_KEY=<access_token>
node ./scripts/generate-content.js generate 5

Tests

E2E

End to end tests use Detox with Jest as the test runner. Some setup is required for running the tests locally.

Contributing

Pieces of work currently up for grabs will be listed on the issues page and tracked on the projects page. If you are able to work on the piece of work, comment on the issue. You can also discuss the feature in the isssue page. Be honest about if you have the time to work on it, there's no shame in parking a piece of work and letting someone else pick it up if you're too busy.

Follow the contribution guidelines to have a smooth experience getting your changes in.

Architecture Decision Records

We will keep a collection of records for "architecturally significant" decisions: those that affect the structure, non-functional characteristics, dependencies, interfaces, or construction techniques.

When making such changes please include a new ADR in your PR.

To find out more about ADRs have a read of this article: http://thinkrelevance.com/blog/2011/11/15/documenting-architecture-decisions

Links