Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Environment configs & bump versions #3

Open
wants to merge 2 commits into
base: core
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
API_URL=https://dev.myapi.com
1 change: 1 addition & 0 deletions .env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
API_URL=https://prod.myapi.com
1 change: 1 addition & 0 deletions .env.staging
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
API_URL=https://stage.myapi.com
68 changes: 68 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Project

package-lock.json
ios/Podfile.lock


# OSX
#
.DS_Store

# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate

# Android/IntelliJ
#
build/
.idea
.gradle
local.properties
*.iml
*.hprof

# node.js
#
node_modules/
npm-debug.log
yarn-error.log

# BUCK
buck-out/
\.buckd/
*.keystore
!debug.keystore

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/

*/fastlane/report.xml
*/fastlane/Preview.html
*/fastlane/screenshots

# Bundle artifact
*.jsbundle

# Ruby / CocoaPods
/ios/Pods/
/ios/tmp.xcconfig
/vendor/bundle/
144 changes: 121 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,58 +1,156 @@
# 🍍 Pineapple RN template
<img src="./images/pineapple_github.jpg" alt="mvp structure" width="800">

# 🍍 Pineapple ReactNative template

# 🐸 Dependencies

# 🐸 Dependencies
- [Async Storage](https://www.npmjs.com/package/@react-native-async-storage/async-storage) - Key-value storage
- [Axios](https://github.com/axios/axios) - Networking
- [Date-fns](https://date-fns.org) - Date utility
- [Formik](https://formik.org) - Build forms
- [React Native Config](https://www.npmjs.com/package/react-native-config) - Environment configs
- [React Native Gesture Handler 2](https://www.npmjs.com/package/react-native-gesture-handler) - Gestures
- [React Native Keychain](https://www.npmjs.com/package/react-native-keychain) - Secure storage
- [React Native Splash Screen](https://www.npmjs.com/package/react-native-splash-screen) - Splash screen
- [React Native Svg](https://github.com/react-native-svg/react-native-svg) - Create SVG
- [React Navigation](https://reactnavigation.org/docs/getting-started/) - Navigation between screens & bottom tabs
- [React Navigation Devtools](https://reactnavigation.org/docs/devtools/) - Tools to debug navigation
- [Reanimated 2](https://docs.swmansion.com/react-native-reanimated/docs) - Animations
- [Redux Toolkit](https://redux-toolkit.js.org/introduction/getting-started) - State manager & RTK queries
- [Axios](https://github.com/axios/axios) - Networking
- [Date-fns](https://date-fns.org) - Date utility
- [Formik](https://formik.org) - Build forms
- [Yup](https://github.com/jquense/yup) - Form validation
- [RNGH 2](https://www.npmjs.com/package/react-native-gesture-handler) - Gestures
- [Reanimated 2](https://docs.swmansion.com/react-native-reanimated/docs) - Animations
- [React Native Svg](https://github.com/react-native-svg/react-native-svg) - Create SVG
- [React Native Splash Screen](https://www.npmjs.com/package/react-native-splash-screen) - Splash screen

# 👨‍💻 Development dependencies
# 👨‍💻 Development dependencies

- [Module Resolver](https://www.npmjs.com/package/babel-plugin-module-resolver) - Path aliases
- [SVG Transformer](https://github.com/kristerkari/react-native-svg-transformer) - Use SVG as components
- [RN Flipper](react-native-flipper) - Enable Flipper debugger
- [Flipper](react-native-flipper) - Enable Flipper debugger

# 🙈 Setup

## Main branch
## Main branch

> **📝 NOTE:** Main branch is used only for demonstration purposes. If you want to use this template, please use <b>Core</b> branch

1. Install dependencies & pods
<pre>
<code>npm i && cd ios && pod install</code>
<code>npm run setup</code>
</pre>
2. Build a project
<pre>
<code>// iOS</code>
<code>npm run ios</code>

<code>// Android </code>
<code>npm run android</code>
</pre>
2. Build a project with XCode or Android Studio
3. Make some coffee while project is building☕️
4. Run Metro bundler (if it's not opened yet) and run an application

## Core branch

1. Create a new project with TypeScript template:
<pre>
<code>npx react-native init AwesomeTSProject --template react-native-template-typescript</code>
</pre>
2. Move the files from this repository to a project we just created
3. [Configure splash screen for iOS & Android](https://www.npmjs.com/package/react-native-splash-screen)
4. [Configure react-navigation](https://reactnavigation.org/docs/getting-started/#installing-dependencies-into-a-bare-react-native-project)
5. [Configure Reanimated 2 for Android](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation#android)
6. Install dependencies
7. Install pods
8. Build a project with XCode or Android Studio
2. Install dependencies & pods
<pre>
<code>npm run setup</code>
</pre>
3. Move the files from this repository to a project we just created
4. [Configure React Native Config](https://www.npmjs.com/package/react-native-config)
5. [Configure splash screen for iOS & Android](https://www.npmjs.com/package/react-native-splash-screen)
6. [Configure react-navigation](https://reactnavigation.org/docs/getting-started/#installing-dependencies-into-a-bare-react-native-project)
7. [Configure Reanimated 2 for Android](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation#android)
8. Build a project
<pre>
<code>// iOS</code>
<code>npm run ios</code>

<code>// Android </code>
<code>npm run android</code>
</pre>

# 📜 Scripts

### Start a Metro bundler
<pre>
<code>npm run start</code>
</pre>

### Install dependencies and pods
<pre>
<code>npm run setup</code>
</pre>

# 🐛 Debug
### Remove all packages and clear cache
<pre>
<code>npm run reset</code>
</pre>

### Run android
> **📝 NOTE:** Build will be created with <b>Debug</b> configuration
<pre>
<code>// Development </code>
<code>npm run android</code>

<code>// Staging </code>
<code>npm run android:staging</code>

<code>// Production </code>
<code>npm run android:production</code>
</pre>

### Create APK
<pre>
<code>// Staging </code>
<code>npm run deploy-android:staging</code>

<code>// Production </code>
<code>npm run deploy-android:production</code>
</pre>

### Run iOS
> **📝 NOTE:** Build will be created with <b>Debug</b> configuration
<pre>
<code>// Development </code>
<code>npm run ios</code>

<code>// Staging </code>
<code>npm run ios:staging</code>

<code>// Production </code>
<code>npm run ios:production</code>
</pre>

# 🐛 Debug

This template is integrated with [Flipper](https://fbflipper.com) to debug an application

### Flipper plugins

- [react-navigation](https://reactnavigation.org/docs/devtools/)
- [redux-flipper](https://www.npmjs.com/package/redux-flipper)

# 📚 Useful resources

- [🌅 Splash screen & AppIcon generator](https://appicon.co)
- [🧬 Convert SVG to React Native component](https://react-svgr.com/playground/?native=true)
- [🔤 Add custom fonts](https://www.bigbinary.com/learn-react-native/adding-custom-fonts)

[![alt text][1.1]][1]
[![alt text][2.1]][2]

If you have any suggestions or questions feel free to make a Pull Request or contact us!

## Run by

[OmiSoft](https://omisoft.net/?utm_source=github&utm_medium=social)

[1]: http://www.twitter.com/omisoftnet
[2]: http://www.facebook.com/omisoftnet
[1.1]: http://i.imgur.com/wWzX9uB.png "twitter icon without padding"
[2.1]: http://i.imgur.com/fep1WsG.png "facebook icon without padding"

## License

ReactNative PineApple Template is released under the MIT license.
See the [LICENSE](./LICENSE.md) for details.
77 changes: 42 additions & 35 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,54 +3,61 @@
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
"start": "npx react-native start --reset-cache",
"setup": "npm i && cd ios && pod install",
"reset": "rm -rf node_modules/ && npm cache clear && watchman watch-del-all",
"android": "ENVFILE=.env.development npx react-native run-android",
"android:staging": "ENVFILE=.env.staging npx react-native run-android",
"android:production": "ENVFILE=.env.production npx react-native run-android",
"ios": "ENVFILE=.env.development npx react-native run-ios --device --configuration Debug",
"ios:staging": "ENVFILE=.env.staging npx react-native run-ios --device --configuration Debug",
"ios:production": "ENVFILE=.env.production npx react-native run-ios --device --configuration Debug",
"build-android:staging": "cd android && ENVFILE=.env.staging ./gradlew assembleRelease && open ./app/build/outputs/",
"build-android:production": "cd android && ENVFILE=.env.production ./gradlew assembleRelease && open ./app/build/outputs/"
},
"dependencies": {
"@react-native-async-storage/async-storage": "^1.17.6",
"@react-native-community/cli": "^8.0.2",
"@react-navigation/bottom-tabs": "^6.3.1",
"@react-navigation/devtools": "^6.0.7",
"@react-navigation/native": "^6.0.10",
"@react-navigation/native-stack": "^6.6.2",
"@reduxjs/toolkit": "^1.8.2",
"@react-native-async-storage/async-storage": "^1.17.7",
"@react-native-community/cli": "^8.0.5",
"@react-navigation/bottom-tabs": "^6.3.2",
"@react-navigation/devtools": "^6.0.8",
"@react-navigation/native": "^6.0.11",
"@react-navigation/native-stack": "^6.7.0",
"@reduxjs/toolkit": "^1.8.3",
"axios": "^0.27.2",
"date-fns": "^2.28.0",
"date-fns": "^2.29.1",
"formik": "^2.2.9",
"react": "18.1.0",
"react-native": "0.68.2",
"react-native-gesture-handler": "^2.4.2",
"react-native-keychain": "^8.0.0",
"react-native-reanimated": "^2.8.0",
"react": "18.2.0",
"react-native": "0.69.3",
"react-native-config": "^1.4.6",
"react-native-gesture-handler": "^2.5.0",
"react-native-keychain": "^8.1.1",
"react-native-reanimated": "^2.9.1",
"react-native-safe-area-context": "^4.3.1",
"react-native-screens": "^3.13.1",
"react-native-screens": "^3.15.0",
"react-native-splash-screen": "^3.3.0",
"react-native-svg": "^12.3.0",
"react-native-svg": "^12.4.3",
"react-redux": "^8.0.2",
"redux-flipper": "^2.0.1",
"redux-flipper": "^2.0.2",
"yup": "^0.32.11"
},
"devDependencies": {
"@babel/core": "^7.18.2",
"@babel/runtime": "^7.18.3",
"@react-native-community/eslint-config": "^3.0.2",
"@types/jest": "^28.1.1",
"@types/react-native": "^0.67.8",
"@babel/core": "^7.18.10",
"@babel/runtime": "^7.18.9",
"@react-native-community/eslint-config": "^3.1.0",
"@types/jest": "^28.1.6",
"@types/react-native": "^0.69.5",
"@types/react-test-renderer": "^18.0.0",
"@typescript-eslint/eslint-plugin": "^5.27.1",
"@typescript-eslint/parser": "^5.27.1",
"babel-jest": "^28.1.1",
"@typescript-eslint/eslint-plugin": "^5.32.0",
"@typescript-eslint/parser": "^5.32.0",
"babel-jest": "^28.1.3",
"babel-plugin-module-resolver": "^4.1.0",
"eslint": "^8.17.0",
"jest": "^28.1.1",
"metro-react-native-babel-preset": "^0.71.0",
"react-native-flipper": "^0.146.1",
"eslint": "^8.21.0",
"jest": "^28.1.3",
"metro-react-native-babel-preset": "^0.72.0",
"react-native-flipper": "^0.157.0",
"react-native-svg-transformer": "^1.0.0",
"react-test-renderer": "18.1.0",
"typescript": "^4.7.3"
"react-test-renderer": "18.2.0",
"typescript": "^4.7.4"
},
"resolutions": {
"@types/react": "^17"
Expand Down