/react-native-starter

A React Native starter repo with the aim to implement "scalable gold star" standards from the get go giving some examples with a couple of screens.

Primary LanguageJavaScript

React Native Starter 🚀

Make a brew - because half your work's already done!

A React Native starter repo with the aim to implement "scalable gold star" standards from the get go giving some examples with a couple of screens.

Intro / Motivation

This hopefully exists as a "living document" in the sense that as popular patterns change and packages update, this starter app will also update.

To be honest it exists to fill that gap when you want to start a new side project / hobby project but you have that cracking idea but you say: "I proper can't be bothered setting everything up and putting boilerplate in..."

Getting Started

For the love of god, follow everything here: https://facebook.github.io/react-native/docs/getting-started

Some helpful things you might forget to do:

  • iOS: cd ios, pod install - get your ios pods installed - sometimes pod repo update is required too.
  • Android: cd android, ./gradlew clean - these are useful when Android bricks

You should be able to follow the getting started documents and then run the commands from the package.json to get going.

A nice workflow would be: yarn ios or yarn android with another terminal tab running the packager yarn packager, ios will automatically open a simulator, android won't.

You can also run the app through the respective IDEs in Android Studio and XCode which will look after the bundler, but they're both monsters for processing power.

For debugging life is going to be harder without React Native Debugger

There's an example auth server in server/ which is it's own express app. To get that running it's the usual yarn then yarn dev to get it going 👍

Outline

This starter will setup you up with a project has:

  1. Structure/Architecture with Prettier and ESLint
  2. React Native
  3. Redux, Redux-Thunk
  4. React Native Debugger
  5. React Navigation
  6. Axios
  7. Formik and Auth forms
  8. Basic screens

In the future maybe? 🤔

  • Jest (Unit & Integration Tests)
  • TypeScript
  • Detox/Appium (E2E tests)
  • Fastlane?
  • Project.pbx setup?
  • Analytics?
  • Crashes? Sentry?
  • Deeplinks?
  • Redux Persist/Offline?
  • Firebase? Push Notifications?

Reccomended VS Code Extensions

These are the ones that I've found help with the dev workflow - you might equally find them not so helpful.

  • Auto Close Tag (Essential)
  • Auto Rename Tag (Essential)
  • Babel JavaScript (Essential)
  • ESLint (Essential)
  • Prettier (Essential)
  • Code Spell Checker (Handy)
  • Color Highlight (Handy)
  • Partial Diff (Handy allows selection of text CTRL+C and then right click on another selection to - get a git like compare view)
  • Path Intellisense (Handy)
  • Rainbow Brackets (Depends on how much you like colours - but it's quicker nested function identification)
  • vscode-icons (VSCode's icons have come along way but these are still a litle better)
  • GitLens (This can be a bit resource intensive)

Assumptions

  • You enjoy single line quotes, no semi-colon enforcement and pretty much all the auto-formatting from Prettier out of the box.
  • You agree with the current ESLint ruling for both React / React Native / React Hooks
  • You're potentially going to require that your state/ folder is going to be shared and you prefer the logic siloed out.

Troubleshooting

  • Network requests not showing in React Native Debugger? This could be for a multitude of reasons but more than likely you haven't right clicked in the left side / state window and clicked 'Enable Network Inspect'. I think it's silly as well but it's what we've got.

  • If you're confused why you can't see you're state/state tree in React Native Debugger -> make sure the redux tools aren't on auto select as it might default to React Navigation rather than the redux state!

Useful links

When I get some worthy of this lovely list - I'll add them up!