Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
chaseyutzy committed Mar 24, 2021
0 parents commit 3132944
Show file tree
Hide file tree
Showing 330 changed files with 35,199 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: CI

on: pull_request

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Use Node 12.x.x
uses: actions/setup-node@v1
with:
node-version: 12.x.x

- name: Install Yarn
run: npm install -g yarn

- name: Install Dependencies
run: yarn --ignore-scripts

- name: Lint
run: yarn lint

test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Use Node 12.x.x
uses: actions/setup-node@v1
with:
node-version: 12.x.x

- name: Install Yarn
run: npm install -g yarn

- name: Install Dependencies
run: yarn --ignore-scripts

- name: Jest
run: yarn test -- -- -- --forceExit

- name: Codecov
uses: codecov/codecov-action@v1

health:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Use Node 12.x.x
uses: actions/setup-node@v1
with:
node-version: 12.x.x

- name: Install Yarn
run: npm install -g yarn

- name: Install Dependencies
run: yarn --ignore-scripts

- name: Install sqlite3
run: (cd ./apollos-church-api/node_modules/sqlite3 && yarn install)

- name: Start Server and Check
run: yarn start:dev & sleep 30 && if [[ "$(curl 'http://localhost:4000/health')" != "ok" ]]; then exit 1; fi
working-directory: apollos-church-api
37 changes: 37 additions & 0 deletions .github/workflows/deploy_api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Deploy Api

on:
push:
branches: [ master ]
workflow_dispatch:

jobs:
api:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

# heroku only uses yarn if there's a yarn.lock file
- name: Use Yarn
run: |
cp yarn.lock apollos-church-api/yarn.lock
git config --global user.email "[email protected]"
git config --global user.name "Apollos Admin"
git add apollos-church-api/yarn.lock
git commit -am "added yarn.lock"
- name: Deploy to Heroku
uses: akhileshns/[email protected]
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: "apollos-church-api"
heroku_email: "[email protected]"
appdir: apollos-church-api

- name: Setup Node
uses: actions/setup-node@v1

- name: Publish Schema
run: npx apollo schema:publish --endpoint=${{ secrets.APP_DATA_URL }}
env:
ENGINE_API_KEY: ${{ secrets.ENGINE_API_KEY }}
118 changes: 118 additions & 0 deletions .github/workflows/deploy_client.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: Deploy Mobile App

on:
push:
branches: [ master ]

jobs:
ios:
defaults:
run:
working-directory: apolloschurchapp

runs-on: macos-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 12

- name: Install Yarn
run: npm install -g yarn

- name: Install Bundler
run: gem install bundler

- name: Fill out config variables
run: |
grep -o '\$.*' .env.production | sed 's/\$\(.*\)/\1/' | xargs -I {} sh -c "sed -i '' 's@\$"{}"@'$"{}"'@' .env.production"
cp .env.production .env
git checkout .
env:
APP_DATA_URL: ${{ secrets.APP_DATA_URL }}
ONE_SIGNAL_KEY: ${{ secrets.ONE_SIGNAL_KEY }}
GOOGLE_MAPS_API_KEY: ${{ secrets.GOOGLE_MAPS_API_KEY }}
AMPLITUDE_API_KEY: ${{ secrets.AMPLITUDE_API_KEY }}

- name: Install Dependencies
run: yarn

# required to build
- name: Generate Stories
run: yarn generate-stories

- name: Get Introspection Data
run: node ./scripts/get-introspection-data.js
env:
APP_DATA_URL: ${{ secrets.APP_DATA_URL }}

- name: Decrypt Secrets
run: (cd .. && yarn secrets -d ${{ secrets.ENCRYPTION_PASSWORD }})

- name: Fastlane Deploy
run: bundle exec fastlane ios deploy
env:
MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}

android:
defaults:
run:
working-directory: apolloschurchapp

runs-on: macos-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 12

- name: Install Yarn
run: npm install -g yarn

- name: Install Bundler
run: gem install bundler

- name: Fill out config variables
run: |
grep -o '\$.*' .env.production | sed 's/\$\(.*\)/\1/' | xargs -I {} sh -c "sed -i '' 's@\$"{}"@'$"{}"'@' .env.production"
cp .env.production .env
git checkout .
env:
APP_DATA_URL: ${{ secrets.APP_DATA_URL }}
ONE_SIGNAL_KEY: ${{ secrets.ONE_SIGNAL_KEY }}
GOOGLE_MAPS_API_KEY: ${{ secrets.GOOGLE_MAPS_API_KEY }}
AMPLITUDE_API_KEY: ${{ secrets.AMPLITUDE_API_KEY }}

- name: Install Dependencies
run: yarn

# required to build
- name: Generate Stores
run: yarn generate-stories

- name: Get Introspection Data
run: node ./scripts/get-introspection-data.js
env:
APP_DATA_URL: ${{ secrets.APP_DATA_URL }}

- name: Decrypt Keystore
run: (cd .. && yarn secrets -d ${{ secrets.ENCRYPTION_PASSWORD }})

- name: Fastlane Deploy
run: bundle exec fastlane android deploy
env:
KEYSTORE_FILE: apollos.keystore
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: apollos
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# operating system files
.DS_Store
.DS_Store?
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
*.swp

# Dependency directories
node_modules/
.yalc/
yalc.lock
yarn-error.log
lerna-debug.log
19 changes: 19 additions & 0 deletions .mergify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
pull_request_rules:
- name: automatic merge when CI passes, 1 review, and 1 label
conditions:
- base=master
- label=merge
- label!=blocked
- label!=do-not-merge
actions:
merge:
method: squash
strict: smart
- name: delete head branch after merge
conditions:
- merged
actions:
delete_head_branch: {}
label:
remove:
- ready-for-review
22 changes: 22 additions & 0 deletions ALGOLIA.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Algolia Setup

This will walk you through setting up content indexing and search in your Apollos app.

**_NOTE: This will require a REDIS instance and Bull jobs scheduler has already been installed_**

First add the Algolia add on to your Heroku instance

```
heroku addons:create algoliasearch:free
```

For local development, get your apps Admin API key and Application ID and add those to your `.env` file. You can get these from your Heroku server config variables. They are added automatically.

```
ALGOLIASEARCH_APPLICATION_ID=<id>
ALGOLIASEARCH_API_KEY=<key>
```

### Indexing

To manage your scheduled indexing jobs go to the `/admin/queues` endpoint and log in with your `JOBS_USERNAME` and `JOBS_PASSWORD` variables from your environment
39 changes: 39 additions & 0 deletions AMPLITUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Amplitude Setup

This will explain how to get your Apollos app working with Amplitude

First, create a new project under your organization. This will will give you an API key you need for your local and CI/CD environments. Add key to `.env` to test.

```
AMPLITUDE_API_KEY=<key>
```

For your production app, add it to `.env.production`

```
AMPLITUDE_API_KEY=$AMPLITUDE_API_KEY
```

and as a repo secret on Github

![adding secret](https://files-qv931tk37.vercel.app)

Next we need to add the package to the app. Install with yarn.

`yarn add react-native-amplitude-analytics`

Add the following snippet to your `src/Providers.js` file:

```
import RNAmplitude from 'react-native-amplitude-analytics';
const amplitude = new RNAmplitude(ApollosConfig.AMPLITUDE_API_KEY);
```

Now add Amplitudes `logEvent` to our `AnalyticsProvider`

```
<AnalyticsProvider trackFunctions={
[({eventName, properties}) => amplitude.logEvent(eventName, properties)]
}>
```
9 changes: 9 additions & 0 deletions BIBLE_API.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Bible.API Setup

This will describe how to set up your API to pull scripture.

First create a new app on [Bible.API](https://scripture.api.bible/admin/applications/new). It will give a key that you can supply to your `.env` file and your servers environment config.

```
BIBLE_API_KEY=<key>
```
15 changes: 15 additions & 0 deletions BUGSNAG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Bugsnag Setup

This will explain how you can set up error logging in your Apollos app with Bugsnag

## API

First, go to Bugsnag's website and create a new project. Use "Server" > "Node" > "Express" in the onboarding. This will give you an API key to use.

Our API comes precoonfigured with Bugsnag. All you have to do is add the `BUGSNAG_KEY` variable to your `.env` file and as a config variable on your remote server. On Heroku:

```
heroku config:set BUGSNAG_KEY=<key>
```

## App
14 changes: 14 additions & 0 deletions BULL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Bull Setup

This will explain how to configure the Bull jobs scheduler

**_NOTE: This requires that REDIS has already been set up_**

Add credentials your local `.env` file and the remote server config variables

```
JOBS_USERNAME=<whatever>
JOBS_PASSWORD=<whatever>
```

You can view and manage jobs through the `/admin/queues` endpoint
17 changes: 17 additions & 0 deletions CHURCH_ONLINE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Church Online Platform Setup

Add your CHOP URL to the `.env` file locally and to the server environment variables

```
CHURCH_ONLINE_URL=https://<church>.online.church
```

Our `liveStreams` query is dependent on having sermon content set up in the app. Once you have defined the `SERMON_CHANNEL_ID` in the config, you can test with this query:

```
{
liveStreams {
isLive
}
}
```
Loading

0 comments on commit 3132944

Please sign in to comment.