DreamWalk React Native Apollo Template

Downloads in past


0.11.1a month agoa year agoMinified + gzip package size for @dreamwalk-os/react-native-apollo-template in KB


DreamWalk React-Native Template

Getting started

Initialise a project with the command
npx react-native init <ProjectName> --template git+ssh://git@gitlab.com:dreamwalk/magic-button/dreamwalk-react-native-apollo-template.git

This template is configured to use yarn. Once project has been initialised from template, run yarn; npx pod-install

Configure splash screen

This template uses react-native-bootsplash for handling splash screen. A default DreamWalk logo has been used but can be overridden. Generate a high res asset to be used as the splash image and run:
yarn react-native generate-bootsplash path/to/original/asset.png
additional options can be specified if required:
  --background-color <color>  color used as launch screen background (in hexadecimal format) (default: "#fff")
  --logo-width <width>        logo width at @1x (in dp - we recommand approximately ~100) (default: 100)
  --assets-path [path]        path to your static assets directory (useful to require the logo file in JS)
  --flavor <flavor>           [android only] flavor build variant (outputs in an android resource directory other than "main")
  -h, --help                  output usage information

yarn react-native generate-bootsplash assets/bootsplashlogooriginal.png \ --background-color=F5FCFF \ --logo-width=100 \ --assets-path=assets \ --flavor=main
See the [react-native-bootplash docs](https://github.com/zoontek/react-native-bootsplash) for more information 

## Build Environments

### Dev

-   Attached to dev backend, used for local development and pushing to DreamWalk Beta platform for internal builds
-   Reads from .env.development env file

### UAT

-   Attached to UAT backend, used for pushing to DreamWalk Beta platform
-   Reads from .env.uat env file

### Production

-   Attached to Production backend, used for pushing to App Store/Play Store.
-   Using clients Apple Developer account/Google Play production keystore
-   Reads from .env.production env file

## GraphQL

## Setup

Configure the schema under `src/graphql/codegen.yml` to point to the GraphQL endpoint for the project.

-   Store queries and mutations under the following paths for them to be picked up by codegen:
    `['src/features/*/graphql/*.graphql', 'src/graphql/**/*.graphql', 'src/graphql/*.graphql']`

## Generating GraphQL

This application uses GraphQL CodeGen to automatically generate hooks and typescript typings for all our GraphQL queries and mutations.

Running `yarn codegen` will generate typescript Apollo hooks for any `.graphql` files in the the `src/graphql/` directory or in the `graphql` subdirectory of a feature.

## Troubleshooting

#### Script stuck downloading
If you're install script is stuck endlessly downloading and/or stuck with last log:

```idealTree: timing arborist:ctor Completed in 1ms```

Verify you have `yarn` installed and re-run the init script. Yarn is required for this template 

#### Permission denied (publickey)
git@gitlab.com: Permission denied (publickey). fatal: Could not read from remote repository. ```
Verify you have your ssh key added to keychain with
``ssh-add --apple-use-keychain ~/.ssh/id_rsa``
then re-run the init script