This repo contains all of the source code for the Roo Troop NFT project, including the following:
- The Roo Troop NFT Contract (Roo Troop)
- Art Generation Scripts
- Whitelist Processing Scripts
- Off-Chain Whitelist Backend
- Companion Contract (Joey)
- Staking Contract (xRooStaking)
- Mint/Staking UIs (Written in React.js/Typescript)
- The $ROOLAH Shop UI/backend
For the majority of the sub-projects, I use Node.js with lerna, before getting started, it'd be good to do the following:
- Clone into the repo with your git client of choice (I love Sublime Merge, but that's because I don't care for CLI tools)
- Ensure that you have node/npm installed on your machine. I use node v16.13.1, npm 8.1.2.
- Ensure that you use npm to locally download yarn
npm install --global yarn
When working in lerna, it's important to note that the packages are all sym-linked together when being referenced from each other with import {...} from '@roo/...'
syntax. Never reference other packages with relative paths. The symlink is built off of the /lib
or /dist
dirs of each package, so to ensure that one package has the newest reference to another, run yarn build
in that dependency package or yarn lerna run build --scope=@roo/<package-suffix>
from the root. This will commonly be used in the backend code or when dealing with the shared package in the UI code.
- Follow the instructions in Notes
- Navigate to the
/web
directory - Run
yarn install
(downloads lerna and others) - Run
yarn bootstrap
(links packages together with symlinks) - Now you are ready to go with
yarn build
to build all packages oryarn lerna run build --scope=@roo/<package-suffix>
for a particular package. - You can build for production with
yarn build:prod
for all packages oryarn lerna run build:prod --scope=@roo/<package-suffix>
for a particular package.
- MySQL (5.7.32 in prod, 5.7.36 in asdf)
- ENV vars in
/shop_backend/packages/Webserver/.env
- Follow the instructions in Notes
- Navigate to the
/shop_backend
directory - Run
yarn install
(downloads lerna and others) - Run
yarn bootstrap
(links packages together with symlinks) - Now you are ready to go with
yarn start:fresh
to start and kill anything already using the port oryarn start
otherwise.
- Download the Heroku CLI following https://devcenter.heroku.com/articles/heroku-cli
- Navigate to
/shop_backend
and run heroku login in your terminal of choice - Make changes and PR/commit to master
- Change to the master branch
- Run
git subtree push --prefix shop_backend heroku master
to generate and push a subtree whereshop_backend
is the root so that Heroku can find and start the Node.js server.