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/
Either locally or with MongoDB Atlas for free.
brew services start mongodb-community@6.0
brew services stop mongodb-community@6.0
mongosh --port 27017 --authenticationDatabase "admin" -u "myUserAdmin" -p
/local-scripts
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
:
LOCAL_MONGOOSE_URI
- URI with local db in connection string
ATLAS_MONGOOSE_URI
- URI with cloud db in connection string
SEED_PREFIX
- Starting seed prefix. TODO: Have the app set automatically from this config, instead of manually by the developer
These were for the native nodejs mongodb driver, but are no longer used. Keeping around just in case.
ATLAS_URI
- Cloud connection stringLOCAL_URI
- Local DB connection stringLOCAL_MONGODB_DB
- Local DB NameATLAS_MONGODB_DB
- Cloud DB Namenpm install
npm run dev
# or
yarn install
yarn dev
Your app should be up and running on http://localhost:3001!
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.
next
dependency in package.json
is explicityly set: https://www.reddit.com/r/nextjs/comments/hdkkps/sh_1_next_not_found_when_deploying_on_heroku/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!