ljosberinn / keystone-heroes

Keystone Heroes provides in-depth analysis for Mythic+ runs based on Warcraft Logs including routes, cooldown usage and other improvement vectors.
https://keystone-heroes.com/
15 stars 3 forks source link

Keystone Heroes

Keystone Heroes Logo

Overview

Prerequisites

Introduction

This repository initially was bootstrapped with create-next-app, was a yarn workspaces monorepo for a few months and now is back to being a large repo without individual packages as prisma became fascinatingly slow when importing from a different local package. It's still not blazingly fast but a lot better.

I'm using React 18 on the experimental channel, primarily because I can and being able to codesplit with next/dynamic and Suspense as well as SuspenseList are nice. Other than that, it's pretty straight forward React, Next.js and Tailwind.

The file src/web/staticData.ts is generated by src/web/createStaticData.ts by running yarn db:static-data. Some of the data there is technically duplicated or a trimmed down version of data residing somewhere else in the repo. Treeshaking, even with webpack5, is not smart enough to only include specifically e.g. the NW constant from src/queries/events/dungeons/nw which is the only bit of logic I need from that file. For whatever reason, isNwSpearEvent and all the other Warcraft Logs related parsing utilities will also end up in the frontend bundle.

It will also be run during the build process to avoid having some icons present in prod only so you don't have to worry about updating it yourself.

Setup

If you've setup Docker/Supabase differently than the defaults recommend, adjust your DATABASE_URL env variable accordingly.

The NEXT_PUBLIC_SENTRY_DSN variable is currently irrelevant as Sentry is disabled locally.

Storybook

I'd love to have more stories, but that'll come later.

You can start storybook through yarn storybook:dev.

Tests

I'd love to have more tests, but that'll come later. The existing tests are better than nothing.

You can run the individual subfolders tests through yarn test:api, yarn test:wcl and yarn test:web (or just yarn test for all). Each has their own jest.config.*.js.

Linting

I'm naturally using my own ESLint config. There are a few warnings, I'm aware of them and will fix them eventually.

Errors should be fixed when filing a PR.

Types

Everything is TypeScript. Don't use any, avoid unknown unless in generics.

Typechecking can be initiated through yarn types and must pass when filing a PR.

Formatting

Prettier defaults. Install the recommended VSCode extensions if you didn't already.