Sero 0da0f17ed7 Platform UX Squad (#1647)
* unified community page start

* community tabs, tablist and body

* community tab fix

* Make tabs width dynamic

* fix dashboard regression

* make community page dynamic, reduce repitition

* fix imports, fix bugs

* make underline on selected page, change custom block CTA, remove forum. align news

* onboarding screen full page

* Update index.tsx

* Update index.tsx

* unified community page start

* community tabs, tablist and body

* community tab fix

* Make tabs width dynamic

* make community page dynamic, reduce repitition

* fix imports, fix bugs

* questchain fix

* Commit wip

* Fixes "Merge role paths, playbooks & great houses into a single page"
- Just need to add numbers or data source for `seedsEarned`

* Forgot to remove the redundant Learn code.

* fixed issue with incorrect url path in the card.
- also started improving on responsive after discussion with peth.

* WIP on adding the carousel functionality.

* next / prev buttons now to do added. some bits still to do to refine functionality

* making header full width with centred menu after some discussionin discord
- Resolves issue with the profile pop-over being out of place
- with there being multiple pages widths in the site, this imho balances out alignment issues

* Scrollbar styles for firefox & changing color to purple

* Fixed issue with scrollbar showing in search results when no scrolling required

* Removed extraneous comments & renamed component & prop types to clearer name
- also tweaking the color on the scrollbars.

* bump eslint to fix recent errors

* fixed breakage related to props.

* rename to Academy.
- also removed overlay on cards, replaced with text shadow

* smol tweaks & responsive improvements - WIP

* tweaks to slider to fix issues with position of the items on prev & next. Also fixd disabling the next button on the last item.

* more responsive styles. base, md, xl & 2xl. fixed a couple of display issues.

* Adding 'submit a playbook' playbook to all categories.

* Addressed feedback from @alalonde

* Fixed responsive issues

* removed extraneous comments

* streamlining XP calculation, adding token multiplier, & returning detailed info from balance sync task 🧲

* making changes to force a redeploy 🍦

* adding a bunch of down migrations 🔦

* cascading column `drop`s 🛀

* fixing `trigger` `drop`s 📬

* handling result pagination, reverse chronology, & setting initial skip 🥞

* Update DesktopPlayerStats.tsx

* calendar now pulling data from my endpoint and styled as per the Figma.

* fixed linting issue by updating the eslint-parser.

* remove extraneous logs

* some style tweaks, cleaning up the description and other improvements

* disable after 20 events

* doh! left the local url by mistake

* hover for the items

* update styles to match designs. I am having an issue where I can't change the height of the block, so it will only go as high as 4 items rn

* addressed feedback from @davort around 'load more' & smol display issues

* addressed some review comments from @alalonde

* forgot to change the url back

* tweak to scrollbar styles as the shadow was a bit too much with the alpha on the thumb.

* wip on moving my express backend into

* further wip on moving stuff to . Now displaying the events but I still need to sort the load more functionality

* fix regression

* final changes for the calendar after refactor to use Next api routes.

* replace localhost api url with

* remove ts-ignore

* Update MegaMenuHeader.tsx

* adding env vars for the calendar stuff which will hopefully fix test.

* fix some memory issues with my code

* wip on fixing isues

* updating GitHub Actions 🐊

* Fix Google Calendar environment variables (#1638)

* passing Google Calendar API info through build process 🈴

* renaming env vars & publishing them to the build process 🐦

* auto checkout not working for Hasura build 🦷

* discovered some not renamed variables 🉐

* adding swap space ☄

* trying to expand Node's heap size 🧐

* underscored rather than dashed 🌾

* trying node 20 🦙

* switching to `python3` 🌮

* updating `node-gyp` & `better-sqlite3` 🛵

* returning error details 🦚

* trying a different mechanism for increasing the Node heap 🦟

* fix: fix logic for checking the host. Now using a whitelist set in config.ts and checking that against the publicURL

* fix: was referencing the cal id with NEXT_PUBLIC_GOOGLE_CAL prefix but it is now GCAL_ - should sort the missing credentials issue

* printing settings for sanity check 🐻

* setting runtime environment 🌲

* trying to set runtime env 👩🏿‍🔧

* grabbing calendar id 🤴🏿

* replacing escapes newlines in private key 🍨

* removing logging 🥾

* fix: body overflow issue when events have long descriptions

* feat: style/design updates to calendar pop overs

* chore: clean up comments

* fix: use ListItem

* fixed issues after review from @dysbulic

* fix: addressed comments from dys' review, removed a cpl of comments and increased the days initially displayed to fill the block

---------

Co-authored-by: luxumbra <me@luxumbra.dev>

* removing `yarn` v15 from `Dockerfile` 👼🏿

* begin work on unify signup

* Create custom image tabs [WIP]

* Add content and style unified signup page

* Implement responsive styles

* Clean up code

* Remove gap from between perk cards

* Remove unnecessary badges on mobile & change join text

* Fix typo

* Working on masking content beliw tabs on desktop

* Fix card width & remove mask attempt

* Fix mobile cut off

* Fix mobile view

* Fix mobile layout by resizing content

* Make changes based on suggestions

* CHange pro tier to say inquire

* Redirect to /signup?tab=player when user navigates to /signup

* Center role cards

* Fix masking issue

* Fix text

* Refactor code to be more dynamic

* Make active tab local variable, make OR condition more dynamic, minor changes

* Fix nested ternary

* Fix role scope issue

* Fix redirect

* Fix badge ternary

* Fix import error

* Fix import again

* add rotating one liners

* test fix

* Fix animation

* Fix eslint stuff

* Fix linting error

* renamed Google Analytics environment variable & passed it through to Docker 🧫

* Change Landing Page CTA (#1640)

* add langing page cta; speed up 1liners

* sort fix

* add gradient

* absolute position

---------

Co-authored-by: Seroxdesign <sherifcherfa@gmail.com>
Co-authored-by: Sero <69639595+Seroxdesign@users.noreply.github.com>

* Fixed MWW integration, removed more cruft

* A min height makes the 'created by me' switch the same height as the MetaFilterSelectSearch components

This is needed because at certain screen sizes it wraps on to its own row and shrinks

* Fix up the repetition/cooldown.

RepetitionTag was showing a placeholder value; QuestForm was showing the value in seconds instead of hours

* Removed the external link field.

It's not going to be used any more; no one knew what it was supposed to be used for

* Use QuestDetailsImage for the image preview

It matches better with the new design

* Font for form headings matches new design

* Basic appearance of Delete Quest modal

Added delete button, added the AlertDialog component and added AlertDialogCloseButton to design system exports. Actual delete functionality not added.

* Stub for Delete flow

* Added DELETED option to Quest Status enum

* Quests can be set as deleted using the useUpdateQuestMutation

* Change where questRoles and questSkills are assigned, use camelCase to pass linting

* Bring in the Chakra Alert components to use

* Show a *Quest was deleted* alert if a deleted quest is viewed

* Change quest status option from Deleted to Archived

Plus tidying some unused imports

* Increased line height in quest tile heading to prevent clipping of descenders of y and g

* Updated schema

* background rehaul

* fix onboarding game height, fix matrix animation

---------

Co-authored-by: N I T E <nitegeist.dev@gmail.com>
Co-authored-by: luxumbra <me@luxumbra.dev>
Co-authored-by: dysbulic <dys@dhappy.org>
Co-authored-by: Alec LaLonde <alec@boxelderweb.com>
Co-authored-by: HHH-GH <hayden@opie-etc.com>
2023-12-01 04:37:34 -05:00
2023-12-01 04:37:34 -05:00
2023-12-01 04:37:34 -05:00
2023-12-01 04:37:34 -05:00
2023-12-01 04:37:34 -05:00
2023-12-01 04:37:34 -05:00
2020-04-16 10:20:15 +02:00
2023-10-08 19:29:59 -04:00
2021-05-01 12:46:48 +05:30
2023-12-01 04:37:34 -05:00
2021-05-01 12:46:48 +05:30
2023-03-13 10:19:16 -06:00
2023-12-01 04:37:34 -05:00
2023-03-13 10:19:16 -06:00
2023-12-01 04:37:34 -05:00
2020-07-13 11:19:48 -06:00
2023-12-01 04:37:34 -05:00

The Game

Monorepo for the MetaGame applications, backend and databases.

We're using the following stack:

Architecture

Frontend

Backend

Overall

MetaGame

Guides

If you're new to the MetaGame codebase, check out the following guides to learn how to contribute.

Development

Before you start contributing read the Contributing Guide!

Bootstrap

Create your local .env file

cp .env.sample .env

Create a GitHub token at https://github.com/settings/tokens

Set GITHUB_API_TOKEN=your_github_token in .env

Install Packages

yarn

Initial TS Compilation For Monorepo Packages

yarn typecheck

Adding a package to the codebase can be done with Lerna

Run services

Start backend services

yarn docker:start

For M1 Mac Users

Official docker images of Hasura don't work on M1 yet

In hasura/Dockerfile Replace

FROM hasura/graphql-engine:v1.3.3.cli-migrations-v2

with

FROM fedormelexin/graphql-engine-arm64:v1.3.3.cli-migrations-v2
  • Runs docker containers for backend, Hasura Engine, and PostGres database
  • will auto-restart on any changes to packages/backend and packages/utils

If you are running for the first time on an empty database, once the services are running you have two options to populate the database:

  1. Populate the database with the production dataset:
yarn hasura:seed-db
  1. Populate the database with the initial dataset:
curl -X POST http://localhost:4000/actions/syncSourceCredAccounts?force=true

Rebuild backend services

If your docker containers fail to start due to changes in config, you may need to rebuild the containers. This can take several minutes.

yarn docker:build

Stop backend services

yarn docker:stop
  • Stops all the containers

Troubleshooting

Rebuild and run the containers (in attach mode):

docker-compose up --build

In case non of the above commands are working try purge the docker containers and images you can do this by running (notice: this removes all the containers and images on your computer!):

docker system prune -a

If you're working on the front-end and the build fails with something like the error below, you'll need to create a .env file in packages/web and add NEXT_PUBLIC_GRAPHQL_URL=https://api-staging.metagame.wtf/v1/graphql

[Error [CombinedError]: [Network] request to http://localhost:8080/v1/graphql failed, reason: connect ECONNREFUSED 127.0.0.1:8080] {
  type: 'CombinedError',
  graphQLErrors: [],
  networkError: {
    message: 'request to http://localhost:8080/v1/graphql failed, reason: connect ECONNREFUSED 127.0.0.1:8080',
    type: 'system',
    errno: 'ECONNREFUSED',
    code: 'ECONNREFUSED'
  }
}

** A note about environment variables **

If you need to add an environment variable, it will need to go in several places:

  • your own .env file
  • .env.sample
  • gcp-deploy.yaml
    • For backend variables, add to the deploy-backend step alongside the others
    • For frontend variables, add to the deploy-frontend step. You may also need to add it to the build-frontend step, if it is used in a page that is statically generated by next.js
  • gcp-deploy-frontend.yaml for frontend variables, this should be the same as the frontend actions in the other yaml file

Secrets will need to be added to the TheGame Github secrets; contact a senior builder for assistance.

As an aside, the gcp-deploy-frontend.yaml is the deployment configuration for our test and production frontend instances, while gcp-deploy.yaml is only for PR environments.

Run NextJS Web App dev mode (new)

yarn web:dev

Go to http://localhost:3000

Happy Coding!

Run Discord Bot

yarn discord-bot dev

This will automatically register with Discord and relay chat messages to your local instance! Pretty cool. Testing in a dedicated test Discord server (rather than MetaGame's) is recommended.

Tooling

Start Hasura console

yarn hasura:console

Hasura CLI example

yarn hasura migrate status
yarn hasura migrate squash --name "<feature-name>" --from 1598417879553
yarn hasura migrate apply --version "<squash-migration-version>" --skip-execution

Hasura CLI documentation Hasura Migrations Guide

Generate GraphQL Types

yarn generate

Reload Schema + Generate GraphQL Types (backend needs to be running)

yarn update-schema
yarn generate

Restart with fresh database

yarn docker:clean
yarn docker:start

Run typechecks

yarn typecheck

WIP Branch Push

Upon pushing to the repository a linting check will be initialized validating your code. If you want to push the branch to the repository (maybe for collaboration) while the code isn't completely valid yet you have the option of skipping the linting process:

git push -u origin <branch> [--no-verify]

Please use this only when absolutely necessary!

Debugging with Visual Studio Code

When running the backend stack locally using docker-compose, you can still debug the backend container using VS Code. Just add this configuration to your .vscode/launch.json.

Description
No description provided
Readme 304 MiB
Languages
TypeScript 96.4%
JavaScript 2.5%
Dockerfile 0.8%
PLpgSQL 0.2%
SCSS 0.1%