Setup
Project-Specific Setup

Setting Up NativeExpress

This guide will walk you through the process of setting up NativeExpress, including cloning the project, installing dependencies, configuring your environment, setting up Supabase, and creating a development build with EAS for both iOS and Android.

Prerequisites

Before you begin, ensure you have the following installed on your system:

Setup Repository

Clone the Repository

First, clone the NativeExpress repository to your local machine:

git clone https://github.com/your-organization/nativeexpress.git
cd nativeexpress

Install Dependencies

Install the project dependencies using Yarn:

yarn install

Environment Configuration

  1. Copy the example environment file:
cp .env.example .env.local

Setup Supabase

Create a Supabase Project

Go to Supabase (opens in a new tab) and create a new project.

Copy the Supabase Project URL and Anon Key

Once your project is created, navigate to the project settings. Copy the project URL and anon key.

Add the Supabase Anon Key to your .env.local file

Add the Supabase Anon Key and URL to your .env.local file:

# SUPABASE
EXPO_PUBLIC_SUPABASE_URL="<your-supabase-url>"
EXPO_PUBLIC_SUPABASE_ANON_KEY="<your-supabase-anon>"

Run the Development Server

Create Apple Bundle Identifier and App Store App

Go to your Apple Developer Account (opens in a new tab). Navigate to Identifiers and create a new App ID with your desired bundle identifier (e.g., com.yourcompany.nativeexpress).

Enter your App ID in your config.js file

Add your App ID to your config.js file, also add your app name and slug:

const config = {
    ...
    general: {
        ...
        appName: 'Native Express', // TODO: replace with your app name
        slug: 'native-express', // TODO: replace with your app slug
        iosBundleIdentifier:  '<your-bundle-identifier>', // TODO: Enter your bundle identifier
        ...
    },
    ...
};
 
### Create a prebuild for iOS
Run the following command in your terminal (remove the `--platform` flag if you want to build for both platforms):
```bash
npx expo prebuild --platform ios

Install Pods

Run the following command in your terminal:

cd ios && pod install

Create a development build for iOS

Run the following command in your terminal:

npx expo run:ios

Start the development server

You can now start and ran the app on the simulator any time you want Run the following command in your terminal:

npx expo start -d

You are now ready to explore the other features of NativeExpress and start building your application!

Database Setup

When you first set up your app, the database will be empty. If you want to populate it with example data and apply initial migrations, you'll need to set up the database. If you prefer to start with an empty database, you can skip this step.

💡

For more detailed information about database management, please refer to the Database Guide.

Run Database Migrations and Seed Data

To initialize your database with migrations and seed data, use one of the following commands in your terminal:

For a linked Supabase project:

supabase db reset --linked

This command will reset your database, apply all migrations, and run the seed.sql file for the linked project.

For a local Supabase project:

supabase db reset

If you're using a local setup, make sure to adjust your .env.local file to connect with the local database before running this command.