This repository contains the code for the base mobile application.
The requirements are simple! You just need:
To start the server, first create a .env
file with all the environmental variables:
cp .env.example .env
nano .env # Or use your favorite text editor
Then, install the dependencies:
yarn install
Finally, run project:
expo start
If you are using wsl
, you need to start the project using tunneling (the expo
CLI will need to install @expo/ngrok
to manage the tunneling for you):
expo start --tunnel
Now, there are a couple ways you can use the app after starting the expo server. You can either install the Expo Go app in your phone and scan the QR code displayed after starting the expo
server (notice that your phone and your computer must be connected to the same network for this to work) or you can use an iOS or Android emulator.
There are some environmental variables that need to be added to the repository:
DEVELOPMENT_URL
: Defines the development URL of the app. This URL gets used when the app is running on development mode. Defaults tohttp://{local-machine-ip}:8000
, where{local-machine-ip}
corresponds to the IP on the local network of the machine that started theexpo
server. Warning: this may be useless towsl
users, given that the subsystem runs on a completely different network than the physical machines.GOOGLE_CLIENT_ID
: Required on production. This is the client ID of the Google project that allows logins of the users through Google.
There is an alias configured using babel
. This alias allows you to import something from the src
folder when you are deeply nested on another folder using @/MyComponent.jsx
instead of having to use ../../../../../../../../MyComponent.jsx
(@
is a shortcut to get to src
).
This project includes two linters, namely ESLint
and StyleLint
. The former lints the JavaScript code, while the latter lints the styling code. These linters will need to be passing throughout the whole development, and will be enforced by the CI pipeline. You will first need to install all the dependencies to run the tests. To achieve this, run:
yarn install --frozen-lockfile
This will install all the node_modules
without altering the yarn.lock
file. Finally, you can run the linters using the make
commands included:
make eslint
make stylelint
You can also format your code automagically using eslint
. To do this, just run:
make eslint!