This repo contains code for the AtB app, a travel assistant and ticketing app for public transportation and mobility in Norway. In addition to AtB in Trøndelag, the app is also used by FRAM (Møre og Romsdal), Reis Nordland and Svipper (Troms).
You can submit a new bug report or feature proposal by creating a new issue.
We love feedback and suggestions. The AtB app 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.
Note
For external contributors, we should set up default environment files to make it easier to run the app without access to git-crypt secrets and Firebase.
Since iOS development is only supported on MacOS, using MacOS for development is recommended. However, there are some workarounds to get the Android app running on Windows with WSL and Git Bash, that are documented in docs/WindowsSetup.md.
- See React Native: Set Up Your Environment
ⓘ When installing cocoapods, use
gem install cocoapods -v <version>
, where<version>
is the one listed at the bottom of Podfile.lock (COCOAPODS: 1.x.x
). - yarn v1.22 (Currently yarn 2.0 is not supported)
- git-crypt:
brew install git-crypt
on MacOS, andapt install git-crypt
on Linux. - Ruby v2.7: With something like rbenv
-
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
ⓘ Access token from jfrog has a one-year expiry
-
Install dependencies:
a. React Native:
yarn
b. Install Ruby dependencies
bundle install
c. Install ImageMagick
brew install imagemagick
-
Decrypt sensitive files
git-crypt unlock <path/to/key>
(Key given to internal members) -
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
-
From root folder run:
yarn setup dev <organization>
where organization is eitheratb
,fram
,nfk
ortroms
, to set root .env for local development and generate all icons and launch screens for iOS and Android. -
Run
yarn get_ios_certs
to install certificates.ⓘ 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.
- iOS: Run
yarn ios --list-devices
- Android: Run
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
withadb devices
. You may also need to use the commandadb -s <device-id> reverse tcp:8081 tcp:8081
to reverse the port needed for metro.
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
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.
Assets such as icons, logos, and illustrations are set up by running yarn setup
in the terminal. Assets will be outputted in ./assets/design-assets
and converted from SVGs to TypeScript React Native files.
When adding or changing assets in the design system, run setup again:
yarn setup dev <organization>
Then restart metro and clear cache:
yarn start --reset-cache
See the design system and @atb-as/generate-assets
for more details.
For test devices and developer devices we do continuous distribution through direct groups on AppCenter and Firebase App Distribution, which is built on commits to master. When a GitHub release is made, a new version is distributed to TestFlight and Google Play. More details on the release process can be found in the here.
Storybook for the app can be viewed in debug build of the app through the developer section 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.