Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
270 additions
and
501 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!--- Provide a general summary of the issue in the Title above --> | ||
|
||
### Help us reproduce - tell us about your environment | ||
<!--- Provide a more detailed information of environment you use --> | ||
<!--- Mac or Windows? iOS or Android? Latest version from Master? --> | ||
1. | ||
|
||
### Steps to reproduce | ||
<!--- Provide a set of unambiguous steps to reproduce this bug include code, if relevant --> | ||
1. | ||
|
||
### Expected result | ||
<!--- Tell us what should happen --> | ||
1. | ||
|
||
### Actual result | ||
<!--- Tell us what happens instead --> | ||
1. [Screenshot, logs] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2016 Matt Mcnamee | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"expo": { | ||
"sdkVersion": "22.0.0" | ||
"sdkVersion": "22.0.0", | ||
"privacy": "public" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# FAQs | ||
|
||
## Where did you come up with this? | ||
|
||
By no means is this the 'right' or 'only' way to build a React or React Native App. We have however, worked on various apps built with React and React Native, that are 'in the wild' right now. So the ideas presented here are simply based on experience. | ||
|
||
## Code Style Guide? | ||
|
||
We're using [Airbnb's](https://github.com/airbnb/javascript) JS/React Style Guide with ESLint linting. We just like it :) | ||
|
||
## Is this a "Universal" app? | ||
|
||
To be clear, No it isn't. We've tried sharing absolutely everything across web and native mobile apps - and have run into road blocks where we've needed to undo the "universalism". | ||
|
||
Our opinion for performant and maintainable solutions, is to: | ||
|
||
- Share things like data structures, libraries and business logic | ||
- And hand craft optimal user-interfaces for each platform | ||
|
||
## React, hah? How do I? | ||
|
||
[React Native Express](http://www.reactnativeexpress.com/) is a great site to get you started, specifically: | ||
|
||
- [Get your head around ES6](http://www.reactnativeexpress.com/es6) | ||
- [What is JSX?](http://www.reactnativeexpress.com/jsx) | ||
- [What are Components?](http://www.reactnativeexpress.com/components) | ||
- [React State](http://www.reactnativeexpress.com/data_component_state) | ||
- [Redux](http://www.reactnativeexpress.com/redux) | ||
|
||
Once you've got your head around the basics, checkout the [React Native](https://facebook.github.io/react-native/) and [React](https://reactjs.org/) websites, specifically | ||
|
||
- Go through ['The Basics'](https://facebook.github.io/react-native/docs/props.html) | ||
- Gain an understanding of the [components](https://facebook.github.io/react-native/docs/activityindicator.html) React Native provides out of the box | ||
|
||
## How do I customize the App Display Name and Icon? | ||
|
||
You can edit `app.json` to include [configuration keys](https://docs.expo.io/versions/latest/guides/configuration.html) under the `expo` key. | ||
|
||
To change your app's display name, set the `expo.name` key in `app.json` to an appropriate string. | ||
|
||
To set an app icon, set the `expo.icon` key in `app.json` to be either a local path or a URL. It's recommended that you use a 512x512 png file with transparency. | ||
|
||
## How do I eject from 'Create React Native App' and Expo? | ||
|
||
If you want to build and deploy your app yourself, you'll need to eject from CRNA and use Xcode and Android Studio. | ||
|
||
This is usually as simple as running `npm run eject` in your project, which will walk you through the process. Make sure to install `react-native-cli` and follow the [native code getting started guide for React Native](https://facebook.github.io/react-native/docs/getting-started.html). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Understanding the File Structure | ||
|
||
- `/docs` - Github Repo Documentation | ||
- `/firebase` - Firebase samples | ||
- `/native-base-theme` - React Native's theme (by NativeBase) | ||
- `/src` - Contains the source code for both web & native | ||
- `/actions` - Redux Actions - payloads of information that send data _from_ your application _to_ your store. [Read More →](https://redux.js.org/docs/basics/Actions.html) | ||
- `/constants` - Shared variables (across platforms) | ||
- `/containers` - 'Smart-components' that connect business logic to presentation [Read More →](https://redux.js.org/docs/basics/UsageWithReact.html#presentational-and-container-components) | ||
- `/lib` - Utils and custom libraries that are shared across platforms | ||
- `/native` - React Native specific code | ||
- `/components` - 'Dumb-components' / presentational. [Read More →](https://medium.com/@dan_abramov/smart-and-dumb-components-7ca2f9a7c7d0) | ||
- `/constants` - Native-specific variables and config | ||
- `/routes`- wire up the router with any & all screens [Read More →](https://github.com/aksonov/react-native-router-flux) | ||
- `/reducers`- Redux Reducers - Actions dispatch to reducers, which actually change the state [Read More →](https://redux.js.org/docs/basics/Reducers.html) | ||
- `/store`- Redux Store - hooks up the stores and provides initial/template states [Read More →](https://redux.js.org/docs/basics/Store.html) | ||
- `/web` - React-Web specific code | ||
- `/components` - 'Dumb-components' / presentational. [Read More →](https://medium.com/@dan_abramov/smart-and-dumb-components-7ca2f9a7c7d0) | ||
- `/routes`- wire up the router with any & all screens [Read More →](https://github.com/aksonov/react-native-router-flux) | ||
- `/styles`- all the SCSS you could dream of |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Get Started with Firebase | ||
|
||
We've created a quick little "API server" on [Google's Firebase Platform](https://firebase.google.com/). You can get your own API up and running within minutes too: | ||
|
||
1. Signup for a [Firebase account](https://firebase.google.com/) | ||
1. Create a new project - eg. "React Native Starter App" | ||
1. Turn on email/password __Authentication__ | ||
1. Enable the __Database__ feature, and import the `firebase-sample-data.json` file found in this repo | ||
1. Get the Firebase project's API credentials, and add them to the respective variables in your `/src/constants/firebase.js` file. You can get your projects details from Firebase, by clicking on the cog icon, next to overview > 'Add Firebase to your web app'. | ||
1. Add the following __rules__ to the Database | ||
|
||
```json | ||
{ | ||
"rules": { | ||
".read": false, | ||
".write": false, | ||
|
||
"meals": { | ||
".read": true | ||
}, | ||
|
||
"recipes": { | ||
".read": true, | ||
".indexOn": ["category"] | ||
}, | ||
|
||
"users": { | ||
"$uid": { | ||
".read": "auth != null && auth.uid == $uid", | ||
".write": "auth != null && auth.uid == $uid", | ||
|
||
"firstName": { ".validate": "newData.isString() && newData.val().length > 0" }, | ||
"lastName": { ".validate": "newData.isString() && newData.val().length > 0" }, | ||
"lastLoggedIn": { ".validate": "newData.val() <= now" }, | ||
"signedUp": { ".validate": "newData.val() <= now" }, | ||
"role": { | ||
".validate": "(root.child('users/'+auth.uid+'/role').val() === 'admin' && newData.val() === 'admin') || newData.val() === 'user'" | ||
} | ||
} | ||
}, | ||
|
||
"favourites": { | ||
"$uid": { | ||
".read": "auth != null && auth.uid == $uid", | ||
".write": "auth != null && auth.uid == $uid" | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
Want to experiment even more with Firebase? Check out the [Firebase Cloud Functions](/firebase/README.md) |
Oops, something went wrong.