Warning
This is still experimental and is not the app that's currently live on app stores.
Gumroad is an e-commerce platform that enables creators to sell products directly to consumers. This repository contains source code for an upcoming rewrite of the Gumroad mobile application, built with Expo.
In development this application is intended to connect to a local Gumroad development instance. You will need to set up and run the Gumroad web application locally alongside this application.
- https://nodejs.org/en/download
- Install the version listed in the .node-version file
The application will run on an emulator or device, which you will need to set up via Android Studio or Xcode. Download and install at least one, and follow the instructions to create at least one virtual device (Android) or simulator (iOS).
Since Android emulators don't forward to the host machine's localhost, you will need to edit the hosts file on an emulator with root access to make our https://gumroad.dev development domain work.
-
Create a new Android Virtual Device (AVD) with a "Google APIs" system image (NOT the default "Google Play"):
- In Android Studio, go to
Tools > Device Manager. - Click
Create Virtual Device. - Select any device definition.
- Under
System Image, go to theARM Imagestab and select an image with a "Target" that looks likeAndroid X.X (Google APIs). - Click
Nextand thenFinish.
- In Android Studio, go to
-
Find your AVD's name by running
emulator -list-avds. -
Start the AVD with a writable file system. You will need to run this every time you start the emulator, it won't work if Expo starts it for you.
emulator -avd your-avd-name -writable-system
-
Add entries to
hostsso thatgumroad.devresolves to the host machine's IP address instead of localhost:adb root adb remount adb shell "echo '10.0.2.2 gumroad.dev' >> /etc/hosts; echo '10.0.2.2 api.gumroad.dev' >> /etc/hosts; echo '10.0.2.2 app.gumroad.dev' >> /etc/hosts; echo '10.0.2.2 minio.gumroad.dev' >> /etc/hosts"
You should now be able to load https://gumroad.dev in your browser. Once that works, you can run the app on the emulator.
-
Install dependencies
npm install
-
Make sure you have Gumroad running locally with the latest seed data (
rails db:seed). -
Start the app. Run one of:
npm run android # run this only AFTER starting the rooted emulator as described above npm run ios
The app will run without any custom credentials, but can be configured using environment variables. You can override any of the default values in .env with a .env.local file.
E2E tests use Maestro. To run the tests:
-
Install Maestro:
curl -fsSL "https://get.maestro.mobile.dev" | bash
-
Ensure you have the app running in either an iOS simulator or Android emulator.
-
Ensure you have Gumroad running locally with the latest seed data (
rails db:seed). -
Run a test file:
npm run e2e:ios .maestro/<test>.yaml npm run e2e:android .maestro/<test>.yaml
Unit tests use Jest. To run the tests, use npm run test.