- Local Development
- Platform-Specific Setup
- Testing on browsers in simulators and emulators
- Running The Tests
- Debugging
- Application Philosophy
- API Details
- Contributing to Expensify
- Expensify Code of Conduct
- Contributor License Agreement
- React StrictMode
- Left Hand Navigation(LHN)
- HybridApp - additional info & troubleshooting
These instructions should get you set up ready to work on New Expensify 🙌
- Install
nvm
thennode
&npm
:brew install nvm && nvm install
- Install
watchman
:brew install watchman
- Install dependencies:
npm install
- Run the specific platform with the following command:
npm run <platform>
, e.g.npm run web
You can use any IDE or code editing tool for developing on any platform. Use your favorite!
In order to have more consistent builds, we use a strict node
and npm
version as defined in the package.json
engines
field and .nvmrc
file. npm install
will fail if you do not use the version defined, so it is recommended to install node
via nvm
for easy node version management. Automatic node
version switching can be installed for zsh
or bash
using nvm
.
For detailed setup instructions for each platform, see the following guides:
- 🕸 Web Development: Web Setup Instructions
- 📱 iOS Development: iOS Setup Instructions
- 🤖 Android Development: Android Setup Instructions
- 🖥 Desktop Development: Desktop Setup Instructions
- If you are having issues with Getting Started, please reference React Native's Documentation
- If you are running into CORS errors like (in the browser dev console)
You probably have a misconfigured
Access to fetch at 'https://www.expensify.com/api/BeginSignIn' from origin 'http://localhost:8080' has been blocked by CORS policy
.env
file - remove it (rm .env
) and try again
Note: Expensify engineers that will be testing with the API in your local dev environment please refer to these additional instructions.
Creating an .env
file is not necessary. We advise external contributors against it. It can lead to errors when
variables referenced here get updated since your local .env
file is ignored.
NEW_EXPENSIFY_URL
- The root URL used for the websiteSECURE_EXPENSIFY_URL
- The URL used to hit the Expensify secure APIEXPENSIFY_URL
- The URL used to hit the Expensify APIEXPENSIFY_PARTNER_NAME
- Constant used for the app when authenticating.EXPENSIFY_PARTNER_PASSWORD
- Another constant used for the app when authenticating. (This is OK to be public)PUSHER_APP_KEY
- Key used to authenticate with Pusher.comSECURE_NGROK_URL
- Secure URL used forngrok
when testingNGROK_URL
- URL used forngrok
when testingUSE_NGROK
- Flag to turnngrok
testing on or offUSE_WDYR
- Flag to turnWhy Did You Render
testing on or offUSE_WEB_PROXY
⚠️ - Used in web/desktop development, it starts a server along the local development server to proxy requests to the backend. External contributors should set this totrue
otherwise they'll have CORS errors. If you don't want to start the proxy server set this explicitly tofalse
CAPTURE_METRICS
(optional) - Set this totrue
to capture performance metrics and see them in Flipper see PERFORMANCE.md for more informationONYX_METRICS
(optional) - Set this totrue
to capture even more performance metrics and see them in Flipper see React-Native-Onyx#benchmarks for more informationE2E_TESTING
(optional) - This needs to be set totrue
when running the e2e tests for performance regression testing. This happens usually automatically, read this for more information
If your changes to .env aren't having an effect, try
rm -rf .rock
, then re-runnpm run ios
ornpm run android
Unit tests are valuable when you want to test one component. They should be short, fast, and ideally only test one thing. Often times in order to write a unit test, you may need to mock data, a component, or library. We use the library Jest to help run our Unit tests.
- To run the Jest unit tests:
npm run test
- UI tests guidelines can be found here
We use Reassure for monitoring performance regression. More detailed information can be found here: