This repo contains documentation and code for the AtB app with travel assistance and ticketing.
Read more on AtB development, blogposts and projects at the AtBeta page and blog.
You can submit a new bug report or feature proposal by creating a new issue.
We love feedback and suggestions. The AtB app and service is continously improved over time by working with users and observing real usage. If you have any issues or suggestions for improvement we would also love Pull Requests. See our contribution guide.
- See React Native: setting up the development environment. (Click the
React Native CLI Quickstart
tab) - yarn (https://yarnpkg.com/getting-started/install). Currently yarn 2.0 not supported, install
v1.22.0
or similar - git-crypt: MacOS:
brew install git-crypt
, Linux:apt install git-crypt
, Windows: Use WSL terminal on Windows file system and follow Linux steps - Ruby 2.7.6: Windows: Install Ruby and add
C:\Ruby27-x64\bin
(or similar) to PATH.
🪟 Windows users: use Git Bash to run .sh scripts
-
Setup Entur private registry in
.npmrc
andgradle.properties
.a. Get access to Entur jfrog registry (https://entur2.jfrog.io/) for your mittatb account
b. Create an identity token for your jfrog user in jfrog user setting
c. Run this script:
⚠ Make sure to run this only once. This script appends to the token files and does not overwrite its contents.
ENTUR_REGISTRY_USER=<USER_EMAIL> ENTUR_REGISTRY_TOKEN=<IDENTITY_TOKEN> ./scripts/add-entur-private-registry.sh
Note: Access token from jfrog has a one-year expiry
-
Install dependencies:
a. React Native:
yarn
b. Install Ruby dependencies
bundle install
🪟 Windows users: install ImageMagick and check
Install legacy utilities (e.g. convert)
during the installation. AddC:\Program Files\ImageMagick-7.1.1-Q16-HDRI
(or similar) to PATHc. Install ImageMagick
brew install imagemagick
🪟 Windows users: run in WSL (Windows Subsystem for Linux).
- Decrypt sensitive files
git-crypt unlock <path/to/key>
(Key given to internal members)
🪟 Windows users: skip this step
-
Install iOS Pods:
a. Mapbox v6 requires token for installing dependencies. This means you need to set proper auth on curl for MapBox API.
git-crypt
should decrypt a.netrc
file in root. You can copy this to set user info:cp .netrc ~/
b. Pod install:
cd ios/
andpod install
🪟 Windows users: run in Git Bash
- From root folder run:
yarn setup dev <organization>
where organization is eitheratb
ornfk
, to set root .env for local development and generate all icons and launch screens for iOS and Android
🪟 Windows users: skip this step
- Run
yarn get_ios_certs
to install certificates. NOTE: In order to be able to set up this step you must have access to the certificates's repo for the organization you are working on.
For external contributors, we need to fix #35 before they are able to run the app.
- iOS:
yarn ios
You may select which simulator/device the application will be deployed on in xcode.
- Android:
yarn android
You may select which device/emulator to use from Android Studio. You may also use Android Debug Bridge (adb).
When deploying on device you should check that the device is listed as device
with adb devices
. You may also need to use the command adb -s <device-id> reverse tcp:8081 tcp:8081
to reverse the port needed for metro.
Assets such as icons, logos, and illustrations are copied into the static folder of the application when the application in build time.
For development assets can be copied manually by running yarn setup dev atb
in the terminal. This is also triggered on CIs.
When adding or changing assets in the design system, run setup again:
# Example
yarn setup dev atb
See @atb-as/generate-assets
in design system for more details. Assets will be outputted in ./assets/design-assets
and converted from SVGs to TypeScript React Native files.
Scripts for developing for and building the app do not support Windows natively. Expect to run into issues when using Windows.
Using Git Bash
and WSL
it is possible to work around these issues. These steps are tagged in the setup with the 🪟 Windows users
tag.
By following React Native Guide you can get an error saying ANDROID_SDK_ROOT is undefined. Set this in addition to your bashrc (or similar), such as:
export ANDROID_SDK_ROOT=$HOME/Library/Android/sdk
You may also add relevant tools to your path:
export PATH=$PATH:$ANDROID_HOME/emulator │ at NavigationContainerInner (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=no.mittatb.debug&modulesOnly=false&runModule=true:145129:26)
export PATH=$PATH:$ANDROID_HOME/platform-tools
You might have Command Line Tools set without Xcode (eg. when using homebrew without xcode). Change Command Line Tool to Xcode:
sudo xcode-select -s /Applications/Xcode.app
With errors:
...
error: /mittatb-app/ios/Pods/Target Support Files/Pods-atb/Pods-atb.debug.xcconfig: unable to open file (in target "atb" in project "atb") (in target 'atb' from project 'atb')
...
You might be missing iOS dependencies (Cocopods). See dependency step in Starting locally.
Some steps may fail when building on an Apple Silicon Mac. We got it building on a Macbook pro M1 by doing a few extra steps:
Open finder, navigate to Applications, right click xcode and select "get info", tick checkbox "Open using Rosetta".
Open finder, navigate to Applications/Utilities , right click Terminal and select "get info", tick checkbox "Open using Rosetta". Restart your terminals.
Run sudo gem install ffi -- --enable-system-libffi
Running yarn ios
should now build and start the app in the ios simulator.
For test devices and developer devices we do continuous distribution through direct groups on AppCenter. For an internal alpha version release we do periodic deploy through syncing the alpha-release
branch which distributes the build to TestFlight/Google Play Alpha-channel.
gh
(Github CLI): https://cli.github.com/bash
😬
yarn release-draft
(from project root, onmaster
)- Revise and review PR on Github, making sure all checks pass.
This will eventually (after review in the Stores) distribute a new app version. See more details.
Before distributing a new app version to the alpha-release
channels, we have to QA the new features and fixes.
Specific notes on QA:
Storybook for the app can be enabled in the developer menu in 'My profile'.
When adding or removing stories, the command yarn storybook-generate
must be used to update the references in the storybook.requires.js
file.
See documentation on setting up other environments.
yarn unimported
The contents of this repository is licensed as EUPL-1.2. See RFC.