You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
manifold/web
FRC aaa09f49c0
New component to add arbitrary (but static) react embeds to posts programatically + midterms component (#1051)
2 years ago
..
components New component to add arbitrary (but static) react embeds to posts programatically + midterms component (#1051) 2 years ago
hooks Tipping in posts (#1045) 2 years ago
lib Tipping in posts (#1045) 2 years ago
pages Tipping in posts (#1045) 2 years ago
posts Autosave post, market, comment rich text (#1015) 2 years ago
public Auto-prettification 2 years ago
.eslintrc.js Don't break build on unused import (#1046) 2 years ago
.gitignore Generate images from StableDiffusion (#1035) 2 years ago
.prettierignore Host Ida and Alex's MTG Guesser game (#656) 2 years ago
.yarnrc when adding package, don't put ^ before version (#645) 2 years ago
README.md A couple additions to help newbies out (#104) 2 years ago
get-manalink-url.ts initial commit for manalinks UI improvements (#642) 2 years ago
next-env.d.ts upgrade nextjs version 2 years ago
next.config.js Remove images config from next.config.js (#931) 2 years ago
package.json Update stability-client to fix /dream 2 years ago
postcss.config.js Prettier: no semi, spaces 2, single quote, trailing comma 2 years ago
tailwind.config.js added cancelling tipping and lil coin (#1047) 2 years ago
tsconfig.json Typescript project references take 2 (#586) 2 years ago

README.md

Manifold Markets web app

Getting started

To run the development server, install Yarn 1.x, and then in this directory:

  1. yarn to install all dependencies
  2. yarn dev:dev starts a development web server, pointing at the development database
  3. Your site will be available on http://localhost:3000

Check package.json for other command-line tasks. (e.g. yarn dev will point the development server at the prod database. yarn emulate will run against a local emulated database, if you are serving it via yarn serve from the functions/ package.)

Tech stack

Manifold's website uses Next.js, which is a React-based framework that handles concerns like routing, builds, and a development server. It's also integrated with Vercel, which is responsible for hosting the site and providing some other production functionality like serving the API. The application code is written exclusively in Typescript. Styling is done via CSS-in-JS in the React code and uses Tailwind CSS classes.

Building and deployment

Vercel's GitHub integration monitors the repository and automatically builds (next build) and deploys both the main branch (to production) and PR branches (to ephemeral staging servers that can be used for testing.)

Parts of the file structure that directly map to HTTP endpoints are organized specially per Next.js's prescriptions:

public/

These are static files that will be served by Next verbatim.

pages/

These are components that Next's router is aware of and interprets as page roots per their filename, e.g. the React component in pages/portfolio.tsx is rendered on the user portfolio page at /portfolio. You should look in here or in components/ to find any specific piece of UI you are interested in working on.

pages/api/

Modules under this route are specially interpreted by Next/Vercel as functions that will be hosted by Vercel. This is where the public Manifold HTTP API lives.

Contributing

Please format the code using Prettier; you can run yarn format to invoke it manually. It also runs by default as a pre-commit Git hook thanks to the pretty-quick package. You may wish to use some kind of fancy editor integration to format it in your editor.

Developer Experience TODOs

  • Prevent git pushing if there are Typescript errors?