You need to have corepack enabled in your current node installation. Make sure you have node 21 installed and run the following in your terminal:
npm uninstall yarn -g
corepack enable
corepack install
yarn exec env # <-- This should output a path to the yarn binary rather than a list of environment variables - if it doesn't consult the yarn docs https://yarnpkg.com/corepack
yarn
To get tunnels set up for your discord activity, you need to do the following:
brew install cloudflared # install cloudflare tunnel service
cloudflared login # login to your cloudflare account - make sure to give it access to one of your domains here
cloudflared tunnel create discord-activity # create a tunnel named dndnotes
cloudflared tunnel route dns discord-activity dndatunnel.floffah.dev # replace domain with your own
cloudflare tunnel create dndnotes-web # create a tunnel named dndnotes-web
cloudflare tunnel route dns dndnotes-web dndnotestunnel.floffah.dev # replace domain with your own
yarn dev # start the dndnotes web dev server (where the api is hosted) and the discord-activity frontend dev server
yarn tunnel # start the cloudflare tunnels
Then link these domains to discord. In your developer dashboard, go to the "URL Mappings" tab and add the following mappings: (replace the domains with your own)
/
- dndatunnel.floffah.dev/dndnotes
- dndnotestunnel.floffah.dev/icons
- api.iconify.design/pubnub
- ps.pndsn.com
DISCORD_CLIENT_SECRET
= discord oauth client secretMONGODB_URI
= mongodb connection stringNEXT_PUBLIC_BASE_URL
= base url for the web server, should behttp://localhost:3000
in dev - in prod i have it set tohttps://dndnotes.floffah.dev
NEXT_PUBLIC_DISCORD_CLIENT_ID
= discord oauth client idNEXT_PUBLIC_DISCORD_REDIRECT_URI
= discord oauth redirect uri, set tohttp://localhost:3000/api/discord/redirect
in dev
MONGODB_URI_TESTS
= mongodb connection string for tests
DISCORD_CLIENT_SECRET
= discord oauth client secretNEXT_PUBLIC_DISCORD_CLIENT_ID
= discord oauth client idNEXT_PUBLIC_BASE_URL
= should be set tohttps://<discord client id>.discordsays.com
in all environments. discord proxies the prod deployment AND the development cloudflare tunnelNEXT_PUBLIC_FORCE_PROXIED_ICONS
= should always betrue
in all environments - forced iconify to use the iconify api through a discordsays.com proxied url mapping