Installation

How to run and build Supersaas Mobile App

Prerequisites

Getting Started

1. Clone the repository

git clone https://github.com/SupersaasHQ/essentials-mobile.git

2. Install dependencies

Make sure to install the dependencies:

pnpm install

3. Install Expo CLI

npm install -g expo-cli

3. Setup the environment variables

cp .env.example .env

Then update the value of EXPO_PUBLIC_API_URL in the .env file with your Supersaas backend URL.

4. Generate the native code

npx expo prebuild --clean

Generates native Android and iOS directories using Prebuild.

Note: You need to run pre-build if you add a new native dependency to your project or change the project configuration in Expo app config (app.config.ts), The --clean flag is optional but recommended to remove the stale native project directories.

6. Run the app using Expo Go

 npx expo start

After that, you will see the QR code on your terminal.

If you are using an Android device, you can just press a to run the app on your device.

If you are using an iOS device, you can just press i to run the app on your device.

If you are using a simulator, you can just press s to run the app on your simulator.

Or you can scan the QR code with your device to connect to the app.

If you have any issues/doubts, please check the expo setup guide.

7. How to build and the app using development build

Connect your iPhone/Android device and run the following command to install the app on your device.

## iOS
npx expo run:ios -d

## Android
npx expo run:android -d

You need to have an Apple Developer account to run the app on your iPhone. Please refer this link to setup the Apple Developer account.

8. How to install the packages

Please always to install the packages using the command npx expo install package-name instead of pnpm install package-name.

This is crucial for native dependencies because the expo will automatically install the correct compatible version while pnpm/yarn/npm will install the latest version which may or maynot be compatible.

9. How to run the linting and formatting

pnpm lint

10. How to test the app

pnpm test

Notes:

  • Expo supports building the app for web as well, but we don't have that setup in this project.