manifold/web
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
..
components Manalink: Send mana to anyone via link (#114) 2022-06-23 01:07:52 -07:00
hooks Remove group details cache, update group directly 2022-06-22 17:19:17 -05:00
lib Manalink: Send mana to anyone via link (#114) 2022-06-23 01:07:52 -07:00
pages Manalink: Send mana to anyone via link (#114) 2022-06-23 01:07:52 -07:00
public non-cash-dropping logo gif 2022-06-13 20:32:47 -05:00
.eslintrc.js Change eslint unused var to 'warn' instead of 'error' 2022-06-15 14:48:12 -05:00
.gitignore Run a ts type checker in parallel with nextjs dev process 2021-12-19 15:26:59 -06:00
.prettierignore Run prettier 2021-12-09 15:23:21 -08:00
next-env.d.ts upgrade nextjs version 2021-12-15 23:49:38 -06:00
next-sitemap.js Generate sitemap server-side 2022-03-24 09:52:13 -07:00
next.config.js Rename /analytics to /stats to work around adblockers (#437) 2022-06-07 08:37:23 -07:00
package.json Manalink: Send mana to anyone via link (#114) 2022-06-23 01:07:52 -07:00
postcss.config.js Prettier: no semi, spaces 2, single quote, trailing comma 2021-12-02 17:49:46 -06:00
README.md A couple additions to help newbies out (#104) 2022-04-27 13:15:14 -07:00
tailwind.config.js Send M$ to Charity & txns (#81) 2022-04-29 19:35:56 -04:00
tsconfig.json Fix up target in web tsconfig (#155) 2022-05-08 23:57:29 -07:00

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?