From 8bc6a709e6be822f15c0bf426ea7917eee576fdb Mon Sep 17 00:00:00 2001 From: Jason Boyett Date: Sun, 31 Dec 2023 17:50:46 -0600 Subject: [PATCH 01/15] new mono repo structure working --- .VSCodeCounter/2023-08-11_18-56-14/details.md | 89 - .../2023-08-11_18-56-14/diff-details.md | 16 - .VSCodeCounter/2023-08-11_18-56-14/diff.csv | 2 - .VSCodeCounter/2023-08-11_18-56-14/diff.md | 21 - .VSCodeCounter/2023-08-11_18-56-14/diff.txt | 22 - .../2023-08-11_18-56-14/results.csv | 75 - .../2023-08-11_18-56-14/results.json | 440 - .VSCodeCounter/2023-08-11_18-56-14/results.md | 52 - .../2023-08-11_18-56-14/results.txt | 126 - .env.example | 24 +- .eslintrc.cjs | 35 +- .github/ISSUE_TEMPLATE/bug_report.md | 17 +- .github/ISSUE_TEMPLATE/feature_request.md | 20 - .github/pull_request_template.md | 16 - .github/workflows/ci.yml | 62 + .gitignore | 25 +- .idea/.gitignore | 5 - .idea/inspectionProfiles/Project_Default.xml | 6 - .idea/modules.xml | 8 - .idea/speedread.iml | 12 - .idea/vcs.xml | 6 - .npmrc | 12 + .prettierrc.cjs | 12 + .vscode/extensions.json | 8 + .vscode/settings.json | 9 + README.md | 346 +- apps/expo/.expo-shared/assets.json | 4 + apps/expo/app.config.ts | 40 + apps/expo/assets/icon.png | Bin 0 -> 6991 bytes apps/expo/babel.config.js | 7 + apps/expo/expo-plugins/with-modify-gradle.js | 41 + apps/expo/index.ts | 8 + apps/expo/metro.config.js | 26 + apps/expo/package.json | 49 + apps/expo/src/_app.tsx | 31 + apps/expo/src/components/SignInWithOAuth.tsx | 38 + apps/expo/src/hooks/useWarmUpBrowser.ts | 11 + apps/expo/src/screens/home.tsx | 115 + apps/expo/src/screens/signin.tsx | 15 + apps/expo/src/types/nativewind.d.ts | 1 + apps/expo/src/utils/cache.ts | 22 + apps/expo/src/utils/trpc.tsx | 62 + apps/expo/tailwind.config.cjs | 4 + apps/expo/tsconfig.json | 8 + apps/nextjs/.eslintrc.cjs | 7 + apps/nextjs/README.md | 131 + apps/nextjs/next-env.d.ts | 5 + apps/nextjs/next.config.mjs | 27 + apps/nextjs/package.json | 45 + apps/nextjs/postcss.config.cjs | 1 + {public => apps/nextjs/public}/IRIS-LOGO.png | Bin .../nextjs/public}/Iris-butterfly.png | Bin .../nextjs/public}/flying-butterfly.gif | Bin {public => apps/nextjs/public}/home.png | Bin {public => apps/nextjs/public}/logo.png | Bin {public => apps/nextjs/public}/settings.png | Bin {public => apps/nextjs/public}/study-logo.png | Bin .../nextjs/src}/components/cubeflasher.tsx | 22 +- .../nextjs/src}/components/evensandodds.tsx | 21 +- .../src}/components/flasherstartbutton.tsx | 6 +- .../src}/components/flashingWordsNav.tsx | 2 +- .../nextjs/src}/components/flashingcell.tsx | 27 +- .../nextjs/src}/components/greendottext.tsx | 0 .../nextjs/src}/components/letterMatcher.tsx | 20 +- .../nextjs/src}/components/loadingspinner.tsx | 0 .../nextjs/src}/components/numbermatcher.tsx | 14 +- .../nextjs/src}/components/pietimer.tsx | 14 +- .../nextjs/src}/components/schultedraw.tsx | 0 .../nextjs/src}/components/schultetable.tsx | 18 +- .../nextjs/src}/components/sidebar.tsx | 12 +- .../nextjs/src}/components/speedtest.tsx | 14 +- .../nextjs/src}/components/tableswitcher.tsx | 9 +- .../components/tests/evensandodds.test.ts | 0 .../nextjs/src}/components/wordchanger.tsx | 3 +- .../nextjs/src}/components/wordpairs.tsx | 22 +- {src => apps/nextjs/src}/cva/cube-flasher.tsx | 0 .../nextjs/src}/cva/flashingStyles.tsx | 0 {src => apps/nextjs/src}/cva/fontProvider.tsx | 0 .../src}/cva/highlightSelectorButton.tsx | 0 apps/nextjs/src/env/client.mjs | 33 + apps/nextjs/src/env/schema.mjs | 30 + apps/nextjs/src/env/server.mjs | 27 + {src => apps/nextjs/src}/hooks/useInterval.ts | 0 .../nextjs/src}/hooks/useIsVisible.ts | 0 .../nextjs/src}/hooks/useStopWatch.ts | 0 {src => apps/nextjs/src}/hooks/useTimer.ts | 0 apps/nextjs/src/middleware.ts | 22 + apps/nextjs/src/pages/_app.tsx | 15 + .../src}/pages/admin/createquestion/done.tsx | 0 .../src}/pages/admin/createquestion/index.tsx | 0 .../nextjs/src}/pages/admin/index.tsx | 20 +- .../nextjs/src}/pages/admin/testexercise.tsx | 27 +- apps/nextjs/src/pages/api/trpc/[trpc].ts | 22 + .../nextjs/src}/pages/exercises/boxes.tsx | 4 +- .../src}/pages/exercises/cubebythree.tsx | 4 +- .../nextjs/src}/pages/exercises/cubebytwo.tsx | 4 +- .../src}/pages/exercises/evennumbers.tsx | 4 +- .../src}/pages/exercises/flashfourbyone.tsx | 4 +- .../src}/pages/exercises/flashonebyone.tsx | 4 +- .../src}/pages/exercises/flashonebytwo.tsx | 4 +- .../src}/pages/exercises/flashtwobyone.tsx | 4 +- .../src}/pages/exercises/flashtwobytwo.tsx | 4 +- .../nextjs/src}/pages/exercises/greendot.tsx | 14 +- .../src}/pages/exercises/lettermatcher.tsx | 4 +- .../src}/pages/exercises/numbermatcher.tsx | 4 +- .../src}/pages/exercises/schultetable/by3.tsx | 12 +- .../src}/pages/exercises/schultetable/by5.tsx | 12 +- .../src}/pages/exercises/schultetable/by7.tsx | 12 +- .../pages/exercises/schultetable/index.tsx | 12 +- .../src}/pages/exercises/speedtest/index.tsx | 18 +- .../pages/exercises/speedtest/question.tsx | 12 +- .../src}/pages/exercises/speedtest/result.tsx | 16 +- .../nextjs/src}/pages/exercises/wordpairs.tsx | 4 +- {src => apps/nextjs/src}/pages/index.tsx | 24 +- .../nextjs/src}/pages/instructions/boxes.tsx | 21 +- .../src}/pages/instructions/evennumbers.tsx | 22 +- .../instructions/flashingwords/fourbyone.tsx | 23 +- .../instructions/flashingwords/onebyone.tsx | 13 +- .../instructions/flashingwords/onebytwo.tsx | 21 +- .../instructions/flashingwords/twobyone.tsx | 23 +- .../instructions/flashingwords/twobytwo.tsx | 20 +- .../src}/pages/instructions/greendot.tsx | 21 +- .../src}/pages/instructions/lettermatcher.tsx | 21 +- .../src}/pages/instructions/numbermatcher.tsx | 21 +- .../src}/pages/instructions/schultetable.tsx | 31 +- .../src}/pages/instructions/speedtest.tsx | 21 +- .../src}/pages/instructions/wordpairs.tsx | 21 +- {src => apps/nextjs/src}/pages/nav.tsx | 54 +- {src => apps/nextjs/src}/pages/next.tsx | 10 +- {src => apps/nextjs/src}/pages/settings.tsx | 32 +- {src => apps/nextjs/src}/pages/setup.tsx | 0 .../nextjs/src/pages/sign-in/[[...index]].tsx | 16 + .../nextjs/src/pages/sign-up/[[...index]].tsx | 16 + .../nextjs/src}/stores/useCubeStore.ts | 0 .../nextjs/src}/stores/useMutateUser.ts | 0 .../nextjs/src}/stores/usePairsStore.ts | 0 .../nextjs/src}/stores/useSpeedTestStore.ts | 0 {src => apps/nextjs/src}/stores/userStore.ts | 2 +- {src => apps/nextjs/src}/styles/globals.css | 0 apps/nextjs/src/utils/trpc.ts | 44 + apps/nextjs/tailwind.config.cjs | 4 + apps/nextjs/tsconfig.json | 5 + bable.config.js | 4 - next.config.mjs | 23 - package-lock.json | 9448 -------------- package.json | 102 +- packages/api/index.ts | 5 + packages/api/package-lock.json | 1446 +++ packages/api/package.json | 28 + packages/api/src/context.ts | 37 + packages/api/src/router/auth.ts | 10 + packages/api/src/router/builders.ts | 29 + .../api/src/router/collection.ts | 47 +- .../api/src/router/exercises.ts | 137 +- packages/api/src/router/index.ts | 19 + packages/api/src/router/post.ts | 17 + packages/api/src/router/user.ts | 73 + packages/api/src/trpc.ts | 25 + packages/api/transformer.ts | 2 + packages/api/tsconfig.json | 4 + packages/config/tailwind/index.js | 8 + packages/config/tailwind/package.json | 15 + .../config/tailwind/postcss.js | 6 +- packages/db/index.ts | 22 + packages/db/package-lock.json | 193 + packages/db/package.json | 22 + {prisma => packages/db/prisma}/schema.prisma | 8 + packages/db/tsconfig.json | 4 + .../helpers.ts => packages/helpers/index.ts | 3 +- packages/helpers/package.json | 25 + packages/helpers/tsconfig.json | 4 + packages/stores/index.ts | 0 packages/stores/user.ts | 0 src/utils/types.ts => packages/types/index.ts | 4 +- packages/types/package.json | 24 + packages/types/tsconfig.json | 4 + .../validators/index.ts | 2 +- packages/validators/package.json | 20 + packages/validators/tsconfig.json | 4 + patches/react-native@0.70.5.patch | 50 + pnpm-lock.yaml | 10419 ++++++++++++++++ pnpm-workspace.yaml | 9 + prettier.config.cjs | 18 - src/components/differentletters.tsx | 1 - src/components/homebutton 2.tsx | 19 - src/components/settingsbutton 2.tsx | 19 - src/env.mjs | 76 - src/middleware.ts | 10 - src/pages/_app.tsx | 18 - src/pages/api/trpc/[trpc].ts | 19 - src/pages/done.tsx | 29 - src/pages/loadnext.tsx | 37 - src/pages/signin.tsx | 27 - src/pages/signup.tsx | 28 - src/server/api/context.ts | 22 - src/server/api/root.ts | 40 - src/server/api/routers/example.ts | 19 - src/server/api/trpc.ts | 109 - src/server/db.ts | 14 - src/utils/api.ts | 68 - src/utils/schema.ts | 17 - tailwind.config.cjs | 20 - tsconfig.json | 34 +- turbo.json | 39 +- vite.config.ts | 6 - vitest.config.ts | 11 - 206 files changed, 14327 insertions(+), 11881 deletions(-) delete mode 100644 .VSCodeCounter/2023-08-11_18-56-14/details.md delete mode 100644 .VSCodeCounter/2023-08-11_18-56-14/diff-details.md delete mode 100644 .VSCodeCounter/2023-08-11_18-56-14/diff.csv delete mode 100644 .VSCodeCounter/2023-08-11_18-56-14/diff.md delete mode 100644 .VSCodeCounter/2023-08-11_18-56-14/diff.txt delete mode 100644 .VSCodeCounter/2023-08-11_18-56-14/results.csv delete mode 100644 .VSCodeCounter/2023-08-11_18-56-14/results.json delete mode 100644 .VSCodeCounter/2023-08-11_18-56-14/results.md delete mode 100644 .VSCodeCounter/2023-08-11_18-56-14/results.txt delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.md delete mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/ci.yml delete mode 100644 .idea/.gitignore delete mode 100644 .idea/inspectionProfiles/Project_Default.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/speedread.iml delete mode 100644 .idea/vcs.xml create mode 100644 .npmrc create mode 100644 .prettierrc.cjs create mode 100644 .vscode/extensions.json create mode 100644 .vscode/settings.json create mode 100644 apps/expo/.expo-shared/assets.json create mode 100644 apps/expo/app.config.ts create mode 100644 apps/expo/assets/icon.png create mode 100644 apps/expo/babel.config.js create mode 100644 apps/expo/expo-plugins/with-modify-gradle.js create mode 100644 apps/expo/index.ts create mode 100644 apps/expo/metro.config.js create mode 100644 apps/expo/package.json create mode 100644 apps/expo/src/_app.tsx create mode 100644 apps/expo/src/components/SignInWithOAuth.tsx create mode 100644 apps/expo/src/hooks/useWarmUpBrowser.ts create mode 100644 apps/expo/src/screens/home.tsx create mode 100644 apps/expo/src/screens/signin.tsx create mode 100644 apps/expo/src/types/nativewind.d.ts create mode 100644 apps/expo/src/utils/cache.ts create mode 100644 apps/expo/src/utils/trpc.tsx create mode 100644 apps/expo/tailwind.config.cjs create mode 100644 apps/expo/tsconfig.json create mode 100644 apps/nextjs/.eslintrc.cjs create mode 100644 apps/nextjs/README.md create mode 100644 apps/nextjs/next-env.d.ts create mode 100644 apps/nextjs/next.config.mjs create mode 100644 apps/nextjs/package.json create mode 100644 apps/nextjs/postcss.config.cjs rename {public => apps/nextjs/public}/IRIS-LOGO.png (100%) rename {public => apps/nextjs/public}/Iris-butterfly.png (100%) rename {public => apps/nextjs/public}/flying-butterfly.gif (100%) rename {public => apps/nextjs/public}/home.png (100%) rename {public => apps/nextjs/public}/logo.png (100%) rename {public => apps/nextjs/public}/settings.png (100%) rename {public => apps/nextjs/public}/study-logo.png (100%) rename {src => apps/nextjs/src}/components/cubeflasher.tsx (90%) rename {src => apps/nextjs/src}/components/evensandodds.tsx (89%) rename {src => apps/nextjs/src}/components/flasherstartbutton.tsx (89%) rename {src => apps/nextjs/src}/components/flashingWordsNav.tsx (96%) rename {src => apps/nextjs/src}/components/flashingcell.tsx (92%) rename {src => apps/nextjs/src}/components/greendottext.tsx (100%) rename {src => apps/nextjs/src}/components/letterMatcher.tsx (92%) rename {src => apps/nextjs/src}/components/loadingspinner.tsx (100%) rename {src => apps/nextjs/src}/components/numbermatcher.tsx (94%) rename {src => apps/nextjs/src}/components/pietimer.tsx (88%) rename {src => apps/nextjs/src}/components/schultedraw.tsx (100%) rename {src => apps/nextjs/src}/components/schultetable.tsx (91%) rename {src => apps/nextjs/src}/components/sidebar.tsx (90%) rename {src => apps/nextjs/src}/components/speedtest.tsx (93%) rename {src => apps/nextjs/src}/components/tableswitcher.tsx (83%) rename {src => apps/nextjs/src}/components/tests/evensandodds.test.ts (100%) rename {src => apps/nextjs/src}/components/wordchanger.tsx (95%) rename {src => apps/nextjs/src}/components/wordpairs.tsx (86%) rename {src => apps/nextjs/src}/cva/cube-flasher.tsx (100%) rename {src => apps/nextjs/src}/cva/flashingStyles.tsx (100%) rename {src => apps/nextjs/src}/cva/fontProvider.tsx (100%) rename {src => apps/nextjs/src}/cva/highlightSelectorButton.tsx (100%) create mode 100644 apps/nextjs/src/env/client.mjs create mode 100644 apps/nextjs/src/env/schema.mjs create mode 100644 apps/nextjs/src/env/server.mjs rename {src => apps/nextjs/src}/hooks/useInterval.ts (100%) rename {src => apps/nextjs/src}/hooks/useIsVisible.ts (100%) rename {src => apps/nextjs/src}/hooks/useStopWatch.ts (100%) rename {src => apps/nextjs/src}/hooks/useTimer.ts (100%) create mode 100644 apps/nextjs/src/middleware.ts create mode 100644 apps/nextjs/src/pages/_app.tsx rename {src => apps/nextjs/src}/pages/admin/createquestion/done.tsx (100%) rename {src => apps/nextjs/src}/pages/admin/createquestion/index.tsx (100%) rename {src => apps/nextjs/src}/pages/admin/index.tsx (78%) rename {src => apps/nextjs/src}/pages/admin/testexercise.tsx (75%) create mode 100644 apps/nextjs/src/pages/api/trpc/[trpc].ts rename {src => apps/nextjs/src}/pages/exercises/boxes.tsx (84%) rename {src => apps/nextjs/src}/pages/exercises/cubebythree.tsx (74%) rename {src => apps/nextjs/src}/pages/exercises/cubebytwo.tsx (73%) rename {src => apps/nextjs/src}/pages/exercises/evennumbers.tsx (88%) rename {src => apps/nextjs/src}/pages/exercises/flashfourbyone.tsx (76%) rename {src => apps/nextjs/src}/pages/exercises/flashonebyone.tsx (77%) rename {src => apps/nextjs/src}/pages/exercises/flashonebytwo.tsx (76%) rename {src => apps/nextjs/src}/pages/exercises/flashtwobyone.tsx (76%) rename {src => apps/nextjs/src}/pages/exercises/flashtwobytwo.tsx (76%) rename {src => apps/nextjs/src}/pages/exercises/greendot.tsx (69%) rename {src => apps/nextjs/src}/pages/exercises/lettermatcher.tsx (70%) rename {src => apps/nextjs/src}/pages/exercises/numbermatcher.tsx (69%) rename {src => apps/nextjs/src}/pages/exercises/schultetable/by3.tsx (61%) rename {src => apps/nextjs/src}/pages/exercises/schultetable/by5.tsx (61%) rename {src => apps/nextjs/src}/pages/exercises/schultetable/by7.tsx (61%) rename {src => apps/nextjs/src}/pages/exercises/schultetable/index.tsx (72%) rename {src => apps/nextjs/src}/pages/exercises/speedtest/index.tsx (84%) rename {src => apps/nextjs/src}/pages/exercises/speedtest/question.tsx (92%) rename {src => apps/nextjs/src}/pages/exercises/speedtest/result.tsx (90%) rename {src => apps/nextjs/src}/pages/exercises/wordpairs.tsx (68%) rename {src => apps/nextjs/src}/pages/index.tsx (84%) rename {src => apps/nextjs/src}/pages/instructions/boxes.tsx (90%) rename {src => apps/nextjs/src}/pages/instructions/evennumbers.tsx (90%) rename {src => apps/nextjs/src}/pages/instructions/flashingwords/fourbyone.tsx (88%) rename {src => apps/nextjs/src}/pages/instructions/flashingwords/onebyone.tsx (91%) rename {src => apps/nextjs/src}/pages/instructions/flashingwords/onebytwo.tsx (87%) rename {src => apps/nextjs/src}/pages/instructions/flashingwords/twobyone.tsx (88%) rename {src => apps/nextjs/src}/pages/instructions/flashingwords/twobytwo.tsx (88%) rename {src => apps/nextjs/src}/pages/instructions/greendot.tsx (87%) rename {src => apps/nextjs/src}/pages/instructions/lettermatcher.tsx (90%) rename {src => apps/nextjs/src}/pages/instructions/numbermatcher.tsx (88%) rename {src => apps/nextjs/src}/pages/instructions/schultetable.tsx (90%) rename {src => apps/nextjs/src}/pages/instructions/speedtest.tsx (91%) rename {src => apps/nextjs/src}/pages/instructions/wordpairs.tsx (91%) rename {src => apps/nextjs/src}/pages/nav.tsx (86%) rename {src => apps/nextjs/src}/pages/next.tsx (84%) rename {src => apps/nextjs/src}/pages/settings.tsx (95%) rename {src => apps/nextjs/src}/pages/setup.tsx (100%) create mode 100644 apps/nextjs/src/pages/sign-in/[[...index]].tsx create mode 100644 apps/nextjs/src/pages/sign-up/[[...index]].tsx rename {src => apps/nextjs/src}/stores/useCubeStore.ts (100%) rename {src => apps/nextjs/src}/stores/useMutateUser.ts (100%) rename {src => apps/nextjs/src}/stores/usePairsStore.ts (100%) rename {src => apps/nextjs/src}/stores/useSpeedTestStore.ts (100%) rename {src => apps/nextjs/src}/stores/userStore.ts (95%) rename {src => apps/nextjs/src}/styles/globals.css (100%) create mode 100644 apps/nextjs/src/utils/trpc.ts create mode 100644 apps/nextjs/tailwind.config.cjs create mode 100644 apps/nextjs/tsconfig.json delete mode 100644 bable.config.js delete mode 100644 next.config.mjs delete mode 100644 package-lock.json create mode 100644 packages/api/index.ts create mode 100644 packages/api/package-lock.json create mode 100644 packages/api/package.json create mode 100644 packages/api/src/context.ts create mode 100644 packages/api/src/router/auth.ts create mode 100644 packages/api/src/router/builders.ts rename src/server/api/routers/collector.ts => packages/api/src/router/collection.ts (76%) rename src/server/api/routers/app.ts => packages/api/src/router/exercises.ts (53%) create mode 100644 packages/api/src/router/index.ts create mode 100644 packages/api/src/router/post.ts create mode 100644 packages/api/src/router/user.ts create mode 100644 packages/api/src/trpc.ts create mode 100644 packages/api/transformer.ts create mode 100644 packages/api/tsconfig.json create mode 100644 packages/config/tailwind/index.js create mode 100644 packages/config/tailwind/package.json rename postcss.config.cjs => packages/config/tailwind/postcss.js (58%) create mode 100644 packages/db/index.ts create mode 100644 packages/db/package-lock.json create mode 100644 packages/db/package.json rename {prisma => packages/db/prisma}/schema.prisma (97%) create mode 100644 packages/db/tsconfig.json rename src/utils/helpers.ts => packages/helpers/index.ts (97%) create mode 100644 packages/helpers/package.json create mode 100644 packages/helpers/tsconfig.json create mode 100644 packages/stores/index.ts create mode 100644 packages/stores/user.ts rename src/utils/types.ts => packages/types/index.ts (92%) create mode 100644 packages/types/package.json create mode 100644 packages/types/tsconfig.json rename src/utils/validators.ts => packages/validators/index.ts (99%) create mode 100644 packages/validators/package.json create mode 100644 packages/validators/tsconfig.json create mode 100644 patches/react-native@0.70.5.patch create mode 100644 pnpm-lock.yaml create mode 100644 pnpm-workspace.yaml delete mode 100644 prettier.config.cjs delete mode 100644 src/components/differentletters.tsx delete mode 100644 src/components/homebutton 2.tsx delete mode 100644 src/components/settingsbutton 2.tsx delete mode 100644 src/env.mjs delete mode 100644 src/middleware.ts delete mode 100644 src/pages/_app.tsx delete mode 100644 src/pages/api/trpc/[trpc].ts delete mode 100644 src/pages/done.tsx delete mode 100644 src/pages/loadnext.tsx delete mode 100644 src/pages/signin.tsx delete mode 100644 src/pages/signup.tsx delete mode 100644 src/server/api/context.ts delete mode 100644 src/server/api/root.ts delete mode 100644 src/server/api/routers/example.ts delete mode 100644 src/server/api/trpc.ts delete mode 100644 src/server/db.ts delete mode 100644 src/utils/api.ts delete mode 100644 src/utils/schema.ts delete mode 100644 tailwind.config.cjs delete mode 100644 vite.config.ts delete mode 100644 vitest.config.ts diff --git a/.VSCodeCounter/2023-08-11_18-56-14/details.md b/.VSCodeCounter/2023-08-11_18-56-14/details.md deleted file mode 100644 index 1b8dfed..0000000 --- a/.VSCodeCounter/2023-08-11_18-56-14/details.md +++ /dev/null @@ -1,89 +0,0 @@ -# Details - -Date : 2023-08-11 18:56:14 - -Directory /Users/jasonboyett/Documents/Coding/GitHub/speedread - -Total : 73 files, 13035 codes, 205 comments, 370 blanks, all 13610 lines - -[Summary](results.md) / Details / [Diff Summary](diff.md) / [Diff Details](diff-details.md) - -## Files - -| filename | language | code | comment | blank | total | -| :-------------------------------------------------------------------------------------- | :----------------- | ----: | ------: | ----: | ----: | -| [.eslintrc.cjs](/.eslintrc.cjs) | JavaScript | 33 | 2 | 3 | 38 | -| [README.md](/README.md) | Markdown | 3 | 0 | 3 | 6 | -| [bable.config.js](/bable.config.js) | JavaScript | 4 | 0 | 1 | 5 | -| [next.config.mjs](/next.config.mjs) | JavaScript | 10 | 11 | 3 | 24 | -| [package-lock.json](/package-lock.json) | JSON | 9,293 | 0 | 1 | 9,294 | -| [package.json](/package.json) | JSON | 81 | 0 | 1 | 82 | -| [postcss.config.cjs](/postcss.config.cjs) | JavaScript | 7 | 0 | 2 | 9 | -| [prettier.config.cjs](/prettier.config.cjs) | JavaScript | 16 | 1 | 2 | 19 | -| [prisma/schema.prisma](/prisma/schema.prisma) | Prisma | 138 | 0 | 23 | 161 | -| [src/components/cubeflasher.tsx](/src/components/cubeflasher.tsx) | TypeScript JSX | 210 | 2 | 12 | 224 | -| [src/components/evensandodds.tsx](/src/components/evensandodds.tsx) | TypeScript JSX | 190 | 0 | 18 | 208 | -| [src/components/flashingcell.tsx](/src/components/flashingcell.tsx) | TypeScript JSX | 308 | 4 | 26 | 338 | -| [src/components/globals.d.ts](/src/components/globals.d.ts) | TypeScript | 29 | 0 | 4 | 33 | -| [src/components/homebutton.tsx](/src/components/homebutton.tsx) | TypeScript JSX | 19 | 0 | 3 | 22 | -| [src/components/loadingspinner.tsx](/src/components/loadingspinner.tsx) | TypeScript JSX | 24 | 0 | 1 | 25 | -| [src/components/schultetable.tsx](/src/components/schultetable.tsx) | TypeScript JSX | 162 | 1 | 8 | 171 | -| [src/components/settingsbutton.tsx](/src/components/settingsbutton.tsx) | TypeScript JSX | 19 | 0 | 2 | 21 | -| [src/components/speedtest.tsx](/src/components/speedtest.tsx) | TypeScript JSX | 195 | 0 | 8 | 203 | -| [src/components/tests/evensandodds.test.ts](/src/components/tests/evensandodds.test.ts) | TypeScript | 92 | 0 | 5 | 97 | -| [src/components/wordchanger.tsx](/src/components/wordchanger.tsx) | TypeScript JSX | 76 | 1 | 10 | 87 | -| [src/cva/cube-flasher.tsx](/src/cva/cube-flasher.tsx) | TypeScript JSX | 32 | 0 | 5 | 37 | -| [src/cva/flashingStyles.tsx](/src/cva/flashingStyles.tsx) | TypeScript JSX | 38 | 0 | 5 | 43 | -| [src/cva/fontProvider.tsx](/src/cva/fontProvider.tsx) | TypeScript JSX | 36 | 0 | 5 | 41 | -| [src/cva/highlightSelectorButton.tsx](/src/cva/highlightSelectorButton.tsx) | TypeScript JSX | 66 | 0 | 6 | 72 | -| [src/env.mjs](/src/env.mjs) | JavaScript | 41 | 23 | 13 | 77 | -| [src/hooks/useInterval.ts](/src/hooks/useInterval.ts) | TypeScript | 19 | 2 | 4 | 25 | -| [src/hooks/useIsVisible.ts](/src/hooks/useIsVisible.ts) | TypeScript | 16 | 0 | 4 | 20 | -| [src/hooks/useSwitcher.ts](/src/hooks/useSwitcher.ts) | TypeScript | 94 | 0 | 10 | 104 | -| [src/middleware.ts](/src/middleware.ts) | TypeScript | 8 | 0 | 3 | 11 | -| [src/pages/\_app.tsx](/src/pages/_app.tsx) | TypeScript JSX | 14 | 0 | 3 | 17 | -| [src/pages/api/trpc/[trpc].ts](/src/pages/api/trpc/%5Btrpc%5D.ts) | TypeScript | 16 | 1 | 3 | 20 | -| [src/pages/done.tsx](/src/pages/done.tsx) | TypeScript JSX | 28 | 0 | 2 | 30 | -| [src/pages/exercises/cubebythree.tsx](/src/pages/exercises/cubebythree.tsx) | TypeScript JSX | 16 | 0 | 2 | 18 | -| [src/pages/exercises/cubebytwo.tsx](/src/pages/exercises/cubebytwo.tsx) | TypeScript JSX | 16 | 0 | 2 | 18 | -| [src/pages/exercises/evennumbers.tsx](/src/pages/exercises/evennumbers.tsx) | TypeScript JSX | 73 | 1 | 3 | 77 | -| [src/pages/exercises/flashfourbyone.tsx](/src/pages/exercises/flashfourbyone.tsx) | TypeScript JSX | 24 | 0 | 4 | 28 | -| [src/pages/exercises/flashonebyone.tsx](/src/pages/exercises/flashonebyone.tsx) | TypeScript JSX | 27 | 0 | 4 | 31 | -| [src/pages/exercises/flashonebytwo.tsx](/src/pages/exercises/flashonebytwo.tsx) | TypeScript JSX | 24 | 0 | 4 | 28 | -| [src/pages/exercises/flashtwobyone.tsx](/src/pages/exercises/flashtwobyone.tsx) | TypeScript JSX | 24 | 0 | 4 | 28 | -| [src/pages/exercises/flashtwobytwo.tsx](/src/pages/exercises/flashtwobytwo.tsx) | TypeScript JSX | 24 | 0 | 4 | 28 | -| [src/pages/exercises/schulteby3.tsx](/src/pages/exercises/schulteby3.tsx) | TypeScript JSX | 24 | 0 | 3 | 27 | -| [src/pages/exercises/schulteby5.tsx](/src/pages/exercises/schulteby5.tsx) | TypeScript JSX | 24 | 0 | 3 | 27 | -| [src/pages/exercises/schulteby7.tsx](/src/pages/exercises/schulteby7.tsx) | TypeScript JSX | 24 | 0 | 3 | 27 | -| [src/pages/exercises/speedtest.tsx](/src/pages/exercises/speedtest.tsx) | TypeScript JSX | 38 | 0 | 4 | 42 | -| [src/pages/exercises/wordchange.tsx](/src/pages/exercises/wordchange.tsx) | TypeScript JSX | 25 | 0 | 4 | 29 | -| [src/pages/index.tsx](/src/pages/index.tsx) | TypeScript JSX | 64 | 0 | 3 | 67 | -| [src/pages/loadnext.tsx](/src/pages/loadnext.tsx) | TypeScript JSX | 93 | 0 | 6 | 99 | -| [src/pages/nav.tsx](/src/pages/nav.tsx) | TypeScript JSX | 56 | 0 | 7 | 63 | -| [src/pages/next.tsx](/src/pages/next.tsx) | TypeScript JSX | 54 | 1 | 2 | 57 | -| [src/pages/settings.tsx](/src/pages/settings.tsx) | TypeScript JSX | 320 | 0 | 3 | 323 | -| [src/pages/setup.tsx](/src/pages/setup.tsx) | TypeScript JSX | 87 | 0 | 3 | 90 | -| [src/pages/signin.tsx](/src/pages/signin.tsx) | TypeScript JSX | 24 | 0 | 2 | 26 | -| [src/pages/signup.tsx](/src/pages/signup.tsx) | TypeScript JSX | 28 | 0 | 4 | 32 | -| [src/server/api/context.ts](/src/server/api/context.ts) | TypeScript | 0 | 22 | 1 | 23 | -| [src/server/api/root.ts](/src/server/api/root.ts) | TypeScript | 12 | 6 | 3 | 21 | -| [src/server/api/routers/app.ts](/src/server/api/routers/app.ts) | TypeScript | 123 | 0 | 7 | 130 | -| [src/server/api/routers/example.ts](/src/server/api/routers/example.ts) | TypeScript | 17 | 0 | 3 | 20 | -| [src/server/api/trpc.ts](/src/server/api/trpc.ts) | TypeScript | 43 | 56 | 11 | 110 | -| [src/server/db.ts](/src/server/db.ts) | TypeScript | 10 | 0 | 5 | 15 | -| [src/stores/useCubeStore.ts](/src/stores/useCubeStore.ts) | TypeScript | 18 | 0 | 5 | 23 | -| [src/stores/useMutateUser.ts](/src/stores/useMutateUser.ts) | TypeScript | 17 | 0 | 3 | 20 | -| [src/stores/userStore.ts](/src/stores/userStore.ts) | TypeScript | 19 | 6 | 5 | 30 | -| [src/styles/globals.css](/src/styles/globals.css) | CSS | 17 | 0 | 11 | 28 | -| [src/utils/api.ts](/src/utils/api.ts) | TypeScript | 30 | 32 | 7 | 69 | -| [src/utils/helpers.ts](/src/utils/helpers.ts) | TypeScript | 136 | 8 | 13 | 157 | -| [src/utils/schema.ts](/src/utils/schema.ts) | TypeScript | 16 | 0 | 3 | 19 | -| [src/utils/types.ts](/src/utils/types.ts) | TypeScript | 33 | 13 | 7 | 53 | -| [src/utils/validators.ts](/src/utils/validators.ts) | TypeScript | 70 | 0 | 6 | 76 | -| [tailwind.config.cjs](/tailwind.config.cjs) | JavaScript | 18 | 1 | 2 | 21 | -| [tsconfig.json](/tsconfig.json) | JSON with Comments | 29 | 6 | 1 | 36 | -| [turbo.json](/turbo.json) | JSON | 6 | 5 | 0 | 11 | -| [vite.config.ts](/vite.config.ts) | TypeScript | 5 | 0 | 2 | 7 | -| [vitest.config.ts](/vitest.config.ts) | TypeScript | 10 | 0 | 2 | 12 | - -[Summary](results.md) / Details / [Diff Summary](diff.md) / [Diff Details](diff-details.md) diff --git a/.VSCodeCounter/2023-08-11_18-56-14/diff-details.md b/.VSCodeCounter/2023-08-11_18-56-14/diff-details.md deleted file mode 100644 index 4216d3b..0000000 --- a/.VSCodeCounter/2023-08-11_18-56-14/diff-details.md +++ /dev/null @@ -1,16 +0,0 @@ -# Diff Details - -Date : 2023-08-11 18:56:14 - -Directory /Users/jasonboyett/Documents/Coding/GitHub/speedread - -Total : 0 files, 0 codes, 0 comments, 0 blanks, all 0 lines - -[Summary](results.md) / [Details](details.md) / [Diff Summary](diff.md) / Diff Details - -## Files - -| filename | language | code | comment | blank | total | -| :------- | :------- | ---: | ------: | ----: | ----: | - -[Summary](results.md) / [Details](details.md) / [Diff Summary](diff.md) / Diff Details diff --git a/.VSCodeCounter/2023-08-11_18-56-14/diff.csv b/.VSCodeCounter/2023-08-11_18-56-14/diff.csv deleted file mode 100644 index b7d8d75..0000000 --- a/.VSCodeCounter/2023-08-11_18-56-14/diff.csv +++ /dev/null @@ -1,2 +0,0 @@ -"filename", "language", "", "comment", "blank", "total" -"Total", "-", , 0, 0, 0 \ No newline at end of file diff --git a/.VSCodeCounter/2023-08-11_18-56-14/diff.md b/.VSCodeCounter/2023-08-11_18-56-14/diff.md deleted file mode 100644 index 7c043c2..0000000 --- a/.VSCodeCounter/2023-08-11_18-56-14/diff.md +++ /dev/null @@ -1,21 +0,0 @@ -# Diff Summary - -Date : 2023-08-11 18:56:14 - -Directory /Users/jasonboyett/Documents/Coding/GitHub/speedread - -Total : 0 files, 0 codes, 0 comments, 0 blanks, all 0 lines - -[Summary](results.md) / [Details](details.md) / Diff Summary / [Diff Details](diff-details.md) - -## Languages - -| language | files | code | comment | blank | total | -| :------- | ----: | ---: | ------: | ----: | ----: | - -## Directories - -| path | files | code | comment | blank | total | -| :--- | ----: | ---: | ------: | ----: | ----: | - -[Summary](results.md) / [Details](details.md) / Diff Summary / [Diff Details](diff-details.md) diff --git a/.VSCodeCounter/2023-08-11_18-56-14/diff.txt b/.VSCodeCounter/2023-08-11_18-56-14/diff.txt deleted file mode 100644 index 5f5b055..0000000 --- a/.VSCodeCounter/2023-08-11_18-56-14/diff.txt +++ /dev/null @@ -1,22 +0,0 @@ -Date : 2023-08-11 18:56:14 -Directory : /Users/jasonboyett/Documents/Coding/GitHub/speedread -Total : 0 files, 0 codes, 0 comments, 0 blanks, all 0 lines - -Languages -+----------+------------+------------+------------+------------+------------+ -| language | files | code | comment | blank | total | -+----------+------------+------------+------------+------------+------------+ -+----------+------------+------------+------------+------------+------------+ - -Directories -+------+------------+------------+------------+------------+------------+ -| path | files | code | comment | blank | total | -+------+------------+------------+------------+------------+------------+ -+------+------------+------------+------------+------------+------------+ - -Files -+----------+----------+------------+------------+------------+------------+ -| filename | language | code | comment | blank | total | -+----------+----------+------------+------------+------------+------------+ -| Total | | 0 | 0 | 0 | 0 | -+----------+----------+------------+------------+------------+------------+ \ No newline at end of file diff --git a/.VSCodeCounter/2023-08-11_18-56-14/results.csv b/.VSCodeCounter/2023-08-11_18-56-14/results.csv deleted file mode 100644 index a86c223..0000000 --- a/.VSCodeCounter/2023-08-11_18-56-14/results.csv +++ /dev/null @@ -1,75 +0,0 @@ -"filename", "language", "TypeScript JSX", "TypeScript", "JavaScript", "CSS", "JSON with Comments", "JSON", "Markdown", "Prisma", "comment", "blank", "total" -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/.eslintrc.cjs", "JavaScript", 0, 0, 33, 0, 0, 0, 0, 0, 2, 3, 38 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/README.md", "Markdown", 0, 0, 0, 0, 0, 0, 3, 0, 0, 3, 6 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/bable.config.js", "JavaScript", 0, 0, 4, 0, 0, 0, 0, 0, 0, 1, 5 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/next.config.mjs", "JavaScript", 0, 0, 10, 0, 0, 0, 0, 0, 11, 3, 24 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/package-lock.json", "JSON", 0, 0, 0, 0, 0, 9293, 0, 0, 0, 1, 9294 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/package.json", "JSON", 0, 0, 0, 0, 0, 81, 0, 0, 0, 1, 82 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/postcss.config.cjs", "JavaScript", 0, 0, 7, 0, 0, 0, 0, 0, 0, 2, 9 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/prettier.config.cjs", "JavaScript", 0, 0, 16, 0, 0, 0, 0, 0, 1, 2, 19 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/prisma/schema.prisma", "Prisma", 0, 0, 0, 0, 0, 0, 0, 138, 0, 23, 161 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/components/cubeflasher.tsx", "TypeScript JSX", 210, 0, 0, 0, 0, 0, 0, 0, 2, 12, 224 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/components/evensandodds.tsx", "TypeScript JSX", 190, 0, 0, 0, 0, 0, 0, 0, 0, 18, 208 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/components/flashingcell.tsx", "TypeScript JSX", 308, 0, 0, 0, 0, 0, 0, 0, 4, 26, 338 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/components/globals.d.ts", "TypeScript", 0, 29, 0, 0, 0, 0, 0, 0, 0, 4, 33 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/components/homebutton.tsx", "TypeScript JSX", 19, 0, 0, 0, 0, 0, 0, 0, 0, 3, 22 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/components/loadingspinner.tsx", "TypeScript JSX", 24, 0, 0, 0, 0, 0, 0, 0, 0, 1, 25 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/components/schultetable.tsx", "TypeScript JSX", 162, 0, 0, 0, 0, 0, 0, 0, 1, 8, 171 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/components/settingsbutton.tsx", "TypeScript JSX", 19, 0, 0, 0, 0, 0, 0, 0, 0, 2, 21 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/components/speedtest.tsx", "TypeScript JSX", 195, 0, 0, 0, 0, 0, 0, 0, 0, 8, 203 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/components/tests/evensandodds.test.ts", "TypeScript", 0, 92, 0, 0, 0, 0, 0, 0, 0, 5, 97 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/components/wordchanger.tsx", "TypeScript JSX", 76, 0, 0, 0, 0, 0, 0, 0, 1, 10, 87 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/cva/cube-flasher.tsx", "TypeScript JSX", 32, 0, 0, 0, 0, 0, 0, 0, 0, 5, 37 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/cva/flashingStyles.tsx", "TypeScript JSX", 38, 0, 0, 0, 0, 0, 0, 0, 0, 5, 43 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/cva/fontProvider.tsx", "TypeScript JSX", 36, 0, 0, 0, 0, 0, 0, 0, 0, 5, 41 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/cva/highlightSelectorButton.tsx", "TypeScript JSX", 66, 0, 0, 0, 0, 0, 0, 0, 0, 6, 72 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/env.mjs", "JavaScript", 0, 0, 41, 0, 0, 0, 0, 0, 23, 13, 77 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/hooks/useInterval.ts", "TypeScript", 0, 19, 0, 0, 0, 0, 0, 0, 2, 4, 25 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/hooks/useIsVisible.ts", "TypeScript", 0, 16, 0, 0, 0, 0, 0, 0, 0, 4, 20 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/hooks/useSwitcher.ts", "TypeScript", 0, 94, 0, 0, 0, 0, 0, 0, 0, 10, 104 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/middleware.ts", "TypeScript", 0, 8, 0, 0, 0, 0, 0, 0, 0, 3, 11 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/_app.tsx", "TypeScript JSX", 14, 0, 0, 0, 0, 0, 0, 0, 0, 3, 17 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/api/trpc/[trpc].ts", "TypeScript", 0, 16, 0, 0, 0, 0, 0, 0, 1, 3, 20 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/done.tsx", "TypeScript JSX", 28, 0, 0, 0, 0, 0, 0, 0, 0, 2, 30 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/cubebythree.tsx", "TypeScript JSX", 16, 0, 0, 0, 0, 0, 0, 0, 0, 2, 18 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/cubebytwo.tsx", "TypeScript JSX", 16, 0, 0, 0, 0, 0, 0, 0, 0, 2, 18 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/evennumbers.tsx", "TypeScript JSX", 73, 0, 0, 0, 0, 0, 0, 0, 1, 3, 77 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/flashfourbyone.tsx", "TypeScript JSX", 24, 0, 0, 0, 0, 0, 0, 0, 0, 4, 28 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/flashonebyone.tsx", "TypeScript JSX", 27, 0, 0, 0, 0, 0, 0, 0, 0, 4, 31 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/flashonebytwo.tsx", "TypeScript JSX", 24, 0, 0, 0, 0, 0, 0, 0, 0, 4, 28 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/flashtwobyone.tsx", "TypeScript JSX", 24, 0, 0, 0, 0, 0, 0, 0, 0, 4, 28 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/flashtwobytwo.tsx", "TypeScript JSX", 24, 0, 0, 0, 0, 0, 0, 0, 0, 4, 28 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/schulteby3.tsx", "TypeScript JSX", 24, 0, 0, 0, 0, 0, 0, 0, 0, 3, 27 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/schulteby5.tsx", "TypeScript JSX", 24, 0, 0, 0, 0, 0, 0, 0, 0, 3, 27 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/schulteby7.tsx", "TypeScript JSX", 24, 0, 0, 0, 0, 0, 0, 0, 0, 3, 27 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/speedtest.tsx", "TypeScript JSX", 38, 0, 0, 0, 0, 0, 0, 0, 0, 4, 42 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/wordchange.tsx", "TypeScript JSX", 25, 0, 0, 0, 0, 0, 0, 0, 0, 4, 29 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/index.tsx", "TypeScript JSX", 64, 0, 0, 0, 0, 0, 0, 0, 0, 3, 67 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/loadnext.tsx", "TypeScript JSX", 93, 0, 0, 0, 0, 0, 0, 0, 0, 6, 99 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/nav.tsx", "TypeScript JSX", 56, 0, 0, 0, 0, 0, 0, 0, 0, 7, 63 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/next.tsx", "TypeScript JSX", 54, 0, 0, 0, 0, 0, 0, 0, 1, 2, 57 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/settings.tsx", "TypeScript JSX", 320, 0, 0, 0, 0, 0, 0, 0, 0, 3, 323 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/setup.tsx", "TypeScript JSX", 87, 0, 0, 0, 0, 0, 0, 0, 0, 3, 90 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/signin.tsx", "TypeScript JSX", 24, 0, 0, 0, 0, 0, 0, 0, 0, 2, 26 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/signup.tsx", "TypeScript JSX", 28, 0, 0, 0, 0, 0, 0, 0, 0, 4, 32 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/server/api/context.ts", "TypeScript", 0, 0, 0, 0, 0, 0, 0, 0, 22, 1, 23 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/server/api/root.ts", "TypeScript", 0, 12, 0, 0, 0, 0, 0, 0, 6, 3, 21 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/server/api/routers/app.ts", "TypeScript", 0, 123, 0, 0, 0, 0, 0, 0, 0, 7, 130 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/server/api/routers/example.ts", "TypeScript", 0, 17, 0, 0, 0, 0, 0, 0, 0, 3, 20 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/server/api/trpc.ts", "TypeScript", 0, 43, 0, 0, 0, 0, 0, 0, 56, 11, 110 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/server/db.ts", "TypeScript", 0, 10, 0, 0, 0, 0, 0, 0, 0, 5, 15 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/stores/useCubeStore.ts", "TypeScript", 0, 18, 0, 0, 0, 0, 0, 0, 0, 5, 23 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/stores/useMutateUser.ts", "TypeScript", 0, 17, 0, 0, 0, 0, 0, 0, 0, 3, 20 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/stores/userStore.ts", "TypeScript", 0, 19, 0, 0, 0, 0, 0, 0, 6, 5, 30 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/styles/globals.css", "CSS", 0, 0, 0, 17, 0, 0, 0, 0, 0, 11, 28 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/utils/api.ts", "TypeScript", 0, 30, 0, 0, 0, 0, 0, 0, 32, 7, 69 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/utils/helpers.ts", "TypeScript", 0, 136, 0, 0, 0, 0, 0, 0, 8, 13, 157 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/utils/schema.ts", "TypeScript", 0, 16, 0, 0, 0, 0, 0, 0, 0, 3, 19 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/utils/types.ts", "TypeScript", 0, 33, 0, 0, 0, 0, 0, 0, 13, 7, 53 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/src/utils/validators.ts", "TypeScript", 0, 70, 0, 0, 0, 0, 0, 0, 0, 6, 76 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/tailwind.config.cjs", "JavaScript", 0, 0, 18, 0, 0, 0, 0, 0, 1, 2, 21 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/tsconfig.json", "JSON with Comments", 0, 0, 0, 0, 29, 0, 0, 0, 6, 1, 36 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/turbo.json", "JSON", 0, 0, 0, 0, 0, 6, 0, 0, 5, 0, 11 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/vite.config.ts", "TypeScript", 0, 5, 0, 0, 0, 0, 0, 0, 0, 2, 7 -"/Users/jasonboyett/Documents/Coding/GitHub/speedread/vitest.config.ts", "TypeScript", 0, 10, 0, 0, 0, 0, 0, 0, 0, 2, 12 -"Total", "-", 2506, 833, 129, 17, 29, 9380, 3, 138, 205, 370, 13610 \ No newline at end of file diff --git a/.VSCodeCounter/2023-08-11_18-56-14/results.json b/.VSCodeCounter/2023-08-11_18-56-14/results.json deleted file mode 100644 index d0cc137..0000000 --- a/.VSCodeCounter/2023-08-11_18-56-14/results.json +++ /dev/null @@ -1,440 +0,0 @@ -{ - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/signin.tsx": { - "language": "TypeScript JSX", - "code": 24, - "comment": 0, - "blank": 2 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/done.tsx": { - "language": "TypeScript JSX", - "code": 28, - "comment": 0, - "blank": 2 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/next.tsx": { - "language": "TypeScript JSX", - "code": 54, - "comment": 1, - "blank": 2 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/api/trpc/%5Btrpc%5D.ts": { - "language": "TypeScript", - "code": 16, - "comment": 1, - "blank": 3 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/_app.tsx": { - "language": "TypeScript JSX", - "code": 14, - "comment": 0, - "blank": 3 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/wordchange.tsx": { - "language": "TypeScript JSX", - "code": 25, - "comment": 0, - "blank": 4 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/cubebytwo.tsx": { - "language": "TypeScript JSX", - "code": 16, - "comment": 0, - "blank": 2 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/flashonebyone.tsx": { - "language": "TypeScript JSX", - "code": 27, - "comment": 0, - "blank": 4 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/evennumbers.tsx": { - "language": "TypeScript JSX", - "code": 73, - "comment": 1, - "blank": 3 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/flashtwobyone.tsx": { - "language": "TypeScript JSX", - "code": 24, - "comment": 0, - "blank": 4 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/flashtwobytwo.tsx": { - "language": "TypeScript JSX", - "code": 24, - "comment": 0, - "blank": 4 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/flashfourbyone.tsx": { - "language": "TypeScript JSX", - "code": 24, - "comment": 0, - "blank": 4 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/speedtest.tsx": { - "language": "TypeScript JSX", - "code": 38, - "comment": 0, - "blank": 4 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/schulteby5.tsx": { - "language": "TypeScript JSX", - "code": 24, - "comment": 0, - "blank": 3 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/schulteby7.tsx": { - "language": "TypeScript JSX", - "code": 24, - "comment": 0, - "blank": 3 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/cubebythree.tsx": { - "language": "TypeScript JSX", - "code": 16, - "comment": 0, - "blank": 2 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/schulteby3.tsx": { - "language": "TypeScript JSX", - "code": 24, - "comment": 0, - "blank": 3 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/flashonebytwo.tsx": { - "language": "TypeScript JSX", - "code": 24, - "comment": 0, - "blank": 4 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/setup.tsx": { - "language": "TypeScript JSX", - "code": 87, - "comment": 0, - "blank": 3 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/signup.tsx": { - "language": "TypeScript JSX", - "code": 28, - "comment": 0, - "blank": 4 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/loadnext.tsx": { - "language": "TypeScript JSX", - "code": 93, - "comment": 0, - "blank": 6 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/nav.tsx": { - "language": "TypeScript JSX", - "code": 56, - "comment": 0, - "blank": 7 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/index.tsx": { - "language": "TypeScript JSX", - "code": 64, - "comment": 0, - "blank": 3 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/settings.tsx": { - "language": "TypeScript JSX", - "code": 320, - "comment": 0, - "blank": 3 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/env.mjs": { - "language": "JavaScript", - "code": 41, - "comment": 23, - "blank": 13 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/cva/fontProvider.tsx": { - "language": "TypeScript JSX", - "code": 36, - "comment": 0, - "blank": 5 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/cva/flashingStyles.tsx": { - "language": "TypeScript JSX", - "code": 38, - "comment": 0, - "blank": 5 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/cva/cube-flasher.tsx": { - "language": "TypeScript JSX", - "code": 32, - "comment": 0, - "blank": 5 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/cva/highlightSelectorButton.tsx": { - "language": "TypeScript JSX", - "code": 66, - "comment": 0, - "blank": 6 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/hooks/useIsVisible.ts": { - "language": "TypeScript", - "code": 16, - "comment": 0, - "blank": 4 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/hooks/useInterval.ts": { - "language": "TypeScript", - "code": 19, - "comment": 2, - "blank": 4 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/hooks/useSwitcher.ts": { - "language": "TypeScript", - "code": 94, - "comment": 0, - "blank": 10 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/components/wordchanger.tsx": { - "language": "TypeScript JSX", - "code": 76, - "comment": 1, - "blank": 10 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/components/schultetable.tsx": { - "language": "TypeScript JSX", - "code": 162, - "comment": 1, - "blank": 8 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/components/settingsbutton.tsx": { - "language": "TypeScript JSX", - "code": 19, - "comment": 0, - "blank": 2 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/components/evensandodds.tsx": { - "language": "TypeScript JSX", - "code": 190, - "comment": 0, - "blank": 18 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/components/loadingspinner.tsx": { - "language": "TypeScript JSX", - "code": 24, - "comment": 0, - "blank": 1 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/components/homebutton.tsx": { - "language": "TypeScript JSX", - "code": 19, - "comment": 0, - "blank": 3 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/components/tests/evensandodds.test.ts": { - "language": "TypeScript", - "code": 92, - "comment": 0, - "blank": 5 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/components/cubeflasher.tsx": { - "language": "TypeScript JSX", - "code": 210, - "comment": 2, - "blank": 12 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/components/speedtest.tsx": { - "language": "TypeScript JSX", - "code": 195, - "comment": 0, - "blank": 8 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/components/flashingcell.tsx": { - "language": "TypeScript JSX", - "code": 308, - "comment": 4, - "blank": 26 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/components/globals.d.ts": { - "language": "TypeScript", - "code": 29, - "comment": 0, - "blank": 4 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/utils/validators.ts": { - "language": "TypeScript", - "code": 70, - "comment": 0, - "blank": 6 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/utils/api.ts": { - "language": "TypeScript", - "code": 30, - "comment": 32, - "blank": 7 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/utils/types.ts": { - "language": "TypeScript", - "code": 33, - "comment": 13, - "blank": 7 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/utils/helpers.ts": { - "language": "TypeScript", - "code": 136, - "comment": 8, - "blank": 13 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/utils/schema.ts": { - "language": "TypeScript", - "code": 16, - "comment": 0, - "blank": 3 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/server/db.ts": { - "language": "TypeScript", - "code": 10, - "comment": 0, - "blank": 5 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/server/api/context.ts": { - "language": "TypeScript", - "code": 0, - "comment": 22, - "blank": 1 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/styles/globals.css": { - "language": "CSS", - "code": 17, - "comment": 0, - "blank": 11 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/server/api/root.ts": { - "language": "TypeScript", - "code": 12, - "comment": 6, - "blank": 3 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/server/api/trpc.ts": { - "language": "TypeScript", - "code": 43, - "comment": 56, - "blank": 11 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/server/api/routers/example.ts": { - "language": "TypeScript", - "code": 17, - "comment": 0, - "blank": 3 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/stores/useCubeStore.ts": { - "language": "TypeScript", - "code": 18, - "comment": 0, - "blank": 5 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/stores/userStore.ts": { - "language": "TypeScript", - "code": 19, - "comment": 6, - "blank": 5 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/stores/useMutateUser.ts": { - "language": "TypeScript", - "code": 17, - "comment": 0, - "blank": 3 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/middleware.ts": { - "language": "TypeScript", - "code": 8, - "comment": 0, - "blank": 3 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/vite.config.ts": { - "language": "TypeScript", - "code": 5, - "comment": 0, - "blank": 2 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/tsconfig.json": { - "language": "JSON with Comments", - "code": 29, - "comment": 6, - "blank": 1 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/prettier.config.cjs": { - "language": "JavaScript", - "code": 16, - "comment": 1, - "blank": 2 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/vitest.config.ts": { - "language": "TypeScript", - "code": 10, - "comment": 0, - "blank": 2 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/package.json": { - "language": "JSON", - "code": 81, - "comment": 0, - "blank": 1 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/tailwind.config.cjs": { - "language": "JavaScript", - "code": 18, - "comment": 1, - "blank": 2 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/src/server/api/routers/app.ts": { - "language": "TypeScript", - "code": 123, - "comment": 0, - "blank": 7 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/.eslintrc.cjs": { - "language": "JavaScript", - "code": 33, - "comment": 2, - "blank": 3 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/bable.config.js": { - "language": "JavaScript", - "code": 4, - "comment": 0, - "blank": 1 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/postcss.config.cjs": { - "language": "JavaScript", - "code": 7, - "comment": 0, - "blank": 2 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/next.config.mjs": { - "language": "JavaScript", - "code": 10, - "comment": 11, - "blank": 3 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/README.md": { - "language": "Markdown", - "code": 3, - "comment": 0, - "blank": 3 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/prisma/schema.prisma": { - "language": "Prisma", - "code": 138, - "comment": 0, - "blank": 23 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/turbo.json": { - "language": "JSON", - "code": 6, - "comment": 5, - "blank": 0 - }, - "file:///Users/jasonboyett/Documents/Coding/GitHub/speedread/package-lock.json": { - "language": "JSON", - "code": 9293, - "comment": 0, - "blank": 1 - } -} diff --git a/.VSCodeCounter/2023-08-11_18-56-14/results.md b/.VSCodeCounter/2023-08-11_18-56-14/results.md deleted file mode 100644 index 34cd6fd..0000000 --- a/.VSCodeCounter/2023-08-11_18-56-14/results.md +++ /dev/null @@ -1,52 +0,0 @@ -# Summary - -Date : 2023-08-11 18:56:14 - -Directory /Users/jasonboyett/Documents/Coding/GitHub/speedread - -Total : 73 files, 13035 codes, 205 comments, 370 blanks, all 13610 lines - -Summary / [Details](details.md) / [Diff Summary](diff.md) / [Diff Details](diff-details.md) - -## Languages - -| language | files | code | comment | blank | total | -| :----------------- | ----: | ----: | ------: | ----: | ----: | -| JSON | 3 | 9,380 | 5 | 2 | 9,387 | -| TypeScript JSX | 36 | 2,506 | 10 | 188 | 2,704 | -| TypeScript | 23 | 833 | 146 | 116 | 1,095 | -| Prisma | 1 | 138 | 0 | 23 | 161 | -| JavaScript | 7 | 129 | 38 | 26 | 193 | -| JSON with Comments | 1 | 29 | 6 | 1 | 36 | -| CSS | 1 | 17 | 0 | 11 | 28 | -| Markdown | 1 | 3 | 0 | 3 | 6 | - -## Directories - -| path | files | code | comment | blank | total | -| :--------------------- | ----: | -----: | ------: | ----: | -----: | -| . | 73 | 13,035 | 205 | 370 | 13,610 | -| . (Files) | 13 | 9,515 | 26 | 23 | 9,564 | -| prisma | 1 | 138 | 0 | 23 | 161 | -| src | 59 | 3,382 | 179 | 324 | 3,885 | -| src (Files) | 2 | 49 | 23 | 16 | 88 | -| src/components | 11 | 1,324 | 8 | 97 | 1,429 | -| src/components (Files) | 10 | 1,232 | 8 | 92 | 1,332 | -| src/components/tests | 1 | 92 | 0 | 5 | 97 | -| src/cva | 4 | 172 | 0 | 21 | 193 | -| src/hooks | 3 | 129 | 2 | 18 | 149 | -| src/pages | 24 | 1,147 | 3 | 82 | 1,232 | -| src/pages (Files) | 10 | 768 | 1 | 35 | 804 | -| src/pages/api | 1 | 16 | 1 | 3 | 20 | -| src/pages/api/trpc | 1 | 16 | 1 | 3 | 20 | -| src/pages/exercises | 13 | 363 | 1 | 44 | 408 | -| src/server | 6 | 205 | 84 | 30 | 319 | -| src/server (Files) | 1 | 10 | 0 | 5 | 15 | -| src/server/api | 5 | 195 | 84 | 25 | 304 | -| src/server/api (Files) | 3 | 55 | 84 | 15 | 154 | -| src/server/api/routers | 2 | 140 | 0 | 10 | 150 | -| src/stores | 3 | 54 | 6 | 13 | 73 | -| src/styles | 1 | 17 | 0 | 11 | 28 | -| src/utils | 5 | 285 | 53 | 36 | 374 | - -Summary / [Details](details.md) / [Diff Summary](diff.md) / [Diff Details](diff-details.md) diff --git a/.VSCodeCounter/2023-08-11_18-56-14/results.txt b/.VSCodeCounter/2023-08-11_18-56-14/results.txt deleted file mode 100644 index c7e371d..0000000 --- a/.VSCodeCounter/2023-08-11_18-56-14/results.txt +++ /dev/null @@ -1,126 +0,0 @@ -Date : 2023-08-11 18:56:14 -Directory : /Users/jasonboyett/Documents/Coding/GitHub/speedread -Total : 73 files, 13035 codes, 205 comments, 370 blanks, all 13610 lines - -Languages -+--------------------+------------+------------+------------+------------+------------+ -| language | files | code | comment | blank | total | -+--------------------+------------+------------+------------+------------+------------+ -| JSON | 3 | 9,380 | 5 | 2 | 9,387 | -| TypeScript JSX | 36 | 2,506 | 10 | 188 | 2,704 | -| TypeScript | 23 | 833 | 146 | 116 | 1,095 | -| Prisma | 1 | 138 | 0 | 23 | 161 | -| JavaScript | 7 | 129 | 38 | 26 | 193 | -| JSON with Comments | 1 | 29 | 6 | 1 | 36 | -| CSS | 1 | 17 | 0 | 11 | 28 | -| Markdown | 1 | 3 | 0 | 3 | 6 | -+--------------------+------------+------------+------------+------------+------------+ - -Directories -+------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+ -| path | files | code | comment | blank | total | -+------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+ -| . | 73 | 13,035 | 205 | 370 | 13,610 | -| . (Files) | 13 | 9,515 | 26 | 23 | 9,564 | -| prisma | 1 | 138 | 0 | 23 | 161 | -| src | 59 | 3,382 | 179 | 324 | 3,885 | -| src (Files) | 2 | 49 | 23 | 16 | 88 | -| src/components | 11 | 1,324 | 8 | 97 | 1,429 | -| src/components (Files) | 10 | 1,232 | 8 | 92 | 1,332 | -| src/components/tests | 1 | 92 | 0 | 5 | 97 | -| src/cva | 4 | 172 | 0 | 21 | 193 | -| src/hooks | 3 | 129 | 2 | 18 | 149 | -| src/pages | 24 | 1,147 | 3 | 82 | 1,232 | -| src/pages (Files) | 10 | 768 | 1 | 35 | 804 | -| src/pages/api | 1 | 16 | 1 | 3 | 20 | -| src/pages/api/trpc | 1 | 16 | 1 | 3 | 20 | -| src/pages/exercises | 13 | 363 | 1 | 44 | 408 | -| src/server | 6 | 205 | 84 | 30 | 319 | -| src/server (Files) | 1 | 10 | 0 | 5 | 15 | -| src/server/api | 5 | 195 | 84 | 25 | 304 | -| src/server/api (Files) | 3 | 55 | 84 | 15 | 154 | -| src/server/api/routers | 2 | 140 | 0 | 10 | 150 | -| src/stores | 3 | 54 | 6 | 13 | 73 | -| src/styles | 1 | 17 | 0 | 11 | 28 | -| src/utils | 5 | 285 | 53 | 36 | 374 | -+------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+ - -Files -+------------------------------------------------------------------------------------------------+--------------------+------------+------------+------------+------------+ -| filename | language | code | comment | blank | total | -+------------------------------------------------------------------------------------------------+--------------------+------------+------------+------------+------------+ -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/.eslintrc.cjs | JavaScript | 33 | 2 | 3 | 38 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/README.md | Markdown | 3 | 0 | 3 | 6 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/bable.config.js | JavaScript | 4 | 0 | 1 | 5 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/next.config.mjs | JavaScript | 10 | 11 | 3 | 24 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/package-lock.json | JSON | 9,293 | 0 | 1 | 9,294 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/package.json | JSON | 81 | 0 | 1 | 82 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/postcss.config.cjs | JavaScript | 7 | 0 | 2 | 9 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/prettier.config.cjs | JavaScript | 16 | 1 | 2 | 19 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/prisma/schema.prisma | Prisma | 138 | 0 | 23 | 161 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/components/cubeflasher.tsx | TypeScript JSX | 210 | 2 | 12 | 224 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/components/evensandodds.tsx | TypeScript JSX | 190 | 0 | 18 | 208 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/components/flashingcell.tsx | TypeScript JSX | 308 | 4 | 26 | 338 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/components/globals.d.ts | TypeScript | 29 | 0 | 4 | 33 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/components/homebutton.tsx | TypeScript JSX | 19 | 0 | 3 | 22 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/components/loadingspinner.tsx | TypeScript JSX | 24 | 0 | 1 | 25 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/components/schultetable.tsx | TypeScript JSX | 162 | 1 | 8 | 171 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/components/settingsbutton.tsx | TypeScript JSX | 19 | 0 | 2 | 21 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/components/speedtest.tsx | TypeScript JSX | 195 | 0 | 8 | 203 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/components/tests/evensandodds.test.ts | TypeScript | 92 | 0 | 5 | 97 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/components/wordchanger.tsx | TypeScript JSX | 76 | 1 | 10 | 87 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/cva/cube-flasher.tsx | TypeScript JSX | 32 | 0 | 5 | 37 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/cva/flashingStyles.tsx | TypeScript JSX | 38 | 0 | 5 | 43 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/cva/fontProvider.tsx | TypeScript JSX | 36 | 0 | 5 | 41 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/cva/highlightSelectorButton.tsx | TypeScript JSX | 66 | 0 | 6 | 72 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/env.mjs | JavaScript | 41 | 23 | 13 | 77 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/hooks/useInterval.ts | TypeScript | 19 | 2 | 4 | 25 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/hooks/useIsVisible.ts | TypeScript | 16 | 0 | 4 | 20 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/hooks/useSwitcher.ts | TypeScript | 94 | 0 | 10 | 104 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/middleware.ts | TypeScript | 8 | 0 | 3 | 11 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/_app.tsx | TypeScript JSX | 14 | 0 | 3 | 17 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/api/trpc/[trpc].ts | TypeScript | 16 | 1 | 3 | 20 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/done.tsx | TypeScript JSX | 28 | 0 | 2 | 30 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/cubebythree.tsx | TypeScript JSX | 16 | 0 | 2 | 18 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/cubebytwo.tsx | TypeScript JSX | 16 | 0 | 2 | 18 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/evennumbers.tsx | TypeScript JSX | 73 | 1 | 3 | 77 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/flashfourbyone.tsx | TypeScript JSX | 24 | 0 | 4 | 28 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/flashonebyone.tsx | TypeScript JSX | 27 | 0 | 4 | 31 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/flashonebytwo.tsx | TypeScript JSX | 24 | 0 | 4 | 28 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/flashtwobyone.tsx | TypeScript JSX | 24 | 0 | 4 | 28 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/flashtwobytwo.tsx | TypeScript JSX | 24 | 0 | 4 | 28 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/schulteby3.tsx | TypeScript JSX | 24 | 0 | 3 | 27 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/schulteby5.tsx | TypeScript JSX | 24 | 0 | 3 | 27 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/schulteby7.tsx | TypeScript JSX | 24 | 0 | 3 | 27 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/speedtest.tsx | TypeScript JSX | 38 | 0 | 4 | 42 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/exercises/wordchange.tsx | TypeScript JSX | 25 | 0 | 4 | 29 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/index.tsx | TypeScript JSX | 64 | 0 | 3 | 67 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/loadnext.tsx | TypeScript JSX | 93 | 0 | 6 | 99 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/nav.tsx | TypeScript JSX | 56 | 0 | 7 | 63 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/next.tsx | TypeScript JSX | 54 | 1 | 2 | 57 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/settings.tsx | TypeScript JSX | 320 | 0 | 3 | 323 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/setup.tsx | TypeScript JSX | 87 | 0 | 3 | 90 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/signin.tsx | TypeScript JSX | 24 | 0 | 2 | 26 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/pages/signup.tsx | TypeScript JSX | 28 | 0 | 4 | 32 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/server/api/context.ts | TypeScript | 0 | 22 | 1 | 23 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/server/api/root.ts | TypeScript | 12 | 6 | 3 | 21 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/server/api/routers/app.ts | TypeScript | 123 | 0 | 7 | 130 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/server/api/routers/example.ts | TypeScript | 17 | 0 | 3 | 20 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/server/api/trpc.ts | TypeScript | 43 | 56 | 11 | 110 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/server/db.ts | TypeScript | 10 | 0 | 5 | 15 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/stores/useCubeStore.ts | TypeScript | 18 | 0 | 5 | 23 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/stores/useMutateUser.ts | TypeScript | 17 | 0 | 3 | 20 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/stores/userStore.ts | TypeScript | 19 | 6 | 5 | 30 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/styles/globals.css | CSS | 17 | 0 | 11 | 28 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/utils/api.ts | TypeScript | 30 | 32 | 7 | 69 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/utils/helpers.ts | TypeScript | 136 | 8 | 13 | 157 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/utils/schema.ts | TypeScript | 16 | 0 | 3 | 19 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/utils/types.ts | TypeScript | 33 | 13 | 7 | 53 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/src/utils/validators.ts | TypeScript | 70 | 0 | 6 | 76 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/tailwind.config.cjs | JavaScript | 18 | 1 | 2 | 21 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/tsconfig.json | JSON with Comments | 29 | 6 | 1 | 36 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/turbo.json | JSON | 6 | 5 | 0 | 11 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/vite.config.ts | TypeScript | 5 | 0 | 2 | 7 | -| /Users/jasonboyett/Documents/Coding/GitHub/speedread/vitest.config.ts | TypeScript | 10 | 0 | 2 | 12 | -| Total | | 13,035 | 205 | 370 | 13,610 | -+------------------------------------------------------------------------------------------------+--------------------+------------+------------+------------+------------+ \ No newline at end of file diff --git a/.env.example b/.env.example index 9a43ec3..9d3982b 100644 --- a/.env.example +++ b/.env.example @@ -1,14 +1,16 @@ -# Since the ".env" file is gitignored, you can use the ".env.example" file to -# build a new ".env" file when you clone the repo. Keep this file up-to-date -# when you add new variables to `.env`. +# Since .env is gitignored, you can use .env.example to build a new `.env` file when you clone the repo. +# Keep this file up-to-date when you add new variables to \`.env\`. -# This file will be committed to version control, so make sure not to have any -# secrets in it. If you are cloning this repo, create a copy of this file named -# ".env" and populate it with your secrets. +# This file will be committed to version control, so make sure not to have any secrets in it. +# If you are cloning this repo, create a copy of this file named `.env` and populate it with your secrets. -# When adding additional environment variables, the schema in "/src/env.mjs" -# should be updated accordingly. +# We use dotenv to load Prisma from Next.js' .env file +# @see https://www.prisma.io/docs/reference/database-reference/connection-urls +DATABASE_URL=file:./db.sqlite -# Prisma -# https://www.prisma.io/docs/reference/database-reference/connection-urls#env -DATABASE_URL='mysql://1mfaly70aqbq5rmbf74q:pscale_pw_cHymijLKKkUlBHggKM1l1k7sr4DhbXEGjSLg62GjhjZ@aws.connect.psdb.cloud/speedread?sslaccept=strict' +# CLERK is used for authentication and authorization in the app +# @see https://dashboard.clerk.dev for your Clerk API keys +# +### NEW KEYS FOR APPS AFTER 1/18/2023 +NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_XXXXXXXXXXXXXXXXXXXX +CLERK_SECRET_KEY=sk_test_XXXXXXXXXXXXXXXXXXXXXXXX diff --git a/.eslintrc.cjs b/.eslintrc.cjs index bdcf2d5..da522dc 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,25 +1,16 @@ -// eslint-disable-next-line @typescript-eslint/no-var-requires -const path = require('path') - /** @type {import("eslint").Linter.Config} */ -const config = { - overrides: [ - { - extends: [ - 'plugin:@typescript-eslint/recommended-requiring-type-checking', - ], - files: ['*.ts', '*.tsx'], - parserOptions: { - project: path.join(__dirname, 'tsconfig.json'), - }, - }, - ], - parser: '@typescript-eslint/parser', +module.exports = { + root: true, + parser: "@typescript-eslint/parser", parserOptions: { - project: path.join(__dirname, 'tsconfig.json'), + tsconfigRootDir: __dirname, + project: [ + "./tsconfig.json", + "./apps/*/tsconfig.json", + "./packages/*/tsconfig.json", + ], }, - plugins: ['@typescript-eslint'], - extends: ['next/core-web-vitals', 'plugin:@typescript-eslint/recommended'], + plugins: ["@typescript-eslint"], rules: { 'react-hooks/exhaustive-deps': 'off', '@typescript-eslint/consistent-type-imports': [ @@ -31,7 +22,5 @@ const config = { ], '@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }], '@typescript-eslint/no-unsafe-member-access': 'warn', - }, -} - -module.exports = config + }, extends: ["plugin:@typescript-eslint/recommended"], +}; diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 29cd8f4..d9c2732 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,8 +1,8 @@ --- name: Bug report about: Create a report to help us improve -title: "[BUG]" -labels: '' +title: '' +labels: bug assignees: '' --- @@ -11,7 +11,7 @@ assignees: '' A clear and concise description of what the bug is. **To Reproduce** -Steps to reproduce the behavior : +Steps to reproduce the behavior: 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' @@ -20,10 +20,13 @@ Steps to reproduce the behavior : **Expected behavior** A clear and concise description of what you expected to happen. +**Logs** +Please provide logs showing the error. + **Screenshots** If applicable, add screenshots to help explain your problem. -**Web (please complete the following information):** +**Desktop (please complete the following information):** - OS: [e.g. iOS] - Browser [e.g. chrome, safari] - Version [e.g. 22] @@ -34,11 +37,5 @@ If applicable, add screenshots to help explain your problem. - Browser [e.g. stock browser, safari] - Version [e.g. 22] -**Tablet (please complete the following information):** - - Device: [e.g. iPad Air] - - OS: [e.g. iOS8.1] - - Browser [e.g. stock browser, safari] - - Version [e.g. 22] - **Additional context** Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index bbcbbe7..0000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: '' -assignees: '' - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index a47604a..0000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,16 +0,0 @@ -#### Motivation -> Why is this change necessary? What problem does it solve? - -> If this is related to an issue which one? - -Closes #ISSUE_NUMBER - -#### Implementation -> How does this PR solve the problem? What technical approach is taken? - -#### Testing -> How did you verify that this works? Were automated tests written? -> What manual tests were performed? - -#### Related PRs -> Optional: if any other PRs provide context to this change diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..69c05f0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,62 @@ +name: CI + +on: + pull_request: + branches: ["*"] + push: + branches: ["main"] + +# You can leverage Vercel Remote Caching with Turbo to speed up your builds +# @link https://turborepo.org/docs/core-concepts/remote-caching#remote-caching-on-vercel-builds +env: + TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} + TURBO_TEAM: ${{ secrets.TURBO_TEAM }} + NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: ${{secrets.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY}} + CLERK_SECRET_KEY: ${{secrets.CLERK_SECRET_KEY}} + + +jobs: + build-lint: + env: + DATABASE_URL: file:./db.sqlite + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - name: Setup pnpm + uses: pnpm/action-setup@v2.2.4 + + - name: Setup Node 18 + uses: actions/setup-node@v3 + with: + node-version: 18 + + - name: Get pnpm store directory + id: pnpm-cache + run: | + echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT + + - name: Setup pnpm cache + uses: actions/cache@v3 + with: + path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install deps (with cache) + run: pnpm install + + - name: Next.js cache + uses: actions/cache@v3 + with: + path: ${{ github.workspace }}apps/nextjs/.next/cache + key: ${{ runner.os }}-${{ runner.node }}-${{ hashFiles('**/pnpm-lock.yaml') }}-nextjs + + - name: Build, lint and type-check + run: pnpm turbo build lint type-check + + - name: Check workspaces + run: pnpm manypkg check diff --git a/.gitignore b/.gitignore index 337f440..55fb5b0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,24 +1,27 @@ # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. # dependencies -/node_modules -/.pnp +node_modules +.pnp .pnp.js # testing -/coverage +coverage # database -/prisma/db.sqlite -/prisma/db.sqlite-journal +prisma/db.sqlite +prisma/db.sqlite-journal # next.js -/.next/ -/out/ -next-env.d.ts +.next/ +out/ + +# expo +.expo/ +dist/ # production -/build +build # misc .DS_Store @@ -31,7 +34,6 @@ yarn-error.log* .pnpm-debug.log* # local env files -# do not commit any .env files to git, except for the .env.example file. https://create.t3.gg/en/usage/env-variables#using-environment-variables .env .env*.local @@ -41,8 +43,5 @@ yarn-error.log* # typescript *.tsbuildinfo -# editor -.vscode - # turbo .turbo diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index b58b603..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index 03d9549..0000000 --- a/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 0633606..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/speedread.iml b/.idea/speedread.iml deleted file mode 100644 index 24643cc..0000000 --- a/.idea/speedread.iml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 35eb1dd..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..e165d81 --- /dev/null +++ b/.npmrc @@ -0,0 +1,12 @@ +# Expo doesn't play nice with pnpm by default. +# The symbolic links of pnpm break the rules of Expo monorepos. +# @link https://docs.expo.dev/guides/monorepos/#common-issues +node-linker=hoisted + +# In order to cache Prisma correctly +public-hoist-pattern[]=*prisma* + +# FIXME: @prisma/client is required by the @acme/auth, +# but we don't want it installed there since it's already +# installed in the @acme/db package +strict-peer-dependencies=false diff --git a/.prettierrc.cjs b/.prettierrc.cjs new file mode 100644 index 0000000..b704e6a --- /dev/null +++ b/.prettierrc.cjs @@ -0,0 +1,12 @@ +/** @type {import("prettier").Config} */ +module.exports = { + arrowParens: "always", + printWidth: 80, + singleQuote: false, + jsxSingleQuote: false, + semi: true, + trailingComma: "all", + tabWidth: 2, + plugins: [require.resolve("prettier-plugin-tailwindcss")], + tailwindConfig: "./packages/config/tailwind", +}; diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..4487d71 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,8 @@ +{ + "recommendations": [ + "esbenp.prettier-vscode", + "dbaeumer.vscode-eslint", + "bradlc.vscode-tailwindcss", + "Prisma.prisma" + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..f974f61 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,9 @@ +{ + "editor.codeActionsOnSave": { + "source.fixAll.eslint": true + }, + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true, + "eslint.rules.customizations": [{ "rule": "*", "severity": "warn" }], + "typescript.tsdk": "node_modules/typescript/lib" +} diff --git a/README.md b/README.md index ef9392e..dc2b5ad 100644 --- a/README.md +++ b/README.md @@ -1,215 +1,205 @@ -# Project Iris Official Repo - -![Iris Logo](/public/IRIS-LOGO.png) - -Iris is a speed reading training application. It is deigned to be used as part of -an academic study on the effects of speed reading training on reading and academic -performance. -To facilitate this study, Iris is designed to collect data on the study -participants and their usage of the application. - -### Check out the current production version [here.](https://project-iris.app) ---- - - -## Core Project Dependencies - -- Iris uses the [t3 stack](https://create.t3.gg/) - - [TypeScript](https://www.typescriptlang.org/) - - [Tailwind CSS](https://tailwindcss.com/) - - [Trpc](https://trpc.io/) - - [Next.js](https://nextjs.org/) - - [React](https://reactjs.org/) - - [Vercel](https://vercel.com/) -- [Zustand](https://zustand-demo.pmnd.rs/) for state management, -- [Clerk](https://clerk.com/) for authentication, -- [Class Variance Authority](https://cva.style/docs) for reusable styling, -- [Planet Scale](https://planetscale.com/) for our database. -- Iris also uses various chron jobs written in [Go](https://go.dev/) to handle various database operations that cannot be hosted on the public repository. - - -## Project Structure - -### Basic Usage -```mermaid ---- -title: Daily use ---- -graph LR - index[Home Page] -- Clerk Authentication --> nav{Navigation Page} - nav -- If weekly test is done --> exercise(random exercise) - nav -- If weekly test is not done --> test(Weekly test) --> exercise - exercise -- If there are still remaining exercises --> exercise - exercise -- If all exercises are completed --> done(Done for the day) --> nav - nav -- If user is an administrator --> admin(Admin Page) - exercise --sends exercise data --> db[(Database)] -``` - -### System Architecture -```mermaid ---- -title: Data flow ---- - -sequenceDiagram - actor user - participant Client - participant Server - participant DB - participant Auth - participant Chron - participant Third Party API - - user ->> Client: Logs in - Client ->> Auth: sends request - Auth -->> Client: returns cookie - Auth -->> Server: sends cookie - Client ->> Server: Requests user info through tRPC - Server ->> DB: requests user info through prisma - DB -->> Server: returns user info as SQL string that is parsed by prisma - Server -->> Client: returns user info through tRPC - Client ->> Server: requests exercise data - Server ->> Third Party API: requests data - Third Party API -->> Server: returns data - Server ->> DB: requests data - DB -->> Server: returns data - Chron ->> DB: resets all user's "tested" values to "false" at the beginning of the week - Client -->> user: Serves daily exercises until all are complete. - Client ->> Server: Sends exercise data through tRPC - Server ->> DB: Sends exercise data through prisma - Client ->> Client: Maintains state with Zustand +[![CI](https://github.com/perkinsjr/t3-turbo-and-clerk/actions/workflows/ci.yml/badge.svg)](https://github.com/perkinsjr/t3-turbo-and-clerk/actions/workflows/ci.yml) -``` +# Create T3 Turbo with Clerk Authentication -### Understanding the file structure +## Clerk Dashboard Setup -Iris uses the pages router provided by Next.js. The [pages](src/pages) directory contains all -the routs for the application. The pages are divided into instructions, exercises, -and admin routes as well some miscellaneous routes listed directly in the pages directory. +For this template to work you need to enable Discord as an OAuth provider. You can find the social options under `User & Authentication / Social Providers` in the [Clerk Dashboard](https://dashboard.clerk.dev) -The [server](src/server) directory is a part of the Next.js framework and it contains -all the serverless functions used by the application. +> If you change any setting here outside of adding Discord, you may need to update your Expo code to handle any requirements you change. -The [components](src/components) directory contains various reusable components used -throughout the application. +It uses [Turborepo](https://turborepo.org/) and contains: -The [cva](src/cva) directory contains the -class variance authority styles used throughout the application. +## Code Layout -The [hooks](src/hooks) directory contains all custom hooks used in the application. +``` +.github + └─ workflows + └─ CI with pnpm cache setup +.vscode + └─ Recommended extensions and settings for VSCode users +apps + ├─ expo + └─ next.js + ├─ Next.js 13 + ├─ React 18 + └─ E2E Typesafe API Server & Client +packages + ├─ api + | └─ tRPC v10 router definition + └─ db + └─ typesafe db-calls using Prisma +``` -The [stores](src/stores) directory contains Zustand stores. +## Quick Start -The [utils](src/utils) directory contains utility functions, types and Zod schemas. +To get it running, follow the steps below: -## Project Authors -- Primary Developer: [Jason Boyett](https://GitHub.com/JasonBoyett) -- Project Manager: [Dr. Vojislav Petrovic PhD](https://schreiner.edu/su-directory/petrovic-vojislav/) -- UI Designer: Jason Boyett & [Zach Lyman](https://limeademedia.com) +### Setup dependencies -## Contributing +```diff +# Install dependencies +pnpm i -### Getting a foothold -The best entry point for the project is the [pages](src/pages) directory. -[Index.tsx](src/pages/index.tsx) Is the home page of the web sight but the main page of the app is [Nav](src/pages/nav.tsx). -From there you can view the individual exercises by viewing the [exercises](src/pages/exercises) directory. -Most exercises consist of some basic setup and a call to a primary component. Said components can be found in the [components directory](src/components). -### Running the project locally -To run the project locally you will neet to have [Node.js](https://nodejs.org/en/) installed. -Once you have Node.js installed, clone the repository and run `npm install` to install all the dependencies. -You will need some environment variables to run the project locally. -These will be: +# Configure environment variables. +# There is an `.env.example` in the root directory you can use for reference +cp .env.example .env -- DATABASE_URL - - This is the connection point to the database. - - You can get by creating a planet scale database and copying the connection string. -- NEXT_PUBLIC_CLERK_FRONTEND_API - - This is the public API key for the Clerk authentication service. - - You can get this by creating a Clerk account and creating a project. -- NEXT_PUBLIC_CLERK_SIGN_IN_URL - - This is the URL for the Clerk sign in page. - - You can get this by creating a Clerk account and creating a project. +# Push the Prisma schema to your database +pnpm db-push +``` -If you would like to use the production database -and clerk project you can contact the project author for access. -You will need to make significant contributions before you will be -considered for access to the production database and clerk project. +### Configure Expo app -Once you have the environment variables set up you will need to initialize -your development database by running `npx prisma db push` to view the database -database contents run `npx prisma studio` and navigate to `localhost:5555` in your browser. +Expo doesn't use the .env for the publishable key, so you will need to go to `apps/expo/app.config.ts` and add it there. -You can now run the project using either: +``` +const CLERK_PUBLISHABLE_KEY = "your-clerk-publishable-key"; -npm -```bash -npm run dev ``` -or turbo -```bash -turbo dev + +### Configure Expo `dev`-script + +> **Note:** If you want to use a physical phone with Expo Go, just run `pnpm dev` and scan the QR-code. + +#### Use iOS Simulator + +1. Make sure you have XCode and XCommand Line Tools installed [as shown on expo docs](https://docs.expo.dev/workflow/ios-simulator/). +2. Change the `dev` script at `apps/expo/package.json` to open the iOS simulator. + +```diff ++ "dev": "expo start --ios", ``` -Both of these commands will start the project and default to port 3000. +3. Run `pnpm dev` at the project root folder. -Before attempting to submit your pull request please run the following commands -```bash -prettier --write . -turbo build lint +#### For Android + +1. Install Android Studio tools [as shown on expo docs](https://docs.expo.dev/workflow/android-studio-emulator/). +2. Change the `dev` script at `apps/expo/package.json` to open the Android emulator. + +```diff ++ "dev": "expo start --android", ``` -This will ensure that your code is formatted correctly and will build in production. -### Code Style -If you are taking the time to contribute to the development of Iris we greatly appreciate your contribution. -In order to keep the code consistent there are a few things we ask. +3. Run `pnpm dev` at the project root folder. + +## Deployment + +### Next.js + +> Note if you are building locallly you will need to insert your env correctly, for example using `pnpm with-env next build` + +#### Prerequisites + +_We do not recommend deploying a SQLite database on serverless environments since the data wouldn't be persisted. I provisioned a quick Postgresql database on [Railway](https://railway.app), but you can of course use any other database provider. Make sure the prisma schema is updated to use the correct database._ + +#### Deploy to Vercel + +Let's deploy the Next.js application to [Vercel](https://vercel.com/). If you have ever deployed a Turborepo app there, the steps are quite straightforward. You can also read the [official Turborepo guide](https://vercel.com/docs/concepts/monorepos/turborepo) on deploying to Vercel. + +1. Create a new project on Vercel, select the `apps/nextjs` folder as the root directory and apply the following build settings: + +Vercel deployment settings + +> The install command filters out the expo package and saves a few second (and cache size) of dependency installation. The build command makes us build the application using Turbo. + +2. Add your `DATABASE_URL`,`NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` and `CLERK_SECRET_KEY` environment variable. + +3. Done! Your app should successfully deploy. Assign your domain and use that instead of `localhost` for the `url` in the Expo app so that your Expo app can communicate with your backend when you are not in development. + +### Expo + +Deploying your Expo application works slightly differently compared to Next.js on the web. Instead of "deploying" your app online, you need to submit production builds of your app to the app stores, like [Apple App Store](https://www.apple.com/app-store/) and [Google Play](https://play.google.com/store/apps). You can read the full [Distributing your app](https://docs.expo.dev/distribution/introduction/), including best practices, in the Expo docs. + +1. Let's start by setting up [EAS Build](https://docs.expo.dev/build/introduction/), which is short for Expo Application Services. The build service helps you create builds of your app, without requiring a full native development setup. The commands below are a summary of [Creating your first build](https://docs.expo.dev/build/setup/). + + ```bash + // Install the EAS CLI + $ pnpm add -g eas-cli + + // Log in with your Expo account + $ eas login + + // Configure your Expo app + $ cd apps/expo + $ eas build:configure + ``` + +2. After the initial setup, you can create your first build. You can build for Android and iOS platforms and use different [**eas.json** build profiles](https://docs.expo.dev/build-reference/eas-json/) to create production builds or development, or test builds. Let's make a production build for iOS. + + ``` + $ eas build --platform ios --profile production + ``` + + > If you don't specify the `--profile` flag, EAS uses the `production` profile by default. + +3. Now that you have your first production build, you can submit this to the stores. [EAS Submit](https://docs.expo.dev/submit/introduction/) can help you send the build to the stores. + + ``` + $ eas submit --platform ios --latest + ``` + + > You can also combine build and submit in a single command, using `eas build ... --auto-submit`. + +4. Before you can get your app in the hands of your users, you'll have to provide additional information to the app stores. This includes screenshots, app information, privacy policies, etc. _While still in preview_, [EAS Metadata](https://docs.expo.dev/eas/metadata/) can help you with most of this information. + +5. If you're using OAuth social providers with Clerk, for instance Google, Apple, Facebook, etc..., you must whitelist your own OAuth redirect URL for the Expo application in the Clerk Dashboard. + + In `apps/expo/app.config.ts`, add a `scheme` that will be used to identify your standalone app. + + ```ts + import { ExpoConfig, ConfigContext } from "@expo/config"; + + const CLERK_PUBLISHABLE_KEY = "your-clerk-publishable-key"; + + const defineConfig = (_ctx: ConfigContext): ExpoConfig => ({ + name: "expo", + slug: "expo", + scheme: "your-app-scheme", + // ... + }); + ``` + + Then, in the [Clerk Dashboard](https://dashboard.clerk.dev/), go to **User & Authentication > Social Connections > Settings** and add your app's scheme and redirect URL to the **Redirect URLs** field: + + ```txt + your-app-scheme://oauth-native-callback + ``` + + Here, `your-app-scheme` corresponds to the `scheme` defined in `app.config.ts`, and `oauth-native-callback` corresponds to the redirect URL defined when authenticating with social providers. See [SignInWithOAuth.tsx](/apps/expo/src/components/SignInWithOAuth.tsx) for reference. -- If you can, keep lines under 100 characters. - - consider setting a guide line in your editor - - some times long lines are unavoidable. We won't reject a pr over this issue. -- We prefer most functions to be declared using the `function myFunction(){}` syntax as opposed to arrow functions. - - the exception is when you are passing an inline function as a parameter. In this case please use arrow functions. -- We prefer functional components and react hooks as opposed to class components. -- Limit comments. - - We prefer where possible code to be self documenting. - - JS doc comments do not count. - - If you are exporting a function or a class feel free to add any documentation you deem necessary. -- Limit single line if statements. - - accept in certain cases please add brackets after if statements even if they are only a single line. - - the exception is if you are checking the condition and immediately breaking the current scope. For example: - - ```tsx - if(!condition) return - ``` -- Where possible apply single responsibility principle. + > You can find more information about this in the [Expo documentation](https://docs.expo.dev/versions/latest/sdk/auth-session/#redirecting-to-your-app). -### Submitting a Pull Request -If you are not familiar with the process of submitting a pull request we suggest you check out the [docs](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request) provided by GitHub. + You should now be able to sign in with your social providers in the TestFlight application build. -We ask that your pull request have the following information: +6. Once everything is approved, your users can finally enjoy your app. Let's say you spotted a small typo; you'll have to create a new build, submit it to the stores, and wait for approval before you can resolve this issue. In these cases, you can use EAS Update to quickly send a small bugfix to your users without going through this long process. Let's start by setting up EAS Update. -#### Motivation -> Why is this change necessary? What problem does it solve? + The steps below summarize the [Getting started with EAS Update](https://docs.expo.dev/eas-update/getting-started/#configure-your-project) guide. -> If this is related to an issue which one? + ```bash + // Add the `expo-updates` library to your Expo app + $ cd apps/expo + $ pnpm expo install expo-updates -Closes #ISSUE_NUMBER + // Configure EAS Update + $ eas update:configure + ``` -#### Implementation -> How does this PR solve the problem? What technical approach is taken? +6. Before we can send out updates to your app, you have to create a new build and submit it to the app stores. For every change that includes native APIs, you have to rebuild the app and submit the update to the app stores. See steps 2 and 3. -#### Testing -> How did you verify that this works? Were automated tests written? -> What manual tests were performed? +7. Now that everything is ready for updates, let's create a new update for `production` builds. With the `--auto` flag, EAS Update uses your current git branch name and commit message for this update. See [How EAS Update works](https://docs.expo.dev/eas-update/how-eas-update-works/#publishing-an-update) for more information. -#### Related PRs -> Optional: if any other PRs provide context to this change + ```bash + $ cd apps/expo + $ eas update --auto + ``` -If your pull request does not have this information or some equivalent attached it will be rejected without further consideration. + > Your OTA (Over The Air) updates must always follow the app store's rules. You can't change your app's primary functionality without getting app store approval. But this is a fast way to update your app for minor changes and bug fixes. -### Issues -If you don't want to contribute directly or don't feel ready to file a pull request you are welcome to contribute by filing issues. +8. Done! Now that you have created your production build, submitted it to the stores, and installed EAS Update, you are ready for anything! -We want Iris to be as great of an experience as possible and the only way for us to accomplish that is to get feedback. Please if you see a problem, let us know! +## References -If you don't know how to file an issue here is a [guide](https://docs.github.com/en/issues/tracking-your-work-with-issues/creating-an-issue) from GitHub. +The stack originates from [create-t3-turbo](https://github.com/t3-oss/create-t3-turbo). diff --git a/apps/expo/.expo-shared/assets.json b/apps/expo/.expo-shared/assets.json new file mode 100644 index 0000000..1e6decf --- /dev/null +++ b/apps/expo/.expo-shared/assets.json @@ -0,0 +1,4 @@ +{ + "12bb71342c6255bbf50437ec8f4441c083f47cdb74bd89160c15e4f43e52a1cb": true, + "40b842e832070c58deac6aa9e08fa459302ee3f9da492c7e77d93d2fbf4a56fd": true +} diff --git a/apps/expo/app.config.ts b/apps/expo/app.config.ts new file mode 100644 index 0000000..673d844 --- /dev/null +++ b/apps/expo/app.config.ts @@ -0,0 +1,40 @@ +import { ExpoConfig, ConfigContext } from "@expo/config"; + +const CLERK_PUBLISHABLE_KEY = "your-clerk-publishable-key"; + +const defineConfig = (_ctx: ConfigContext): ExpoConfig => ({ + name: "expo", + slug: "expo", + version: "1.0.0", + orientation: "portrait", + icon: "./assets/icon.png", + userInterfaceStyle: "light", + splash: { + image: "./assets/icon.png", + resizeMode: "contain", + backgroundColor: "#2e026d", + }, + updates: { + fallbackToCacheTimeout: 0, + }, + assetBundlePatterns: ["**/*"], + ios: { + supportsTablet: true, + bundleIdentifier: "your.bundle.identifier", + }, + android: { + adaptiveIcon: { + foregroundImage: "./assets/icon.png", + backgroundColor: "#2e026d", + }, + }, + extra: { + eas: { + projectId: "your-project-id", + }, + CLERK_PUBLISHABLE_KEY, + }, + plugins: ["./expo-plugins/with-modify-gradle.js"], +}); + +export default defineConfig; diff --git a/apps/expo/assets/icon.png b/apps/expo/assets/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..8ff460d5fdb4de83cc0fba6f74840ebbb6629ac4 GIT binary patch literal 6991 zcma)gXH-*7)NZ6JVkioNV3dwPK)Q4YC=iM-O$betDpepvLI6REQUs(#M35*&fq?W9 z14dq&h=iJ#5z;$Q<>jCR+a0LAHG6UR^xh?DQ{dkXaG^+llZRH*eWLr~Rs;box0;%#7I z00Pyda~`_0f9P0^$6xztM4XgmnWE+cQSKBrJ3h; z$ybb$?hN-S!0P|+Q*`5|=%0^Xc#zKB)K%}BfeLMk2XW#aOhsz(uCEqZ^yRJ35UIDq zA2Ce%#YF|w4nAmuICP8HOcSQT;ktSms6b~w*L&A%rS8l(ipR||m#Ygcg)Hr_7#S*H zQEDMHE@zs2;LA+$xa+z_h<8(8*Yd0T3yp5l3ex!@w?z!sS!SqKiaY1!b&IYsx7?zM z+_*ev{(tLCU0;bSCu)*SB*IEOG6&?3U400=i<^Y@cDvZn^6M;#JzJj^MOwe@8~Q;$4&0oYxfDNLL94Qv>D#4*Ui*bTie=8TConx-RHHq>dC3en}*k1=|m5}S~?IlF1xs)8T&3PG6 zTevNZUMPMghYWXja?SDCJS8PztC2;n0F&6wxzTR42ec19E>r_a3X4f^laiU}&e&?* zf4DL`?_5nG^tFlDpCHRn+}^(l-&>8czusHZkJ@k~JJFYLING*VXDc+U9jp126zPq$tBL}zG zid~&~ku)-i~38Ckh-JsE~qM|!Lah*x7H+ayT zygWDo0brObJBkJyH~|iw*G3z-Z4Mnw+AOTBgctptABP3pT9A7pIUpWOc0zmFOYrJk zS?+k{!XqrkAUi@J|EZ6CE&um|&d%W}Q_-N^16)cYD+{Fc8Cfgpd}*{^SIcU&bDdT3 z5{GV>B`?m~L!pGMa1Du%=WF$qa6T}_{btt@k`1Ww=L z&AeVa(?!~q%L=<%reWePT|zU$e-c|RIx^;TN` z$BqF&#n5#S|`1{cciV5}@_357H|K9T~;etDJ=~~l zD0R*ds}appI4MMh8{#FRgE@XI}KPZ6!Pd#+iNk+S(muV0wLRIj=PuO zpw&4G*}wmGPQTzZDYU#LB-=Z(A_i#JS@drqT4bMH0ltS{9CGE<3Y88~B^aQms$4lW zUp*apfpf&Ca@1QqZQLae{FrjPBIs&D=QkDzXrO6d$bo`Akvd+5lGtY*_*V9(f(BU2IM*f*Qr zJcnU{JXTP-PPh~q_XOzk>O)g-Y#|W5dFsCed359nl0NRK!V87~CjY~n+C+!U6{pXFlkfIE-nGl-Z<=o_`nPiK)jVCSX z5+(#p-y{K8U~V{Yl4LPAQdQ-9?~XAa0rnjj!LE&iDAv(owF$0XekI8-&^;w$xPeps z&Y`1F7lx8WIUIC|BmAs*Fg^*}hE|T3PF{~yT`&F3Khp-R=4ymMf~z~@n4KW^-coYL zG_5l8BWi^4ZxX0hQBSjvXPRy7G`=%RgAi; zXj_FADBlsCdBsd?^*g{1pX!gv)1eS2GTD6mB=vkMWhp}YiantbQWn>@YM^{eBw+MC=U2+Y!e1vPpIexZC#e#KMw+LMavlEKe(FW9^EY{d*VUU|>T1~69N*lI zqWo;=m$NN2sc9(V&^3AocM=NR{j+fivZHWVU!tYBHD;ltvfpOoza|q0{zsMiOID7t zv0~bE#|a&n8rsy`dp766-#B_&?z7wJb3u*~7}VWiB@j%=KXe(E*ZChIy-T(Z$LU<+ z-hDq>gsUCAw+74VK26MaicFq`@rH=)i8JXfV*9GsDgNH&Ei}eLx9Y(+*6Bo}B5=+B zC?zAK2F>^dGrj+w!~sD^%a2^6XS=t5vbJ#k&p1kKdD{HXP}Al7s^qHbT;CVDGKdH( zXL!Y?X{y4-@s{H+{$@XcD26$m&Xm-A?(5?q7Bn%kKYTj%ZB7$3lS`D#FMPn21p=jNgx-%;fhcReFRj)Fv>krh|P5%m=?Y)T=AB~a*g3HTMX z0l4C5Z+;G|mPpA~0Km(Rqg|u*JQ@g?74B#*=t zaOeJSNI!gLS=7r<%>d5sB!|aTx2sUls>fxq*xrD(F<$g7pH1Ug=$FizT@joQZOElu zV+U>H^tfslrM{pnU+U#C`5?#R3;q1LOH8ldtWUD4^Ssr%(1y}`q1h>yVTsUwL%4Ry zW$JLS)HvA1EI5qI(Q2ynGo6bZ=SW(?go?{kod@4n2XyEG!GzA zO=emMz8Zd4ET6v%`%&I$A2WDz**Ql95jF~_3Hhl1`KW;ynpX;|W0ZX%BW-SJb_8`R z?R#AjLp=On)9lC1K=P&ElE2Dp2;2_0OZ3s>Raz z7JT07H?*Z;&)#jTy8yXw^gPqn?-nAWudVfoXY`y|%AY;a+RJl9pV?OXiE5-Uc6@B$=`3t(XE8*bP9Hd_H+{~U z^zsvy8uQ;o5=s)U&E@>TakK4h;{zD5ol@MxrPo`zqrV4h=cZ}Sr0DVehxE(WJx}x* zm4pCne&XLGw@Ct#HA*3I*y15l@S4$&KQk(N-Adl3H}bMqJGIm}ZG?h1ATbJTLs~ z-I#MWA#VnU>yBeW>%YydhlD+`MBcx+LgAyEFdt5IJ4b7-?1k*PrfyPx%I7T-oBbS6 z=5oMw$+!0oJ-TpNxLZf`=KWgXTUesGh^sLw`X63C9Y%5iPd={+fg?~Ts%0L#?i}Mw zKP`lu%W-U9^$XMf+RyfjlF)#;b~Y8>LYA$&-Q*yA*fsHyp8|PvL>c(h2Xk^D$v=Ik z*E~lrDGQzXI_)@PrROD0cMS#SllKg}j$cOgl?HLdqaNN;%Fu!<^an((E$JBTC=anE#{}6I!mkMQfRA)% z=aeh4h@zb{Sn}?RX@2>t}lGYIR^7_)q`)gz1N>*n{40eW}2C=U0f47~e2vrON ze<+sJ1Wv<_2Fw_&Z5l~K=*PCi&m*o#;Flu+~!38#&A`B;ATPSRZWIZ^QmI z)Ah4dQ1JAb*y2_zzL|M<7Z?1zsB-XJvccRtO-E%v<06vx;Pvec3Nd5IT$_|s>@a+s zx6|=>3>$vK8|rqUS*wGKCqCTHYB0$*7^@o;F3@WXV9C9!@*k(Zt6hG-GVkv|4z#y} z2LV(i9z#563NjT1rr8;l zckX>$#iobO{F=n}0FyJQh{#?OwQR1sC+3Y{P&~g!2hde%>sUQv7jaP=8<`V7ow=nv zsfuZ5%Uey`-f|1_7gFA2fxI0YJ^T~n4426wgeSK?bc97BWq%-ULdBa(Z+!aorG0Gw z>vst^LoRu|mC}p$?31l2AnVn@A4iUz=;eLB2x)%PP@>YwHhj%n%CA(aN~aJ>buJH! zo9jT3*-bWZbKiYCEgCY9W$h}B{d(dqZ_IU&7<`n*3AB<0N( zk}JHxeZWt3ira^ijn|q58hMo$*tf%YTwLlC6AN>1J}73J!G?i16HXRY?9x-}Wajr} zm61(UwpA=LtNKL#g6uDuM4$aSEk06Gc<|i)@tiaKhnCw`P7#>#=GWhEL!!6lB3erW zjLo*ZZ4U3oyh3lm1Ri3ic-)_tyWTO|lfb(4&bh&ufQ-S#rPxxvLvQR}-gU!jxu^gk zSKtb;fc&=H5gJqq9r0Z_VQNFWmWN+#_BSs%H3AOg3wq4>xaJ5 zeD;s-D&*K}k?y2tfKk7n`xWg_Ybw)dWm|D*6C z`%sc6#KsOPV+LbIqINHueR!%$rBy_n;C?JSuKNWLe>pJtp2$d%fpJ5NYUvr?16ulpu5 zHnx+rm$odKq;6S{%T?ob`K(PwkV`h2m5WL?1)&FPVQ?J`it^RI=gpwC6F|gglX?gC z*1o7vTpmPLoNg0h!OrXcRCup6ryvB{Z@{VN>LMk0I`^b$UW$z(_oE1YzXN?zOuXcH zH7~|D$dm%kk5u0(!pLv?y3lu$h)DVRF6V~^M5Msa!hR~>Cx`N) z6y05aR*J;&cP?p#l^5~8*Iv&{R@&WG$6G8-SDeehuJH2X+e)4A^n;V8KEzy%hmy)0 z&+)VK2Q|_3tCNBwsmg^ya_f}U(7gdR9brkzYtDwKJ)uUb>cOx_W=*drt*Rpeuc&jJ zUfGikuePo%hHZ=*1w8;Rn9ILx^9GVUpl6eHGD;camrtxT*6g7Y4t$n=qrT&%wQkh} z;VCOhv8lb9^GlcJr<%h9(piqWZ}K2!nwX4}Q2}HDR$mvC-jxE$(hM{A#Z3Bu3)j! z8b_CO!P0{~FD5SM9EO90FY2*~37;ihk=H5hl^u zxar~o>et0CMdVaKuw9j%PAN)oW-b`)5^(g)wkda*y>P|SPqsRMBD}&7m4O~xxMcW+ zI3fiG@#Nh*h_1=Bv?E%yKWbsh-X%rtIHh|3pTI-t(A&in#(=R?c;H!urma3_$w`^8 zlVr-rUx?n7mY!O|G@XCpqgi@R;ipAwX92`mb|3FQNxdyx;|`0VV%vz~ktqGPFG;ys zAp*ao>uTSCJ=|o+8%vyG>z9w6)UV { + return withProjectBuildGradle(config, (config) => { + if (!config.modResults.contents.includes("ext.getPackageJsonVersion =")) { + config.modResults.contents = config.modResults.contents.replace( + "buildscript {", + `buildscript { + ext.getPackageJsonVersion = { packageName -> + new File(['node', '--print', "JSON.parse(require('fs').readFileSync(require.resolve('\${packageName}/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim()) + }`, + ); + } + + if (!config.modResults.contents.includes("reactNativeVersion =")) { + config.modResults.contents = config.modResults.contents.replace( + "ext {", + `ext { + reactNativeVersion = "\${ext.getPackageJsonVersion('react-native')}"`, + ); + } + + if (!config.modResults.contents.includes("expoPackageVersion =")) { + config.modResults.contents = config.modResults.contents.replace( + "ext {", + `ext { + expoPackageVersion = "\${ext.getPackageJsonVersion('expo')}"`, + ); + } + + return config; + }); +}; diff --git a/apps/expo/index.ts b/apps/expo/index.ts new file mode 100644 index 0000000..ef8d1cf --- /dev/null +++ b/apps/expo/index.ts @@ -0,0 +1,8 @@ +import { registerRootComponent } from "expo"; + +import { App } from "./src/_app"; + +// registerRootComponent calls AppRegistry.registerComponent('main', () => App); +// It also ensures that whether you load the app in Expo Go or in a native build, +// the environment is set up appropriately +registerRootComponent(App); diff --git a/apps/expo/metro.config.js b/apps/expo/metro.config.js new file mode 100644 index 0000000..ddc71af --- /dev/null +++ b/apps/expo/metro.config.js @@ -0,0 +1,26 @@ +// Learn more: https://docs.expo.dev/guides/monorepos/ +// eslint-disable-next-line @typescript-eslint/no-var-requires +const { getDefaultConfig } = require('expo/metro-config'); +// eslint-disable-next-line @typescript-eslint/no-var-requires +const path = require('path'); + +const projectRoot = __dirname; +const workspaceRoot = path.resolve(projectRoot, '../..'); + +// Create the default Metro config +const config = getDefaultConfig(projectRoot); + +// Add the additional `cjs` extension to the resolver +config.resolver.sourceExts.push('cjs'); + +// 1. Watch all files within the monorepo +config.watchFolders = [workspaceRoot]; +// 2. Let Metro know where to resolve packages and in what order +config.resolver.nodeModulesPaths = [ + path.resolve(projectRoot, 'node_modules'), + path.resolve(workspaceRoot, 'node_modules'), +]; +// 3. Force Metro to resolve (sub)dependencies only from the `nodeModulesPaths` +config.resolver.disableHierarchicalLookup = true; + +module.exports = config; diff --git a/apps/expo/package.json b/apps/expo/package.json new file mode 100644 index 0000000..4f10bdc --- /dev/null +++ b/apps/expo/package.json @@ -0,0 +1,49 @@ +{ + "name": "@acme/expo", + "version": "0.1.0", + "main": "index.ts", + "scripts": { + "start": "expo start", + "dev": "expo start", + "clean": "rm -rf .expo .turbo node_modules", + "android": "expo start --android", + "ios": "expo start --ios", + "web": "expo start --web", + "lint": "eslint . --ext ts,tsx" + }, + "dependencies": { + "@acme/api": "*", + "@acme/validators": "*", + "@acme/tailwind-config": "*", + "@clerk/clerk-expo": "^0.17.7", + "@shopify/flash-list": "^1.4.0", + "@tanstack/react-query": "^4.16.1", + "@trpc/client": "^10.1.0", + "@trpc/react-query": "^10.1.0", + "@trpc/server": "^10.1.0", + "expo": "^48.0.6", + "expo-auth-session": "^4.0.3", + "expo-random": "^13.0.0", + "expo-secure-store": "^12.1.1", + "expo-status-bar": "^1.4.2", + "expo-web-browser": "^12.1.1", + "nativewind": "^2.0.11", + "react": "18.2.0", + "react-dom": "18.2.0", + "react-native": "0.70.5", + "react-native-safe-area-context": "4.4.1", + "react-native-web": "~0.18.10" + }, + "devDependencies": { + "@babel/core": "^7.19.3", + "@babel/preset-env": "^7.19.3", + "@babel/runtime": "^7.19.0", + "@types/react": "^18.0.25", + "@types/react-native": "~0.70.6", + "eslint": "^8.28.0", + "postcss": "^8.4.19", + "tailwindcss": "^3.2.4", + "typescript": "^4.9.3" + }, + "private": true +} diff --git a/apps/expo/src/_app.tsx b/apps/expo/src/_app.tsx new file mode 100644 index 0000000..7adfaad --- /dev/null +++ b/apps/expo/src/_app.tsx @@ -0,0 +1,31 @@ +import { StatusBar } from "expo-status-bar"; +import React from "react"; +import { SafeAreaProvider } from "react-native-safe-area-context"; +import { TRPCProvider } from "./utils/trpc"; + +import { HomeScreen } from "./screens/home"; +import { SignInSignUpScreen } from "./screens/signin"; +import { ClerkProvider, SignedIn, SignedOut } from "@clerk/clerk-expo"; +import { tokenCache } from "./utils/cache"; +import Constants from "expo-constants"; + +export const App = () => { + return ( + + + + + + + + + + + + + + ); +}; diff --git a/apps/expo/src/components/SignInWithOAuth.tsx b/apps/expo/src/components/SignInWithOAuth.tsx new file mode 100644 index 0000000..bf8718f --- /dev/null +++ b/apps/expo/src/components/SignInWithOAuth.tsx @@ -0,0 +1,38 @@ +import { useOAuth } from "@clerk/clerk-expo"; +import React from "react"; +import { Button, View } from "react-native"; +import { useWarmUpBrowser } from "../hooks/useWarmUpBrowser"; + +const SignInWithOAuth = () => { + useWarmUpBrowser(); + + const { startOAuthFlow } = useOAuth({ strategy: "oauth_discord" }); + + const handleSignInWithDiscordPress = React.useCallback(async () => { + try { + const { createdSessionId, signIn, signUp, setActive } = + await startOAuthFlow(); + if (createdSessionId) { + setActive?.({ session: createdSessionId }); + } else { + // Modify this code to use signIn or signUp to set this missing requirements you set in your dashboard. + throw new Error("There are unmet requirements, modifiy this else to handle them") + + } + } catch (err) { + console.log(JSON.stringify(err, null, 2)); + console.log("error signing in", err); + } + }, []); + + return ( + + diff --git a/apps/nextjs/src/components/loadingspinner.tsx b/apps/nextjs/src/components/loadingspinner.tsx index 2dda448..91312ba 100644 --- a/apps/nextjs/src/components/loadingspinner.tsx +++ b/apps/nextjs/src/components/loadingspinner.tsx @@ -1,9 +1,9 @@ -export default function LoadingSpinner(){ +export default function LoadingSpinner() { return (
-
-
- { - showingTarget - ? target - : guess - } +
+
+ {showingTarget ? target : guess}
-
- {numbers.map((number) => ( +
+ {numbers.map(number => ( setGuess((prev) => prev + arg)} + callBack={(arg: string) => setGuess(prev => prev + arg)} /> ))} setGuess((prev) => prev + arg)} + callBack={(arg: string) => setGuess(prev => prev + arg)} /> diff --git a/apps/nextjs/src/components/pietimer.tsx b/apps/nextjs/src/components/pietimer.tsx index 0fbbcdc..b2d7be0 100644 --- a/apps/nextjs/src/components/pietimer.tsx +++ b/apps/nextjs/src/components/pietimer.tsx @@ -1,8 +1,4 @@ -import React, { - useState, - useEffect, - type CSSProperties -} from 'react' +import React, { useState, useEffect, type CSSProperties } from 'react' import useInterval from '../hooks/useInterval' import { trpc } from '../utils/trpc' import { type SingletonRouter, useRouter } from 'next/router' diff --git a/apps/nextjs/src/components/schultedraw.tsx b/apps/nextjs/src/components/schultedraw.tsx index b2fd742..34c0a39 100644 --- a/apps/nextjs/src/components/schultedraw.tsx +++ b/apps/nextjs/src/components/schultedraw.tsx @@ -34,7 +34,7 @@ const drawLine = { }, } -function DrawBlock({ x, y }: { x: string; y: string }){ +function DrawBlock({ x, y }: { x: string; y: string }) { return ( } -function Intermediate(){ +function Intermediate() { const path = 'M 250 250 l 70 70 l -100 -20 L 370 250 l -230 -10 l 100 100 l -20 -200 l -70 200 l 200 -200 L 230 200 l -100 -20 L 200 250' return } -function Ideal(){ +function Ideal() { const path = 'M 250 250 l 30 30 l -10 -50 l -70 30 l 30 -50 l 10 80 l 20 -90 l -60 90 l 0 -70 L 250 255' return diff --git a/apps/nextjs/src/components/schultetable.tsx b/apps/nextjs/src/components/schultetable.tsx index 1f269df..6edf2a3 100644 --- a/apps/nextjs/src/components/schultetable.tsx +++ b/apps/nextjs/src/components/schultetable.tsx @@ -8,7 +8,6 @@ import { FontProvider } from '../cva/fontProvider' import type { Font, User } from '@acme/types' import { useStopWatch } from '../hooks/useStopWatch' - type SchulteTableProps = { sideLength: 3 | 5 | 7 } @@ -37,7 +36,7 @@ function Cell({ clicked.current = true } else if (!clicked.current) { clicked.current = true - counterSetter((prev) => prev + 1) + counterSetter(prev => prev + 1) } } @@ -47,7 +46,7 @@ function Cell({ return (
@@ -56,7 +55,6 @@ function Cell({ ) } - export default function SchulteTable({ sideLength }: SchulteTableProps) { const [counter, setCount] = useState(1) const [font, setFont] = useState('sans') @@ -77,10 +75,14 @@ export default function SchulteTable({ sideLength }: SchulteTableProps) { function formatType(sideLength: number) { switch (sideLength) { - case 3: return 'three' - case 5: return 'five' - case 7: return 'seven' - default: return 'five' + case 3: + return 'three' + case 5: + return 'five' + case 7: + return 'seven' + default: + return 'five' } } @@ -97,7 +99,7 @@ export default function SchulteTable({ sideLength }: SchulteTableProps) { function determineAdvancement(user: User) { if (!user) return - const cellCount = (sideLength * sideLength) + const cellCount = sideLength * sideLength const goodSessions = user.schulteAdvanceCount if (user.schulteLevel !== formatType(sideLength)) return @@ -123,7 +125,6 @@ export default function SchulteTable({ sideLength }: SchulteTableProps) { type: formatType(sideLength), time: stopWatch.getDuration(), errorCount: errors.current, - }) } @@ -133,27 +134,21 @@ export default function SchulteTable({ sideLength }: SchulteTableProps) { } function Table({ classString }: { classString: string }) { - const cells = numbers.current.map( - (number) => ( - <> -
- -
- - ) - ) - return ( -
- {cells} -
- ) + const cells = numbers.current.map(number => ( + <> +
+ +
+ + )) + return
{cells}
} useEffect(() => { @@ -179,7 +174,7 @@ export default function SchulteTable({ sideLength }: SchulteTableProps) { Find: {counter} diff --git a/apps/nextjs/src/components/sidebar.tsx b/apps/nextjs/src/components/sidebar.tsx index c8b46cb..f1ac49c 100644 --- a/apps/nextjs/src/components/sidebar.tsx +++ b/apps/nextjs/src/components/sidebar.tsx @@ -1,11 +1,11 @@ import { type SingletonRouter, useRouter } from 'next/router' import { useState } from 'react' -import { useClerk } from "@clerk/nextjs" +import { useClerk } from '@clerk/nextjs' import { motion } from 'framer-motion' -import { +import { IoArrowForwardCircleOutline, - IoArrowBackCircleOutline -} from "react-icons/io5" + IoArrowBackCircleOutline, +} from 'react-icons/io5' import { navigate } from '@acme/helpers' export default function Sidebar() { @@ -13,24 +13,26 @@ export default function Sidebar() { const router = useRouter() const clerk = useClerk() - function SideBarItem({ content, onClick }: { content: string, onClick: VoidFunction }) { + function SideBarItem({ + content, + onClick, + }: { + content: string + onClick: VoidFunction + }) { return ( - { - showing - ? content - : '' - } + {showing ? content : ''} ) } @@ -40,60 +42,56 @@ export default function Sidebar() { {/*this is the shadow that covers the page when the sidebar is open*/}
setShowing(!showing) - : () => setShowing(showing) + showing ? () => setShowing(!showing) : () => setShowing(showing) } /> {/*this is the sidebar itself*/}
setShowing(!showing)} > - { - showing - ? - : - } + {showing ? ( + + ) : ( + + )}
{ - router.push('/nav').catch(err => console.log(err)) - } - } /> + onClick={() => { + router.push('/nav').catch(err => console.log(err)) + }} + /> { - router.push('/settings').catch(err => console.log(err)) - } - } /> + onClick={() => { + router.push('/settings').catch(err => console.log(err)) + }} + /> { - clerk.signOut().catch(err => console.log(err)) - navigate(router as SingletonRouter, '/') - } - } /> + onClick={() => { + clerk.signOut().catch(err => console.log(err)) + navigate(router as SingletonRouter, '/') + }} + />
) } - diff --git a/apps/nextjs/src/components/speedtest.tsx b/apps/nextjs/src/components/speedtest.tsx index 2288622..9ac3baf 100644 --- a/apps/nextjs/src/components/speedtest.tsx +++ b/apps/nextjs/src/components/speedtest.tsx @@ -12,11 +12,7 @@ type QuestionViewProps = { user: User | undefined doneSignal: () => void } -function QuestionView({ - speedQuestion, - user, - doneSignal, -}: QuestionViewProps){ +function QuestionView({ speedQuestion, user, doneSignal }: QuestionViewProps) { const formattedQuestion = speedQuestion.passage.split(' ') const [currentWord, setCurrentWord] = useState(formattedQuestion[0]) const isVisivle = true @@ -29,7 +25,7 @@ function QuestionView({ useInterval(() => { if (!user) console.log('User not found') - if (isVisivle) setItteration((prev) => prev + 1) + if (isVisivle) setItteration(prev => prev + 1) if (itteration >= formattedQuestion.length) { doneSignal() } @@ -50,7 +46,7 @@ function AnswerView({ }: { speedQuestion: SpeedQuestion user: User | undefined -}){ +}) { const { mutate } = trpc.user.set.useMutation() const store = useUserStore() const router = useRouter() @@ -68,7 +64,7 @@ function AnswerView({ D = 'D', } - function selectAnswer(answer: Answers){ + function selectAnswer(answer: Answers) { if (answer === speedQuestion.correctAnswer.toUpperCase()) { setCorrectOrNot( <> @@ -121,51 +117,51 @@ function AnswerView({
{correctOrNot}
-

+

{speedQuestion.question}

-

+

{speedQuestion.answerA}

-

+

{speedQuestion.answerB}

-

+

{speedQuestion.answerC}

-

+

{speedQuestion.answerD}

@@ -180,7 +176,7 @@ export default function SpeedTest({ }: { user: User | undefined speedQuestion: SpeedQuestion -}){ +}) { const [isAnswerTime, setIsAnswerTime] = useState(false) return ( <> diff --git a/apps/nextjs/src/components/tableswitcher.tsx b/apps/nextjs/src/components/tableswitcher.tsx index bfdeff7..d62b357 100644 --- a/apps/nextjs/src/components/tableswitcher.tsx +++ b/apps/nextjs/src/components/tableswitcher.tsx @@ -1,11 +1,17 @@ -import Link from "next/link" -import { type User } from "@acme/types" +import Link from 'next/link' +import { type User } from '@acme/types' -export default function TableSwitcher({ user, className }: { user: User | null, className?: string }) { +export default function TableSwitcher({ + user, + className, +}: { + user: User | null + className?: string +}) { function NavEasy() { return ( Easy @@ -15,7 +21,7 @@ export default function TableSwitcher({ user, className }: { user: User | null, function NavMed() { return ( Medium @@ -25,7 +31,7 @@ export default function TableSwitcher({ user, className }: { user: User | null, function NavHard() { return ( Hard @@ -43,14 +49,12 @@ export default function TableSwitcher({ user, className }: { user: User | null,
) - } - else if (user.schulteLevel === 'five') { + } else if (user.schulteLevel === 'five') { return (
) - } - else return <> + } else return <> } diff --git a/apps/nextjs/src/components/tests/evensandodds.test.ts b/apps/nextjs/src/components/tests/evensandodds.test.ts index aab972a..1a2f0ea 100644 --- a/apps/nextjs/src/components/tests/evensandodds.test.ts +++ b/apps/nextjs/src/components/tests/evensandodds.test.ts @@ -14,7 +14,7 @@ describe('generates an array of random numbers with a given number of significan let evenCount = 0 let overs = 0 let unders = 0 - testArray.forEach((num) => { + testArray.forEach(num => { if (num % 2 === 0) { evenCount++ } @@ -42,7 +42,7 @@ describe('generates an array of random numbers with a given number of significan let evenCount = 0 let overs = 0 let unders = 0 - testArray.forEach((num) => { + testArray.forEach(num => { if (num % 2 === 0) { evenCount++ } @@ -75,8 +75,8 @@ describe('generates an array of random numbers with a given number of significan for (let i = 0; i < ITERS; i++) { holder.push(generateNumbers(props)) } - holder.forEach((testArray) => { - testArray.forEach((num) => { + holder.forEach(testArray => { + testArray.forEach(num => { if (num % 2 === 0) { evenCount++ } diff --git a/apps/nextjs/src/components/wordchanger.tsx b/apps/nextjs/src/components/wordchanger.tsx index f79709c..33d8cd9 100644 --- a/apps/nextjs/src/components/wordchanger.tsx +++ b/apps/nextjs/src/components/wordchanger.tsx @@ -9,7 +9,7 @@ export type ChangerProps = { const MILISECONDS_IN_A_MINUTE = 60000 -async function fetchWords(number: number){ +async function fetchWords(number: number) { try { if (number > 500) { //random words api won't return more than 500 words at a time so here's a hacky workaround @@ -33,7 +33,7 @@ async function fetchWords(number: number){ } } -function formatWords(words: string[], wordsPerCell: number){ +function formatWords(words: string[], wordsPerCell: number) { const wordJoiner: string[] = [] for (let i = 0; i < words.length / wordsPerCell; i += wordsPerCell) { wordJoiner.push(words.slice(i, i + wordsPerCell).join(' ')) @@ -41,7 +41,7 @@ function formatWords(words: string[], wordsPerCell: number){ return wordJoiner } -async function fetch(props: ChangerProps){ +async function fetch(props: ChangerProps) { const words = await fetchWords(props.wordsPerCell * props.wpm) const formattedWords = formatWords(words, props.wordsPerCell) return formattedWords @@ -63,13 +63,13 @@ export default function Changer(props: ChangerProps) { console.log("Here's the error: ", error) } } - load().catch((error) => console.log("Here's the error: ", error)) + load().catch(error => console.log("Here's the error: ", error)) }, []) useInterval(() => { if (fetched) { setCurrent(words[wordIndex] as string) - setWordIndex((prev) => prev + 1) + setWordIndex(prev => prev + 1) } }, MILISECONDS_IN_A_MINUTE / props.wpm) diff --git a/apps/nextjs/src/components/wordpairs.tsx b/apps/nextjs/src/components/wordpairs.tsx index b92024e..b48ceaf 100644 --- a/apps/nextjs/src/components/wordpairs.tsx +++ b/apps/nextjs/src/components/wordpairs.tsx @@ -9,28 +9,27 @@ import { formatDate, navigateToNextExercise } from '@acme/helpers' import type { Font, WordPair } from '@acme/types' function useGetProps(total = 18, diffCount = 5) { - const pairs = trpc.excercise.getWordPairs.useQuery({ count: diffCount, - language: "english", + language: 'english', }) const words = trpc.excercise.getRandomWords.useQuery({ number: total - diffCount, - language: "english", - max: 7 + language: 'english', + max: 7, }) const result = useMemo(() => { if (words.isSuccess && pairs.isSuccess) { return { words: words.data, - pairs: pairs.data + pairs: pairs.data, + } + } else + return { + words: undefined, + pairs: undefined, } - } - else return { - words: undefined, - pairs: undefined - } }, [pairs, words]) return result @@ -40,15 +39,14 @@ type PairsProps = { diffCount: number } - export default function WordPairs({ diffCount }: PairsProps) { - const total = 18 const { words, pairs } = useGetProps(total, diffCount) const user = trpc.user.get.useQuery() const { mutate: updateUser } = trpc.user.set.useMutation() const userStore = useUserStore() - const { mutate: collectSessionData } = trpc.collect.wordPairSession.useMutation() + const { mutate: collectSessionData } = + trpc.collect.wordPairSession.useMutation() const stopWatch = useStopWatch() const router = useRouter() const foud = useRef(0) @@ -56,21 +54,19 @@ export default function WordPairs({ diffCount }: PairsProps) { const font = useRef('sans') const [grid, setGrid] = useState() - function generateGrid() { if (!pairs || !words) return const cells = new Array() - words.forEach((word) => { + words.forEach(word => { cells.push(generateSame(word)) }) - pairs.forEach((pair) => { + pairs.forEach(pair => { cells.push(generateDifferent(pair)) }) stopWatch.start() return cells.sort(() => Math.random() - 0.5) } - const handleCellClick = useCallback((answer: 'correct' | 'error') => { console.log(answer) if (answer === 'correct') { @@ -84,7 +80,6 @@ export default function WordPairs({ diffCount }: PairsProps) { console.log('pairsFound', foud.current) }, []) - function tearDown() { console.log('teardown') if (!user) return @@ -93,37 +88,44 @@ export default function WordPairs({ diffCount }: PairsProps) { updateUser({ lastWordPairs: formatDate(new Date()) }) userStore.setUser({ ...userStore.user, - lastWordPairs: formatDate(new Date()) + lastWordPairs: formatDate(new Date()), }) if (user.data && user.data.isStudySubject) { collectSessionData({ userId: user.data.id, errorCount: wrongs.current, - time: stopWatch.getDuration() + time: stopWatch.getDuration(), }) } - navigateToNextExercise(router as SingletonRouter, user.data ?? userStore.user) + navigateToNextExercise( + router as SingletonRouter, + user.data ?? userStore.user, + ) } function generateSame(word: string) { - return + return ( + + ) } function generateDifferent(pair: WordPair) { - return + return ( + + ) } useEffect(() => { @@ -135,13 +137,7 @@ export default function WordPairs({ diffCount }: PairsProps) { setGrid(() => generateGrid()) }, [words, pairs]) - return ( -
- {grid} -
- ) + return
{grid}
} type CellProps = { @@ -160,8 +156,7 @@ function Cell({ font, different, word1, word2, id, callback }: CellProps) { if (different && !highlighted) { callback('correct') setHighlighted(() => true) - } - else if (!different && !highlighted) { + } else if (!different && !highlighted) { setHighlighted(() => true) callback('error') } @@ -173,19 +168,21 @@ function Cell({ font, different, word1, word2, id, callback }: CellProps) { onClick={() => handleClick()} id={id?.toString() ?? '0'} className={[ - 'items-center grid grid-cols-1 rounded-lg text-white', - 'md:text-3xl md:p-2', - 'text-2xl p-1', - `${highlighted ? (different ? 'bg-white/10' : 'bg-red-500/40') : 'bg-white/20'}`, - 'cursor-pointer', - ].join(' ')} + 'grid grid-cols-1 items-center rounded-lg text-white', + 'md:p-2 md:text-3xl', + 'p-1 text-2xl', + `${ + highlighted + ? different + ? 'bg-white/10' + : 'bg-red-500/40' + : 'bg-white/20' + }`, + 'cursor-pointer', + ].join(' ')} > -
- {word1} -
-
- {word2} -
+
{word1}
+
{word2}
) } diff --git a/apps/nextjs/src/cva/flashingStyles.tsx b/apps/nextjs/src/cva/flashingStyles.tsx index a7f6034..5792810 100644 --- a/apps/nextjs/src/cva/flashingStyles.tsx +++ b/apps/nextjs/src/cva/flashingStyles.tsx @@ -2,13 +2,8 @@ import React from 'react' import { cva } from 'class-variance-authority' import type { VariantProps } from 'class-variance-authority' -export const cell = cva([ - 'flex', - 'text-black', - 'md:text-xl', - 'text-l', - 'p-2', - 'justify-center'], +export const cell = cva( + ['flex', 'text-black', 'md:text-xl', 'text-l', 'p-2', 'justify-center'], { variants: { intent: { @@ -39,7 +34,7 @@ export const cell = cva([ export interface ButtonProps extends React.HTMLAttributes, - VariantProps { } + VariantProps {} export const StyledCell: React.FC = ({ className, diff --git a/apps/nextjs/src/hooks/useStopWatch.ts b/apps/nextjs/src/hooks/useStopWatch.ts index 65522bd..36b1d9d 100644 --- a/apps/nextjs/src/hooks/useStopWatch.ts +++ b/apps/nextjs/src/hooks/useStopWatch.ts @@ -1,4 +1,4 @@ -import { useRef } from "react" +import { useRef } from 'react' /** * @description A simple stop watch class to measure the time it takes @@ -28,8 +28,8 @@ import { useRef } from "react" * @throws Error if the stopWatch is not started before getting duration * * @class StopWatch -**/ -export function useStopWatch(){ + **/ +export function useStopWatch() { const startTime = useRef(0) const endTime = useRef(0) @@ -42,7 +42,7 @@ export function useStopWatch(){ } function getDuration() { - if (startTime.current === 0 ) { + if (startTime.current === 0) { throw new Error('StopWatch must be started before getting duration') } if (endTime.current === 0) { @@ -50,10 +50,10 @@ export function useStopWatch(){ } return endTime.current - startTime.current } - + return { start, end, - getDuration + getDuration, } } diff --git a/apps/nextjs/src/hooks/useTimer.ts b/apps/nextjs/src/hooks/useTimer.ts index 2cdbf64..3b29e4e 100644 --- a/apps/nextjs/src/hooks/useTimer.ts +++ b/apps/nextjs/src/hooks/useTimer.ts @@ -1,11 +1,12 @@ -import { useEffect, useCallback, useRef } from 'react'; +import { useEffect, useCallback, useRef } from 'react' type TimeMeasure = 'milliseconds' | 'seconds' | 'minutes' export default function useTimer( - timeUnit: TimeMeasure, - endTime: number, - eventName: string) { + timeUnit: TimeMeasure, + endTime: number, + eventName: string, +) { const time = useRef(0) const running = useRef(false) const ticker = useRef() @@ -14,21 +15,21 @@ export default function useTimer( const unit = useRef(timeUnit) const event = new Event(eventName) const end = (() => { - switch (unit.current) { - case 'milliseconds': - delay.current = 1 - return endTime - case 'seconds': - delay.current = 100 - return endTime * 1000 - case 'minutes': - delay.current = 1_000 - return endTime * 60_000 - // the interval numbers are kind of arbitrary. - // I wanted them small enough to be accurate, - // but large enough to not be a performance issue. - } - })() + switch (unit.current) { + case 'milliseconds': + delay.current = 1 + return endTime + case 'seconds': + delay.current = 100 + return endTime * 1000 + case 'minutes': + delay.current = 1_000 + return endTime * 60_000 + // the interval numbers are kind of arbitrary. + // I wanted them small enough to be accurate, + // but large enough to not be a performance issue. + } + })() const start = useCallback(() => { time.current = Date.now() @@ -40,8 +41,6 @@ export default function useTimer( running.current = true }, []) - - const tick = useCallback(() => { if (!running.current) return if (time.current === 0) return @@ -53,7 +52,7 @@ export default function useTimer( } }, []) - const clear = useCallback(() =>{ + const clear = useCallback(() => { running.current = false as const clearInterval(ticker.current) duration.current = 0 @@ -64,8 +63,7 @@ export default function useTimer( clearInterval(ticker.current as NodeJS.Timer) duration.current = 0 return - } - else { + } else { ticker.current = setInterval(() => { tick() }, delay.current) diff --git a/apps/nextjs/src/middleware.ts b/apps/nextjs/src/middleware.ts index f060d4f..4d28f3c 100644 --- a/apps/nextjs/src/middleware.ts +++ b/apps/nextjs/src/middleware.ts @@ -1,10 +1,10 @@ -import { withClerkMiddleware } from "@clerk/nextjs/server"; -import { NextResponse } from "next/server"; -import type { NextRequest } from "next/server"; +import { withClerkMiddleware } from '@clerk/nextjs/server' +import { NextResponse } from 'next/server' +import type { NextRequest } from 'next/server' export default withClerkMiddleware((_req: NextRequest) => { - return NextResponse.next(); -}); + return NextResponse.next() +}) // Stop Middleware running on static files export const config = { @@ -17,6 +17,6 @@ export const config = { * * This includes images, and requests from TRPC. */ - "/(.*?trpc.*?|(?!static|.*\\..*|_next|favicon.ico).*)", + '/(.*?trpc.*?|(?!static|.*\\..*|_next|favicon.ico).*)', ], -}; +} diff --git a/apps/nextjs/src/pages/_app.tsx b/apps/nextjs/src/pages/_app.tsx index 6bc7a77..801e911 100644 --- a/apps/nextjs/src/pages/_app.tsx +++ b/apps/nextjs/src/pages/_app.tsx @@ -1,15 +1,15 @@ // src/pages/_app.tsx -import "../styles/globals.css"; -import type { AppType } from "next/app"; -import { ClerkProvider } from "@clerk/nextjs"; -import { trpc } from "../utils/trpc"; +import '../styles/globals.css' +import type { AppType } from 'next/app' +import { ClerkProvider } from '@clerk/nextjs' +import { trpc } from '../utils/trpc' const MyApp: AppType = ({ Component, pageProps: { ...pageProps } }) => { return ( - ); -}; + ) +} -export default trpc.withTRPC(MyApp); +export default trpc.withTRPC(MyApp) diff --git a/apps/nextjs/src/pages/admin/createquestion/done.tsx b/apps/nextjs/src/pages/admin/createquestion/done.tsx index 6a4234b..7b11ee0 100644 --- a/apps/nextjs/src/pages/admin/createquestion/done.tsx +++ b/apps/nextjs/src/pages/admin/createquestion/done.tsx @@ -3,11 +3,11 @@ import { api } from '~/utils/api' import { useRouter } from 'next/router' import Sidebar from '~/components/sidebar' -export default function Page(){ +export default function Page() { const router = useRouter() const [approved, setApproved] = useState(false) const user = api.user.getUnique.useQuery().data - + const navToCreatQuestion = () => { router.push('/admin/createquestion').catch(err => console.log(err)) } @@ -16,21 +16,21 @@ export default function Page(){ router.push('/admin').catch(err => console.log(err)) } - function Display(){ - return( + function Display() { + return ( <> - -
-

Question created!

+ +
+

Question created!

@@ -39,27 +39,25 @@ export default function Page(){ ) } - function Loading(){ - return( + function Loading() { + return ( <> - -
-

Loading...

+ +
+

Loading...

) } useEffect(() => { - if(!user) return - if(!user.isAdmin){ + if (!user) return + if (!user.isAdmin) { router.push('/').catch(err => console.log(err)) - } - else{ + } else { setApproved(true) } }, [user]) - return approved ? : - + return approved ? : } diff --git a/apps/nextjs/src/pages/admin/createquestion/index.tsx b/apps/nextjs/src/pages/admin/createquestion/index.tsx index 6e793d4..62ee711 100644 --- a/apps/nextjs/src/pages/admin/createquestion/index.tsx +++ b/apps/nextjs/src/pages/admin/createquestion/index.tsx @@ -4,18 +4,18 @@ import Sidebar from '~/components/sidebar' import { api } from '~/utils/api' import type { Answer } from '~/utils/types' -function Loading(){ - return( +function Loading() { + return ( <> -
-

Loading...

+
+

Loading...

) } -function QuestionForm(){ +function QuestionForm() { const [passage, setPassage] = useState('') const [question, setQuestion] = useState('') const [answerA, setAnswerA] = useState('') @@ -26,15 +26,15 @@ function QuestionForm(){ const [correctAnswer, setCorrectAnswer] = useState('A') const router = useRouter() - function submit(){ - if( + function submit() { + if ( passage == '' || - question == ''|| + question == '' || answerA == '' || answerB == '' || answerC == '' || answerD == '' - ){ + ) { alert('Please fill out all fields') return } @@ -45,123 +45,119 @@ function QuestionForm(){ answerB, answerC, answerD, - correctAnswer + correctAnswer, } mutate(body) - router.push('/admin/createquestion/done').catch((err) => console.log(err)) - + router.push('/admin/createquestion/done').catch(err => console.log(err)) } return ( <> -
+
- -