Manifold Markets: A market for every question
Go to file
Austin Chen 6cc2d8af58
Manalink: Send mana to anyone via link (#114)
* Set up Firestore structure for mana bounty links

* Split up manalinks into successes and failures

* Allow clients to create manalinks

* Track txnId and successful users

* Store custom amounts in the link

* List all manalinks you've created

* Support backend for claiming manalinks

* Add some more error handling

* Tweak readme

* Fix typescript breakage

* Revert "Convert common imports in functions to be absolute"

This reverts commit c03518e906.

* Scaffolding so `claimManalink` works

* Clean up imports

* Barebones endpoint to claim mana

* Fix rules to only allow link creators to query

* Design out claim giftcard

* List all claimed transactions

* Style in a more awesome card

* Fix import

* Padding tweak

* Fix useManalinkTxns hook

* /send -> /link

* Tidy up some details

* Do a bunch of random manalinks work

* Fix up LinksTable to build

* Clean up LinksTable an absurd amount

* Basic details functionality on manalinks table

* Work on manalink claim stuff

* Fix up some merge mess

* Not-signed-in flow implemented

* Better manalinks table

* Only show outstanding links in table

* Use new `ManalinkTxn` type

* /link -> /links

* Change manalinks page UI to use nice looking tabs

* Many fixes to manalinks UI

* Default to 1 use

* Tidying up

* Some copy changes based on feedback

* Add required index

Co-authored-by: Marshall Polaris <marshall@pol.rs>
2022-06-23 01:07:52 -07:00
.github Set up eslint for common, functions packages (#290) 2022-05-22 00:35:43 -07:00
.vscode added recommended extensions (#550) 2022-06-21 17:20:28 -05:00
common Manalink: Send mana to anyone via link (#114) 2022-06-23 01:07:52 -07:00
docs API update pool (#553) 2022-06-23 00:37:04 -07:00
functions Manalink: Send mana to anyone via link (#114) 2022-06-23 01:07:52 -07:00
og-image Threaded free response comments & general comments sections (#121) 2022-05-03 14:38:40 -06:00
web Manalink: Send mana to anyone via link (#114) 2022-06-23 01:07:52 -07:00
.firebaserc Allow admins to see private-users info 2022-01-24 00:48:10 -06:00
.gitignore Revert "Automated market resolution (#404)" 2022-06-14 23:31:20 -05:00
.prettierrc move prettier config to top level 2022-01-10 17:44:42 -06:00
firebase.json Reapply Manifold for Teams config changes (#54) 2022-02-26 23:29:33 -08:00
firestore.indexes.json Manalink: Send mana to anyone via link (#114) 2022-06-23 01:07:52 -07:00
firestore.rules Manalink: Send mana to anyone via link (#114) 2022-06-23 01:07:52 -07:00
LICENSE.md Choose MIT license 2022-04-02 12:01:23 -07:00
package.json Add yarn verify script (#378) 2022-06-03 15:10:14 -07:00
README.md Mention /docs package in README 2022-05-31 15:16:18 -07:00
yarn.lock Manalink: Send mana to anyone via link (#114) 2022-06-23 01:07:52 -07:00

Manifold Markets

This monorepo has basically everything involved in running and operating Manifold.

Getting started

  1. Make sure you have Yarn 1.x
  2. $ cd web
  3. $ yarn
  4. $ yarn dev:dev
  5. Your site will be available on http://localhost:3000

See web/README.md for more details on hacking on the web client.

General architecture

Manifold's public API and web app are hosted by Vercel. In general, the web app runs as much as possible on the client; we follow a JAMStack architecture. All data is stored in Firebase's database, Cloud Firestore. This is directly accessed by the client for most data access operations.

Operations with complicated contracts (e.g. buying shares) are provided in a separate HTTP API using Firebase's Cloud Functions. Those are deployed separately from the Vercel website; see functions/README.md for more details.

Directory overview

  • web/: UI and business logic for the client. Where most of the site lives. The public API endpoints are also in here.

  • functions/: Firebase cloud functions, for secure work (e.g. balances, Stripe payments, emails). Also contains in functions/src/scripts/ some Typescript scripts that do ad hoc CLI interaction with Firebase.

  • common/: Typescript library code shared between web/ & functions/. If you want to look at how the market math works, most of that's in here (it gets called from the placeBet and sellBet endpoints in functions/.) Also contains in common/envs configuration for the different environments (i.e. prod, dev, Manifold for Teams instances.)

  • og-image/: The OpenGraph image generator; creates the preview images shown on Twitter/social media.

  • docs/: Manifold's public documentation that lives at https://docs.manifold.markets.

Contributing

Since we are just now open-sourcing things, we will see how things go. Feel free to open issues, submit PRs, and chat about the process on Discord. We would prefer small PRs that we can effectively evaluate and review -- maybe check in with us first if you are thinking to work on a big change.

By contributing to this codebase, you are agreeing to the terms of the Manifold CLA.

If you need additional access to any infrastructure in order to work on something (e.g. Vercel, Firebase) let us know about that on Discord as well.