UCL Assistant is a new and beautiful app to manage your student life at UCL!
You'll need the Expo XDE client or the Expo command line client. Get them from here. You'll also need Yarn or NPM installed.
Copy app.example.json
to app.json
and add your own Google Maps API key and
either modify or delete the Sentry sourcemap hook. Remember to update the APP_JSON env variable in Travis if you modify app.json
.
The Google Maps API key is optional but without it you won't be able to use Maps on Android. You'll want to create an API key on the Google APIs console and then give the key access to the Google Maps Android API.
Install the necessary dependencies with npm i
Then you can start the app with npm run start
. If you're using WSL, then you may need to set the RN packager host to your actual IP address instead of the WSL IP address using export REACT_NATIVE_PACKAGER_HOSTNAME=192.168.x.x
, or do port-forwarding over adb
debugging.
Source code for the UCL Assistant API Server is available here. It is hosted at ucl-assistant.uclapi.com
The app uses redux-persist to save the
app state to the device storage. In the future, for extra security, the user
reducer will be saved using the Expo.SecureStore
API.
Our git commit message template can be found here. We lint commit messages with commitlint. You can optionally use the interactive commit prompt (git add . -A && npm run commit
) to ensure your commit message complies with our commit message template.
Expo allows us to update the app seamlessly OTA. To publish the latest version of UCL Assistant over-the-air via Expo:
$ npm run publish
To build a APK/IPA, which will also publish the current version of UCL Assistant
$ npm run build
To upload the APK/IPA to the Play/App Store.
$ npm run upload
When uploading to the Play Store, there should be an android.json
containing the credentials for the service account in the project root folder. This is the credentials JSON file that can be obtained from the Google Developers Console (see android.example.json
).
When uploading to the App Store, there should be an ios.json
containing the credentials for the App Store Connect account (see ios.example.json
).
To manually publish:
expo publish --release-channel production-[VERSION CODE]
[VERSION CODE]
should follow semantic versioning, e.g. 2.0.0.
Similarly, to create a new app binary (when native code is modified, e.g. for an Expo SDK update)
expo build:android --release-channel production-[VERSION CODE]
expo build:ios --release-channel production-[VERSION CODE]
When updating APP_JSON
in Travis, use this format: "$(echo -e '
{JSON_CONTENT}
')"
or simply wrap it with single quotes
We use Jest for testing.
jest/test-utils.tsx
contains custom utility functions:
render
function that mocks our Redux store and navigation containerwaitForEventLoop
function that returns a Promise which returns only after the current async queue is completed
jest.useFakeTimers()
, which doesn't play well with setTimeout
or setInterval
. waitForEventLoop
therefore temporarily sets jest.useRealTimers()
before switching back to fake timers