This is the the cross-platform mobile app for Bitcamp's hackathon, which is built using React Native and Expo. It provides hackers with up-to-date schedule information, custom QR codes, event notifications, and more.
- Install node.js and git
- Install yarn
- Globally install expo-cli
- Optionally create an expo account, and download the expo mobile app so you can run the app on your mobile device
- Clone the repository using
git clone https://github.com/bitcamp/mobile-app.git
(or using an SSH key, if you know how) - Download the dependencies using
yarn install
- Run the app using
expo start
oryarn start
Since our project uses Expo, all of our dependency versions must be Expo-compatible. To download the correct version of dependencies, you should use the expo install <name of package>
instead of yarn add <name of package>
.
Our package.json
file exports many useful developmentscripts:
yarn start
: Starts the expo development environment and the metro bundler.yarn android
: Althernative toyarn start
, which starts expo and also automatically builds the Android.apk
on the active Android emulator or device.yarn iOS
: Same asyarn android
, but for iOS. Only works if you have a Mac. If you have a physical iOS device, you can still use the expo mobile app to preview the app live.yarn lint
: Reports style errors in your code using ESLint.yarn lint:fix
: Reports style errors in your code using ESLint, and fixes all auto-fixable errors.
Our project uses ESLint to enforce style and formatting rules. To get automatic linting working (so your text editor automatically lints on save), follow these steps:
- Download the ESLint extension for VSCode
- Create a workspace configuration file at the root of your project (it should be called in
.vscode/settings.json
) - Copy the following settings into your config file
{
// Set up yarn as the default package manager
"eslint.packageManager": "yarn",
// Run eslint fix on save
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
// Don't apply prettier on any of the following files (eslint will take care of formatting since we use `eslint-plugin-prettier`)
"prettier.disableLanguages": ["js", "jsx"]
}
- Reload VSCode and start linting 😄
To manually lint, use yarn lint
and yarn lint:fix
from the command line.
We follow the GitHub flow for managing this repository, which means that each new feature gets a branch off of master. After you've assigned yourself to an issue to work on, do the following to setup your local git environment:
- To make a new branch off of master, run
$ git checkout master
$ git checkout -b <descriptive-branch-name>
- Add commits using descriptive commit messages
- Push your new branch to the repository
- Submit a merge request on GitHub when your feature is ready for review
Here are some common development questions
- How do I pull down new changes from master into a local branch?
$ git pull origin master
-
I got an Expo error about using a LAN URL. How do I fix that?
- Instead of running
yarn start
, runyarn start --tunnel
[here's the Stack Overflow page for reference]
- Instead of running
-
I got an error saying
Task :app:transformNativeLibsWithMergeJniLibsForDebug FAILED
. How do I fix that?- Just run
yarn android
again, which usually fixes the error.
- Just run