manifoldmarkets / manifold

Manifold Markets: A market for every question
https://manifold.markets
MIT License
420 stars 157 forks source link

DX: Migrate from Firebase Cloud Functions to Vercel Serverless Functions #89

Closed akrolsmir closed 5 months ago

akrolsmir commented 2 years ago

We use Firebase Cloud Functions today, mostly for things that we can't trust the client for (user balance modifications; referencing Stripe, email, and other secret keys). However, it's bad that to do any server-based work we have to drop into Firebase Cloud Functions; it adds a pretty big layer of friction to development. FCF is bad because:

The nicest thing about FCF is the built-in authentication that works with Firebase Auth, which allows the function to act on behalf of a particular user. We could just build this ourselves using tokens/cookies. Here are some examples:

  1. https://blog.logrocket.com/implementing-authentication-in-next-js-with-firebase/
  2. https://colinhacks.com/essays/nextjs-firebase-authentication
  3. https://github.com/gladly-team/next-firebase-auth

These use the client Firesbase lib instead of the Admin SDK but it's unclear to me what functionalities on the Admin SDK we actually need; I think we could still use the Admin SDK in Vercel, if necessary.

(I'd happily pay a M$ 20K bounty just for this, fwiw)

akrolsmir commented 2 years ago

Officially offering a $256 USD cash bounty, or the equivalent in M$, for anyone who wants to take this on.

Manifold employees are eligible. (FWiW this means if I end up implementing this, I'm going to have Manifold pay me M$ 25.6k).

If you start work on this, please say so in this thread so we don't waste anyone else's time!

sipec commented 1 year ago

am unilaterally revoking the bounty. future bounties should be made via Manifold

sipec commented 5 months ago

and now unilaterally closing! the more I learn, the less I believe in serverless