Before you can build this project, you must install and configure the following dependencies on your machine:
We use Expo to build our React Native application. Assuming that you have Node installed, you can use npm to install the Expo CLI command line interface:
npm install -g expo-cli
After cloning the cp18-daimler-app
repository, you should run the following command to install development tools. You will only need to run this command when dependencies change in package.json.
npm install
Run the following command to start a development server for you.
npm start
The previous command sets up a development server on your local machine on port 19002. It is therefore accessible at http://localhost:19002/.
On the left side you should be able to find a menu including the following two options:
In order to emulate the app with the Android emulator, the following steps are required.
Note: Steps 2-9 need to be setup just once.
Tools
> SDK Manager
. In the left menu select System Settings
and choose Android SDK
.Android 8.1 (Oreo)
(API Level 27) SDK.Tools
> AVD Manager
.Create Virtual Device...
.Next
.Android 8.1 (Oreo)
(API Level 27) SDK as the system image.Next
and right after Finish
to create the virtual device.Actions
column.Once the build process of the AVD is finished, we are able to emulate our app on the AVD.
To run the app on the android emulator click on Run on Android device/emulator
.
Alternatively you can run from the command line:
npm run android
R
key twice⌘M
Assuming you already installed Xcode and the Command Line Tools for Xcode, click on Run on iOS simulator
.
Alternatively you can run from the command line:
npm run ios
⌘R
⌘D
Unit tests are run by Jest and written with Jasmine. They're located in the directory __tests__
. To launch your application's tests, run:
npm test
There is a UX prototype created with Adobe XD available at: https://xd.adobe.com/view/14c325be-f3ab-4e9d-4db2-59cd61a8cd00-62f2/?fullscreen
The master
branch is protected and only approved pull requests can push to it. Most important part of
the workflow is rebase
, here is a refresher on merging vs rebasing: https://www.atlassian.com/git/tutorials/merging-vs-rebasing.
How do I push changes to the master
branch?
master
with git checkout master
master
with git pull --rebase
(ALWAYS use rebase
when pulling!)master
with git checkout -b cs/new-feature
(where 'cs/' is your own name/abbreviation)git push --set-upstream origin cs/new-feature
(where 'cs/' is your own name/abbreviation)git pull origin master --rebase
(AGAIN use--rebase
)git push origin head --force
)Try to keep pull requests small (not 100+ files changed), so they are easier to review. Rather create a bunch of pull requests than one big.
ESLint with Airbnb style is used for formatting and linting.
To run ESLint and show all violations and problems, execute:
npm run lint
For trying to autofix the occuring violations and problems, execute:
npm run lint-fix