Let's guide you through setting up the project locally, to deploy and test Amigos! Note that our app is built to run on iOS devices / iOS simulator, hence you will need a MacBook to run this app.
Before you begin, ensure you have the following installed:
- Node.js:
- We recommend using the latest LTS version. You can download this from nodejs.org.
- This will also install
npm.
- Homebrew: In your terminal, run:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - Git: In your terminal, run:
brew install git
- Expo CLI: In your terminal, run:
npm install -g expo-cli
- Xcode (iOS Simulator):
- Download Xcode from the Mac App Store.
- Once installed, launch Xcode so that it can complete its first launch and finish its initial setup.
- When prompted, select iOS under Platform Support to ensure that you download the iOS Simulator.
- Alternatively, download it from: Xcode > Settings > Components > Platform Support.
-
Clone the repository: Open your terminal and navigate to the directory where you want to store the project. Then run:
git clone https://github.com/reynabxr/Amigos.git cd Amigos -
Install dependencies: In the Amigos directory, run:
npm install
-
Create a Firebase Project:
- Go to Firebase Console.
- Click Create a Firebase Project and follow the prompts to create a new project.
-
Add a Web App:
- In your Firebase project dashboard, click the Web icon (
</>) to add a new web app. - Enter an app nickname.
- Skip the "Set up Firebase Hosting" step.
- In your Firebase project dashboard, click the Web icon (
-
Get Your Firebase Config:
- After registering your app, you’ll see the Firebase SDK snippet.
- Select the
npmtab. - Copy the values from the
firebaseConfigobject (e.g.,apiKey,authDomain, etc.).
-
Set Up Your Environment Variables:
- In your project root, copy
.env.exampleto.env:cp .env.example .env
- Paste the values you copied from Firebase into your
.envfile, matching the format given in .env.example.
- In your project root, copy
-
Create a Foursquare Developer Account:
- Go to Foursquare Developers and sign up for a new account or log in.
-
Find Your Bearer Token:
- Visit the Foursquare Places API Reference.
- At the top right of the page under Credentials, you’ll see your Bearer token.
- Copy the entire key.
-
Set Up Your Foursquare Config:
- In your project, copy
foursquareConfig.example.tstofoursquareConfig.ts.cp services/foursquareConfig.example.ts services/foursquareConfig.ts
- Open
foursquareConfig.tsand paste your Bearer token, including theBearerprefix.
- In your project, copy
-
Start the development server: In the Amigos directory, run:
npm start
-
Open the iOS simulator:
- Press
ito open the iOS simulator and run the app.
- Press
-
Connect your iPhone to Xcode:
- Navigate to Settings > Privacy & Security > Developer Mode > Enable. You will be prompted to restart your device and confirm the activation.
- Plug your iPhone into your MacBook and click "Trust" when prompted.
- Open Xcode > Window > Devices and Simulators > Devices, and ensure that your device is connected.
-
Link your Apple ID to Xcode:
- Open Xcode > Settings > Accounts and add your Apple Account (click the + button) if it's not already there.
- In Finder, navigate to Amigos > ios and double-click the
Amigos.xcworkspacefile to open it in Xcode. - In Xcode, select "Amigos" in the left sidebar.
- Go to Targets > Signing & Capabilities and set Team to your Apple ID (Personal Team).
- Make sure "Automatically manage signing" is checked.
-
Start the development server: In the Amigos directory, run:
npx expo run:ios --device
-
Select your device:
- When prompted, select your iPhone from the list (it should be the first one).
- Press Enter and wait for the app to build and install on your device.
-
Trust the Developer Certificate:
- On your iPhone, go to Settings > General > VPN & Device Management.
- Under Developer App, click into your Apple ID.
- Tap "Trust" and confirm.
-
Run the App:
- The Amigos app should now launch automatically on your iPhone.
- If not, find the app icon on your home screen and tap to open.