Get Started (Setup environment)
- Nodejs: https://nodejs.org/en/
- Yarn (https://yarnpkg.com/lang/en/docs/install/#windows-stable)
- Java SDK 8: https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
- Visual Studio Code: https://code.visualstudio.com/Download
- Git SCM: https://git-scm.com/download/
- https://chocolatey.org (For Windows)
- Xcode, Android Studio: https://developer.android.com/studio/
- Setup ANDROID_HOME (c:\Users\YOUR_USERNAME\AppData\Local\Android\Sdk)
- Add platform-tools to Path (c:\Users\YOUR_USERNAME\AppData\Local\Android\Sdk\platform-tools)
- Setup JAVA_HOME (https://confluence.atlassian.com/doc/setting-the-java_home-variable-in-windows-8895.html)
Visual Studio Code Extensions:
- Auto Rename Tag: (Downloads: 1.1M)
- Bracket Pair Colorizer 2 (Donwloads: 66K)
- ES7 React/Redux/GraphQL/React-Native snippets (Downloads: 1.1M)
- React Native Tools (Downloads: 2.9M)
- Material Icon Theme (Downloads: 5M)
- One Dark Pro (Downloads: 7.8M)
- Debugger for Chrome (Downloads: 15.4M)
- Prettier (Downloads: 7.8M)
Stocks:
- All stocks: http://thestocks.im
- Font Icons: https://oblador.github.io/react-native-vector-icons
- Image Icons: https://www.flaticon.com
- Color: https://flatuicolors.com
- Face / Avatar: http://pravatar.cc
- Animatable (Animation): https://github.com/oblador/react-native-animatable
Videos:
- Videos: https://www.youtube.com/watch?v=kNHuLOXR5T0&list=PLWBrqglnjNl31S91FFE63DtuRc9v9LSGl
- Style Cheat Sheet https://github.com/vhpoet/react-native-styling-cheat-sheet
- FlexBox: https://www.youtube.com/watch?v=Y8zMYaD1bz0&list=PL4cUxeGkcC9i3FXJSUfmsNOx8E7u6UuhG
Session 01: Setup
- https://facebook.github.io/react-native/
- https://facebook.github.io/react-native/docs/getting-started
- Get started: Select tab: Building Projects with Native Code
- npm install -g react-native-cli
- Create new react native project: react-native init HelloWorldApp
- Component Examples: https://facebook.github.io/react-native/docs/tutorial
Session 02: Props
- Props: https://facebook.github.io/react-native/docs/props
- Type-Checking: https://reactjs.org/docs/typechecking-with-proptypes.html
- Install Package: https://www.npmjs.com/package/prop-types
Session 03: State
- https://reactjs.org/docs/state-and-lifecycle.html
- State: https://facebook.github.io/react-native/docs/state
- Handle Event within state: https://facebook.github.io/react-native/docs/handling-text-input
- TextInput ref: https://facebook.github.io/react-native/docs/textinput
Session 04: Styles & Layout
- Style: https://facebook.github.io/react-native/docs/style
- Height and Width: https://facebook.github.io/react-native/docs/height-and-width https://facebook.github.io/react-native/docs/dimensions
- Layout with Flexbox: https://facebook.github.io/react-native/docs/flexbox
- Package: React-Native-Vector-Icons: https://github.com/oblador/react-native-vector-icons
- Browse Icons: https://oblador.github.io/react-native-vector-icons/
- Face Stock: http://pravatar.cc/
- Stock: http://thestocks.im/
- https://github.com/vhpoet/react-native-styling-cheat-sheet
- https://github.com/react-native-community/react-native-linear-gradient
Session 05: Handling Events & ListView & Networking
- Handling Text Input: https://facebook.github.io/react-native/docs/handling-text-input
- Handling Touches: https://facebook.github.io/react-native/docs/handling-touches
- ScrollView: https://facebook.github.io/react-native/docs/using-a-scrollview
- ListView: https://facebook.github.io/react-native/docs/using-a-listview
- FlatList: https://facebook.github.io/react-native/docs/flatlist
- SectionList: https://facebook.github.io/react-native/docs/sectionlist
- Networking: https://facebook.github.io/react-native/docs/network
- Fetch API: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
- Axios Package: https://github.com/axios/axios
- JSON samples: https://jsonplaceholder.typicode.com/
- Download POSTMAN Tool: https://www.getpostman.com/postman
- UI + API Practices:
- https://softech.dev/api/training/users
+ Method: GET
- https://softech.dev/api/training/users/login
+ Method: POST
+ Body: {"email": "[email protected]", "password": "123"}
- https://softech.dev/api/training/users/register
+ Method: POST
+ Body: {"email": "[email protected]", "password": "123", "name": "Your Name"}
- Notes: POSTMAN: Method: POST, Body: Raw => JSON
- UI Practices: 13.1. https://github.com/react-native-community/react-native-linear-gradient 13.2. https://akveo.github.io/react-native-ui-kitten/#/home
Session 06: React Navigation
- Docs: https://reactnavigation.org
- Setup (Please carefully): https://reactnavigation.org/docs/en/getting-started.html
- StackNavigation
- TabNavigation
- DrawerNavigation
- SwitchNavigation
export default class App extends React.Component {
render() {
return <AppContainer />;
}
}
const AuthenticationNavigator = createStackNavigator({
SignIn: SignInScreen,
ForgotPassword: ForgotPasswordScreen
});
const AppNavigator = createSwitchNavigator({
Auth: AuthenticationNavigator,
Home: HomeScreen
});
const AppContainer = createAppContainer(AppNavigator);
Session 07: Firebase
- https://firebase.google.com/
- Register a Google account
- React Native Firebase: https://rnfirebase.io/
- Basic: http://invertase.link/get-started-basic
- Download sourcecode (ZIP)
- Unzip
- Install packages: Root project: type: npm install / yarn install
- Root project: type: npm run rename, project name: jobs, company name: softech
- Package name: com.softech.jobs
- Add Google Services files (plist & JSON):
- Login: https://console.firebase.google.com/ (email / password)
- Add firebase project: project name: softech - jobs
- Go to project dashboard
- Go to project setting: Project Overview -> Setting Icon -> Project settings
- Add mobile app: Your apps -> Select android app -> type package name: com.softech.jobs, app name: Softech Jobs -> Click Button [Register app]
- Download config file: Root project / android / app / google-services.json
- Run project: react-native run-android
Continue: README of this project
Cloud Filestore
- Dashboard -> Database -> Filestore
- Start in test mode -> Click button [Enable]
- https://rnfirebase.io/docs/v5.x.x/getting-started
- https://firebase.google.com/docs/firestore/manage-data/structure-data
- Cloud Firestore: https://firebase.google.com/docs/firestore/quickstart
- Query Data: https://firebase.google.com/docs/firestore/query-data/queries
- Get Data: https://firebase.google.com/docs/firestore/query-data/get-data
- Add / Update Data: https://firebase.google.com/docs/firestore/manage-data/add-data
- Delete Data: https://firebase.google.com/docs/firestore/manage-data/delete-data
- Realtime Update: https://firebase.google.com/docs/firestore/query-data/listen
Realtime
- Dashboard -> Database -> Realtime
- Rules: Set: read: true, write: true
Notification
- Token:
- Send:
- Project Settings -> Cloud Message
- POSTMAN: POST: https://fcm.googleapis.com/fcm/send
- HEADER (2 fields): Content-Type: application/json, Authorization: key:[Server Key]
- Body: https://firebase.google.com/docs/cloud-messaging/http-server-ref?authuser=0
{ "to": "dMIRpQFyq3M:APA91bHZyAnwiyJjGvhAqGSjbrrSxVcQvYJXZSTesnL_yYEeAvy4deRUbeaQxwQH_dPttfuDTPr0EPbYpH_L6uHjcFwDHT0fE79aSWmoLSlDDB0s0KToBMtZqKiO2FlscLjaLGrGUkZJ", "notification": { "body": "Chi tiet lich nghi HE 2019", "title": "THONG BAO NGHI HE", "content_available": false, "priority": "high", "sound": "default", "tag": "thongbao", "color": "#ff0099", "icon": "default" }, "data": { "bonus": "BAI TAP VE NHA" } }
Authentication
- Dashboard -> Authencation -> Sign-in Method -> Enable: Email / Password, Phone
- Docs: https://rnfirebase.io/docs/v5.x.x/auth/getting-started
- Refs: https://rnfirebase.io/docs/v5.x.x/auth/reference/auth
- Phone Authentication:
- Dashboard -> Authencation -> Sign-in Method -> Phone numbers for testing (optional)
- Get SHA-1 key: https://stackoverflow.com/questions/27609442/how-to-get-the-sha-1-fingerprint-certificate-in-android-studio-for-debug-mode
- Dashboard -> Project Settings -> General -> Select Android App -> Paste SHA-1
Cloud Function
- Setup firebase tools: npm install -g firebase-tools
- Login / Logout: firebase login
- Init project: firebase init => Choose Cloud Function => Choose Project => Choose Language => SELECT DEFAULT OPTIONS => DONE
- Hello Function: Uncomment
- Deploy: firebase deploy
- Test API
React Native With Firebase
- https://rnfirebase.io/
- Documents: https://rnfirebase.io/docs/v5.x.x/getting-started
- Starter Kit: https://rnfirebase.io/docs/v5.x.x/installation/basic-kit
- Manual install for Android (Video): https://youtu.be/_7iKm233n_M
- Manual install for iOS (Video): https://youtu.be/qiOGMcX6Xtw
- Send Notification (Google API): https://firebase.google.com/docs/cloud-messaging/http-server-ref
- Send a notification (Admin SDK - Cloud Function): https://firebase.google.com/docs/cloud-messaging/admin/send-messages
- Manage Topic: https://firebase.google.com/docs/cloud-messaging/admin/manage-topic-subscriptions
Session 08: React Component & Lifecycle
- Theory: https://reactjs.org/docs/react-component.html
- Diagram: http://projects.wojtekmaj.pl/react-lifecycle-methods-diagram/
- Examples:
Session 09: UI / UX
- react-native-paper
- react-native-elements
- native base
Session 10: REDUX & SAGA
- Theory: https://redux.js.org/introduction/getting-started
- Usage with React: https://react-redux.js.org
- Diagram: https://kuanhsuh.github.io/2017/09/28/What-s-Redux-and-how-to-use-it/
- Install packages: redux, react-redux,
- (npm install --save redux),
- (npm isntall --save react-redux),
- (npm isntall --save --dev redux-devtools-extension)
- Coding:
- types (constants)
- actions
- reducers
- components
- root reducers (store.js)
- store (store.js)
- App.js (config Provider with store)
- Debug:
- Download tool: https://github.com/jhen0409/react-native-debugger/releases
- redux-thunk
- Install: npm install --save redux-thunk
- Actions: PENDING, SUCCESS, ERROR
- Async Action (axios / fetch)
- Config middleware (store.js)
- redux-saga
- Install: npm install --save redux-saga / yarn add redux-saga
- sagas
- rootSagas
Session 11: Backend with Google Cloud Function
- Setup firebase tools:
- npm install -g firebase-tools
- yarn add global firebase-tools
- Login / Logout: firebase login / firebase logout
- Init project: (Project folder)
- Terminal: firebase init =>
- OPTIONS: => Choose Cloud Function =>
- OPTIONS: => Choose Project =>
- OPTION: => Choose Language => Javascript
- SELECT DEFAULTS
- OPTIONS => DONE
- Hello Function: Uncomment
- Deploy: firebase deploy
- Test API
Session 12: EXPRESSJS & MONGODB (BONUS)
- Expressjs: https://expressjs.com/en/starter/generator.html
- Basic Routing: https://expressjs.com/en/starter/basic-routing.html
- Routing: https://expressjs.com/en/guide/routing.html
- Mongodb: https://www.mongodb.com/download-center/community
- Tools: https://www.mongodb.com/download-center/compass
- Others: RoboMongo: https://robomongo.org/
- Nodejs Mongodb Driver: http://mongodb.github.io/node-mongodb-native/3.1/
- Databases with Express: https://expressjs.com/en/guide/database-integration.html
Session 13: Release
- Android icon: https://romannurik.github.io/AndroidAssetStudio/index.html
- iOs icon: https://appicon.co/
- https://facebook.github.io/react-native/docs/signed-apk-android
- https://play.google.com/apps/publish
Project:
- react-native-firebase
- rnfirebase.io
- react-navigation
- npm install --save react-navigation
- npm install --save react-native-gesture-handler
- react-native link react-native-gesture-handler
- react-native-vector-icons
- npm install --save react-native-vector-icons
- react-native link react-native-vector-icons
- redux-saga
- redux
- react-redux
- redux-saga
- UI: react-native-elements / react-native-paper / nativebase
- npm install react-native-elements --save
-
axios
-
Open File:
- Open Camera / Photos gallery
A. Some useful websites
References:
B. Expressjs
B.1 References:
- Offical Site: https://expressjs.com
- Install CLI tool: https://expressjs.com/en/starter/generator.html
- Basic Routing: https://expressjs.com/en/starter/basic-routing.html
- Run server forever: http://pm2.keymetrics.io/ (npm install pm2 -g)
- Nodemon is a utility that will monitor for any changes in your source and automatically restart your server. Perfect for development (https://nodemon.io)
B.2 Step by step:
- Install CLI
- Create a project with express tool
- Run project: npm start