diff --git a/.env.development b/.env.development new file mode 100644 index 0000000..b240bab --- /dev/null +++ b/.env.development @@ -0,0 +1 @@ +API_URL=https://dev.myapi.com diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..1cf3bf5 --- /dev/null +++ b/.env.production @@ -0,0 +1 @@ +API_URL=https://prod.myapi.com diff --git a/.env.staging b/.env.staging new file mode 100644 index 0000000..cb0047e --- /dev/null +++ b/.env.staging @@ -0,0 +1 @@ +API_URL=https://stage.myapi.com diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e4bd6a9 --- /dev/null +++ b/.gitignore @@ -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/ diff --git a/README.md b/README.md index 993d5d0..5eee149 100644 --- a/README.md +++ b/README.md @@ -1,54 +1,132 @@ -# π Pineapple RN template + + +# π 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 Core branch + 1. Install dependencies & pods
-+2. Build a project +npm i && cd ios && pod install
+npm run setup
+
+-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:// iOS
+npm run ios
+ +// Android
+npm run android
npx react-native init AwesomeTSProject --template react-native-template-typescript
-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
+
+npm run setup
+
+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
+++ +# π Scripts + +### Start a Metro bundler +// iOS
+npm run ios
+ +// Android
+npm run android
+
+npm run start
+
+
+### Install dependencies and pods
+
+npm run setup
+
-# π Debug
+### Remove all packages and clear cache
+
+npm run reset
+
+
+### Run android
+> **π NOTE:** Build will be created with Debug configuration
+++ +### Create APK +// Development
+npm run android
+ +// Staging
+npm run android:staging
+ +// Production
+npm run android:production
+
++ +### Run iOS +> **π NOTE:** Build will be created with Debug configuration +// Staging
+npm run deploy-android:staging
+ +// Production
+npm run deploy-android:production
+
++ +# π 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) @@ -56,3 +134,23 @@ This template is integrated with [Flipper](https://fbflipper.com) to debug an ap - [π 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. diff --git a/package.json b/package.json index 22ddc8d..70c74a9 100644 --- a/package.json +++ b/package.json @@ -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"// Development
+npm run ios
+ +// Staging
+npm run ios:staging
+ +// Production
+npm run ios:production
+