Skip to content

Getting Started

Jacob Smith edited this page Jan 12, 2021 · 12 revisions

Welcome to the getting started guide. This app runs on Firebase, a suite of software tools created by Google that work to help you quickly build web and mobile apps. Eventually, you'll have to configure a Firebase project but this page will just cover the basics.

Before starting, make sure you have this repository cloned locally 💻

1. Node & npm

First, you'll have to make sure you have node v12 and npm installed correctly. If not installed, we recommend the following steps to getting them set up.

  1. Install Node Version Manager (NVM)
  2. Install Node and npm using NVM

Although these instructions use npm, yarn can also be used if desired.

2. Dependency Installation

You can install all dependencies in one go using the following command.

npm run bootstrap

This runs npm install in the root the repository and the app, functions and native-audio folders. It also symlinks shared to app/shared, functions/shared and scripts/shared.

⚠️⚠️⚠️ Are you using Windows? ⚠️⚠️⚠️ You will have issues with the symlinks I use to share code between packages. If this happens to you and you're stuck, feel free to file an issue.

We install firebase-tools during this process. This Firebase CLI will be used in future steps so definitely check out the documentation.

3. Google Cloud CLI Installation

Next, install the gcloud and the gsutil Google Cloud CLI utilities. You'll use these to configure Google Cloud Storage settings.

curl https://sdk.cloud.google.com | bash
exec -l $SHELL

See the official gsutil installation documentation here.

4. Sentry (Optional)

If you want to turn on Sentry, sign up for an account, create your own project and then retrieve your project's DSN value. For now, just save this value :)

5. Send Grid

Send Grid is an email service that Relar uses to send emails to users. You will need an API key to get the sign up system to work. Here is some documentation that explains how to get an API key.

6. Firebase Project Configuration

At this point in the setup guide, you need to configure your app to point toward a Firebase project. If you want to get access to Relar's staging environment for local development, you can email me at jsmith@hey.com. Alternative, follow the Firebase Setup to configure your own project.

Once you have the API key,

7. Building

To get things deployed, you'll have to build them first. Run the following set of commands to build the functions, native-audio and app folders.

# in native-audio/
npm run build

# in functions/
npm run build

# in app/
npm run build:web-production

Note that this builds the web app for production. Another section below will detail how to build the mobile app.

8. Firebase CLI Login

You'll have to login using the same Google account that you created your project under before you can deploy anything.

npx firebase-tools login

9. Deployment

This is the last step, hooray!! Just run the deploy command with the correct project ID.

# <PROJECT_ID> should be replaced with the value you just copied
npx firebase-tools deploy --project <PROJECT_ID>

If everything goes well, Relar should be running at https://<PROJECT_ID>.web.app.

Even for local development, the web & mobile apps depend Firebase for authentication, data storage and media storage. If you want to help develop features and/or fix bugs, let me know and I can pass along the Firebase configuration. Alternatively, you can create your own Firebase project.

Clone this wiki locally