Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

coral-fan/coral-monorepo

Repository files navigation

Coral Monorepo

Monorepo managed with Yarn Workspaces. Web application written in TypeScript and built with React, Emotion, and Next.js. UI components developed in and documented using Storybook. Authentication and database handled by Firebase and application deployed to Vercel.

Setup

Please first make sure you have Yarn Classic installed. To set up the project, run the following commands below:

git clone https://github.com/Coral-Music/coral-monorepo.git
cd coral-monorepo
yarn install

npm i -g firebase-tools
# please make sure you've been added to the firebase project before proceeding with this step
firebase login

Next, go to the Firebase Console and go to Project Settings as below: image

Inside of Project Settings, navigate to the Service Accounts tab, and click the Generate new private key. image

Take the JSON data from this file and add it to .local.env in the app workspace.

NOTE: Please DO NOT save this file anywhere inside the coral-monorepo directory.

Please also go the General tab in the same view on the Firebase dashboard and copy the values under SDK setup and configuration in the Your apps section, convert it to JSON and add it to .local.env in the app workspace.

You can find more instructions & details regarding environment variable details in the app Workspace README.

Local Mobile Device Testing

To test mobile devices locally, please install ngrok from https://ngrok.com/download.

Then add a ngrok.yaml file with the configuration below:

authtoken: <YOUR_NGROK_AUTH_TOKEN>
tunnels:
  web:
    addr: 3000
    proto: http
    hostname: coral.ngrok.io
version: 2
region: us

Please note that any values surrounded by < > and are placeholder values, and must be filled in with the actual value.

you can get your authtoken from https://dashboard.ngrok.com/get-started/your-authtoken.

Available Scripts

In the project directory, you can run:

yarn <WORKSPACE_NAME>

Which is shorthand for yarn workspace <WORKSPACE_NAME>. Using this script, you can run arbitrary scripts for each respective workspace:

Example:

yarn <WORKSPACE_NAME> start

Available Workspaces

yarn start:tunnel

Starts a tunnel from your local development environment to coral.ngrok.io.

NOTE: Please run yarn app start before running this script.