91bec9c996
* Referrals page added to sidebar; useSaveReferral; InfoBox * text color * eslint * migrate useUsers hook to react-query (#674) * Remove bet button from free response comments * Make answer replies more closely spaced together * Host Ida and Alex's MTG Guesser game (#656) * Copy over code from Mtg Guesser * Run Prettier * CSS Tweaks: Hover feedback, button positioning * Hide all but counterspell & burn, for now * Move to /mtg directory * Fix prettierignore * smaller jsons (#673) limited burn to only red cards and also added limited json files to only have fields needed to play * Add Ida's tweak to card position Co-authored-by: marsteralex <bob.masteralex@gmail.com> * Adjust card positioning * Make the select screen index.html * Remove other guessing games * Remove alternate versions; add Alex's email * Remove unused jsons * Small FR comments tweaks * Spacing tweak * Changing manalinks table UI (#665) From table to card view * Fix comment spacing on non-FR * Move "Send M$" lower in sidebar More list. * Move leaderboards up in mobile nav * eslint * prettier Co-authored-by: Sinclair Chen <abc.sinclair@gmail.com> Co-authored-by: James Grugett <jahooma@gmail.com> Co-authored-by: Austin Chen <akrolsmir@gmail.com> Co-authored-by: marsteralex <bob.masteralex@gmail.com> Co-authored-by: ingawei <46611122+ingawei@users.noreply.github.com> |
||
---|---|---|
.github | ||
.vscode | ||
common | ||
docs | ||
functions | ||
og-image | ||
web | ||
.firebaserc | ||
.gitignore | ||
.prettierrc | ||
firebase.json | ||
firestore.indexes.json | ||
firestore.rules | ||
LICENSE.md | ||
package.json | ||
README.md | ||
yarn.lock |
Manifold Markets
This monorepo has basically everything involved in running and operating Manifold.
Getting started
- Make sure you have Yarn 1.x
$ cd web
$ yarn
$ yarn dev:dev
- 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 infunctions/src/scripts/
some Typescript scripts that do ad hoc CLI interaction with Firebase. -
common/
: Typescript library code shared betweenweb/
&functions/
. If you want to look at how the market math works, most of that's in here (it gets called from theplaceBet
andsellBet
endpoints infunctions/
.) Also contains incommon/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.