lightandluck / nextjs-potluck

Wantlist generator for Math Trades
4 stars 3 forks source link

Potluck Prototype

This is an MVP (minimum viable product) for running Math Trades. The hope is that it can facilitate a math trade for things other than boardgames, which was the intention of the original TradeMaximizer.

Demo: https://nextjs-potluck.netlify.app/

Rough deploy instructions: https://cryptpad.fr/pad/#/2/pad/view/Sbm+8JbQnOvRhN5yHpyD+-1Fbn1rpWAEY77IzuJ-Bp0/

How to install

1. Set up a MongoDB database

Either locally or with MongoDB Atlas for free.

2. Set up environment variables

Copy the env.local.example file in this directory to .env.local (which will be ignored by Git):

cp .env.local.example .env.local

Set these variables in .env.local:

3. Run Next.js in development mode

npm install
npm run dev

# or

yarn install
yarn dev

Your app should be up and running on http://localhost:3001!

4. Set up seed. IMPORTANT!

You only have to do this once, before using the application for the first time. Hit the api endpoint: "http:/localhost:3001/api/seeds" with a POST request with an object of form:

{
  prefix: YOUR_CHOICE_STRING,
  counter: 0
}

This will create a seed that is used to create the official names for offerings.

Deploy Your Local Project

Innovation

To create the wantlists instead of using a grid like the OLWLG and Abecorn, or setting individual values, instead we simply sort a list. This means that the process of evaluating trades for the user decreases from O(n^2) to O(n) complexity.

!Warning - Still need to implement duplicate protection though!

Credits and Prior Art

Links to useful things