syvb / manifold

Manifold Markets: A market for every question

Home Page:https://manifold.markets

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Manifold

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.

  • backend/: All the rest of the stuff we run on GCP.

  • common/: Typescript library code shared between web/ & backend/. 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.)

  • 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.

About

Manifold Markets: A market for every question

https://manifold.markets

License:MIT License


Languages

Language:TypeScript 74.1%Language:HTML 21.1%Language:PLpgSQL 1.8%Language:JavaScript 1.6%Language:Python 0.6%Language:CSS 0.3%Language:Java 0.2%Language:Shell 0.2%Language:Ruby 0.1%Language:Objective-C++ 0.1%Language:Dockerfile 0.0%Language:SCSS 0.0%Language:Objective-C 0.0%Language:Swift 0.0%