CAVEAT April 6, 2023 - These instructions only include the setup for the Firestore side of our instances, and not the Supabase side. I would generally discourage trying to spin up your own instance unless you’re very familiar with Supabase and Firebase and NextJS.
[x] Create a new Firebase project in the UI, from [email protected]
[x] Create thereomone
git branch
firestore.rules
/common/envs
/common/envs/constants.ts
/functions/.env
with NEXT_PUBLIC_FIREBASE_ENV=SUPERSYNC
Deploy Firebase config
[x] $ firebase use mantic-markets
to select the main project
[x] firebase firestore:indexes > firestore.indexes.json
to copy indexes
[x] Copy secrets (Mailgun & Stripe keys) from main project
firebase functions:secrets:access MAILGUN_KEY
firebase functions:secrets:access STRIPE_APIKEY
firebase functions:secrets:access STRIPE_WEBHOOKSECRET
[x] $ firebase use <PROJECT_ID>
to select the new Firebase project
Set the secrets on the new project:
firebase functions:secrets:set MAILGUN_KEY
firebase functions:secrets:set STRIPE_APIKEY
firebase functions:secrets:set STRIPE_WEBHOOKSECRET
[ ] $ firebase deploy
to deploy:
Note: this will take a while. Also, it may fail the first couple times due to slow permission propagation, just rerun firebase deploy
[ ] Copy over the functionEndpoints
into the new config file
Get it working locally
package.json
$ firebase deploy --only firestore:rules
to redeploy security rulesSet up subdomain theoremone.manifold.markets
:
theoremone
git branchNEXT_PUBLIC_FIREBASE_ENV
; VALUE: THEOREMONE
)Stuck on deploying functions:
firebase deploy --only functions
gives:Error: An unexpected error has occurred.
firebase functions:delete createmarket
TypeError: Cannot read properties of undefined (reading 'service')
Okay now: something else is broken
So cors broken?
Or is it Uncaught (in promise) FirebaseError: Missing or insufficient permissions.
Hm, the equivalent ones on Prod aren’t authenticated!!
Okay done here:
NOT_FOUND:
Not sure why it’s trying to update this 94YYTk — that seems to be Manifold Markets account from dev-mantic-markets?
Faster dev speed
Version controlled = great
No longer need to continually run CLI commands to push server updates ⇒ this dev loop is AWFUL, takes 10m, flakes a bunch, have to enter all the right commands in the right order
Need to know fewer parts about our dev stack to be productive
maybe cheaper too
Makes private instances easier, maybe?