Skip to content

Latest commit

 

History

History
59 lines (42 loc) · 4.12 KB

README.md

File metadata and controls

59 lines (42 loc) · 4.12 KB

Getting started

Copy this repository template

1. Click "Use this template"

2. Click Create new repository

3. Include all branches

4. Give your repository a name

6. Click "Create repository"

7. Checkout your repository

Install global dependencies

  • Github CLI - brew install gh - Used for managing secrets and variables in Github actions
  • Google cloud SDK - brew install --cask google-cloud-sdk - Used to setup projects on GCP.
    • Make sure the SDK is up to date by running gcloud components update
  • Terraform brew install terraform - Used to manage infrastructure as code

Setup GCP

  • npm install
  • npx fvst infra init - This CLI script will guide you through setting up the infrastructure on GCP.
    • You have to set up a billing account - follow the tutorial at https://cloud.google.com/billing/docs/how-to/create-billing-account - this step asks for a credit card, but GCP will not charge the account when the free trial runs out.
    • This step will take some time, it will create 2 projects (staging/production), build docker containers and deploy them.
  • Setup a clerk.com account following the tutorial at Setup Clerk application
    • You should have one account for staging and one account for production
  • Wait for the npx fvst infra init script and the workflow it starts on GitHub actions to finish
    • The workflow will fail - we're unsure why it fails, it seems like GCP IAM policy is not applied on the first run.
    • This is ok, we still need to configure the secrets for Clerk
  • npx fvst infra setup-secrets staging - This scripts updates the secret values for the staging environment, you should do the same for production.
  • Rerun the failed jobs from the Github Actions workflow
  • Open https://console.cloud.google.com/welcome/
    • Choose one of the projects created from the top
    • Choose Cloud run from the navigation menu on the left
    • You should be greeted with the following screen

Setup local development

  • npx fvst dev init - This scripts loads the secret values from staging and populates the .env files with them for local development
  • docker compose up - Brings up postgres & redis
  • npm run dev - brings up all applications
  • Go to http://localhost:3000/ and you should be greeted with the following screen