Skip to content

Commit 55bff1a

Browse files
committed
monorepo
1 parent ad70c59 commit 55bff1a

File tree

669 files changed

+1412
-389
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

669 files changed

+1412
-389
lines changed

.eslintrc.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
{
2+
"root": true,
23
"overrides": [
34
{
45
"extends": [
56
"plugin:@typescript-eslint/recommended-requiring-type-checking"
67
],
7-
"files": ["*.ts", "*.tsx"],
8-
"parserOptions": {
9-
"project": "tsconfig.json"
10-
}
8+
"files": ["*.ts", "*.tsx"]
119
},
1210
{
1311
"files": [
1412
"src/server/**/*",
1513
"src/payments/**/*",
14+
"packages/prisma/**/*",
1615
"scripts/**/*",
1716
"prisma-seed.ts"
1817
],
@@ -23,7 +22,12 @@
2322
],
2423
"parser": "@typescript-eslint/parser",
2524
"parserOptions": {
26-
"project": "./tsconfig.json"
25+
"project": ["./apps/*/tsconfig.json", "./packages/*/tsconfig.json"],
26+
},
27+
"settings": {
28+
"next": {
29+
"rootDir": ["apps/*/", "packages/*/"]
30+
}
2731
},
2832
"plugins": ["@typescript-eslint"],
2933
"extends": ["next/core-web-vitals", "plugin:@typescript-eslint/recommended"],

apps/next/.gitignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# next.js
9+
/.next/
10+
/out/
11+
next-env.d.ts
12+
13+
# production
14+
/build
15+
16+
# misc
17+
.DS_Store
18+
*.pem
19+
20+
# debug
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*
24+
.pnpm-debug.log*
25+
26+
# local env files
27+
# 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
28+
.env
29+
.env*.local
30+
31+
# vercel
32+
.vercel
33+
34+
# typescript
35+
*.tsbuildinfo
36+
37+
.turbo

highlight.config.ts renamed to apps/next/highlight.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Highlight } from "@highlight-run/next";
22
import type { NextApiHandler } from "next";
3-
import { env } from "./src/env/server.mjs";
3+
import { env } from "@quenti/env/client";
44

55
export const withHighlight = env.NEXT_PUBLIC_HIGHLIGHT_PROJECT_ID
66
? Highlight({
File renamed without changes.
File renamed without changes.

next.config.mjs renamed to apps/next/next.config.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ const appVersion = pjson.version;
1414
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation.
1515
* This is especially useful for Docker builds.
1616
*/
17-
!process.env.SKIP_ENV_VALIDATION && (await import("./src/env/server.mjs"));
17+
import "@quenti/env/client/client.mjs";
18+
import "@quenti/env/server/server.mjs";
1819

1920
/** @type {import("next").NextConfig} */
2021
let config = withHighlightConfig(
@@ -28,6 +29,7 @@ let config = withHighlightConfig(
2829
images: {
2930
domains: ["lh3.googleusercontent.com"],
3031
},
32+
transpilePackages: ["@quenti/env", "@quenti/prisma"],
3133
rewrites: async () => [
3234
{
3335
source: "/:id(_[a-zA-Z0-9]{10})",

apps/next/package.json

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
{
2+
"name": "@quenti/next",
3+
"version": "0.9.48",
4+
"private": true,
5+
"scripts": {
6+
"build": "next build",
7+
"dev": "next dev",
8+
"postinstall": "prisma generate",
9+
"lint": "next lint",
10+
"start": "next start",
11+
"theme": "chakra-cli tokens src/lib/chakra-theme.ts"
12+
},
13+
"dependencies": {
14+
"@2toad/profanity": "^2.2.0",
15+
"@chakra-ui/react": "^2.7.1",
16+
"@dnd-kit/core": "^6.0.8",
17+
"@dnd-kit/modifiers": "^6.0.1",
18+
"@dnd-kit/sortable": "^7.0.2",
19+
"@dnd-kit/utilities": "^3.2.1",
20+
"@emotion/react": "^11.11.1",
21+
"@emotion/styled": "^11.11.0",
22+
"@fontsource/outfit": "^5.0.4",
23+
"@highlight-run/next": "^3.1.1",
24+
"@highlight-run/react": "^3.2.0",
25+
"@hookform/resolvers": "^3.1.1",
26+
"@neondatabase/serverless": "^0.4.24",
27+
"@next-auth/prisma-adapter": "^1.0.7",
28+
"@quenti/env": "*",
29+
"@quenti/prisma": "*",
30+
"@react-email/components": "^0.0.7",
31+
"@react-email/tailwind": "^0.0.8",
32+
"@tabler/icons-react": "^2.23.0",
33+
"@tanstack/react-query": "^4.29.19",
34+
"@tanstack/react-virtual": "^3.0.0-alpha.0",
35+
"@trpc/client": "^10.33.1",
36+
"@trpc/next": "^10.33.1",
37+
"@trpc/react-query": "^10.33.1",
38+
"@trpc/server": "^10.33.1",
39+
"@upstash/ratelimit": "^0.4.3",
40+
"@upstash/redis": "^1.22.0",
41+
"@vercel/analytics": "^1.0.1",
42+
"@vercel/og": "^0.5.8",
43+
"aos": "^2.3.4",
44+
"axios": "^1.4.0",
45+
"chakra-react-select": "^4.6.0",
46+
"diff": "^5.1.0",
47+
"email-providers": "^2.0.1",
48+
"framer-motion": "^10.12.18",
49+
"highlight.run": "^7.3.4",
50+
"js-levenshtein": "^1.1.6",
51+
"kysely": "^0.25.0",
52+
"lodash.debounce": "^4.0.8",
53+
"lodash.omit": "^4.5.0",
54+
"lodash.throttle": "^4.1.1",
55+
"micro": "^10.0.1",
56+
"nanoid": "^4.0.2",
57+
"next": "^13.4.8",
58+
"next-auth": "^4.22.1",
59+
"next-axiom": "^0.18.0",
60+
"otp-generator": "^4.0.1",
61+
"prisma-kysely": "^1.5.0",
62+
"prom-client": "^14.2.0",
63+
"react": "^18.2.0",
64+
"react-canvas-confetti": "^1.4.0",
65+
"react-dom": "^18.2.0",
66+
"react-email": "1.9.4",
67+
"react-hook-form": "^7.45.2",
68+
"react-to-print": "^2.14.13",
69+
"resend": "^0.17.2",
70+
"sharp": "^0.32.1",
71+
"short-unique-id": "^4.4.4",
72+
"slugify": "^1.6.6",
73+
"stripe": "^12.13.0",
74+
"superjson": "1.12.4",
75+
"use-fit-text": "^2.4.0",
76+
"zod": "^3.21.4",
77+
"zod-prisma": "^0.5.4",
78+
"zustand": "^4.3.9"
79+
},
80+
"devDependencies": {
81+
"@chakra-ui/cli": "^2.4.1",
82+
"@faker-js/faker": "^8.0.2",
83+
"@next/bundle-analyzer": "^13.4.8",
84+
"@types/aos": "^3.0.4",
85+
"@types/diff": "^5.0.3",
86+
"@types/jest": "^29.5.2",
87+
"@types/js-levenshtein": "^1.1.1",
88+
"@types/lodash.debounce": "^4.0.7",
89+
"@types/lodash.omit": "^4.5.7",
90+
"@types/lodash.throttle": "^4.1.7",
91+
"@types/node": "^20.3.3",
92+
"@types/otp-generator": "^4.0.0",
93+
"@types/prettier": "^2.7.3",
94+
"@types/react": "^18.2.14",
95+
"@types/react-dom": "^18.2.6",
96+
"@typescript-eslint/eslint-plugin": "^5.61.0",
97+
"@typescript-eslint/parser": "^5.61.0",
98+
"autoprefixer": "^10.4.14",
99+
"env-cmd": "^10.1.0",
100+
"eslint": "^8.44.0",
101+
"eslint-config-next": "^13.4.8",
102+
"jest": "^29.6.0",
103+
"postcss": "^8.4.24",
104+
"prettier": "^2.8.8",
105+
"prettier-plugin-tailwindcss": "^0.3.0",
106+
"react-textarea-autosize": "^8.5.2",
107+
"tailwindcss": "^3.3.2",
108+
"ts-jest": "^29.1.1",
109+
"ts-node": "^10.9.1",
110+
"typescript": "^5.1.6"
111+
},
112+
"ct3aMetadata": {
113+
"initVersion": "7.1.0"
114+
}
115+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/adapters/prisma-user.ts renamed to apps/next/src/adapters/prisma-user.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { PrismaAdapter } from "@next-auth/prisma-adapter";
2-
import type { PrismaClient } from "@prisma/client";
2+
import type { PrismaClient } from "@quenti/prisma/client";
33
import type { Adapter } from "next-auth/adapters";
44
import { USERNAME_REPLACE_REGEXP } from "../constants/characters";
55

src/common/visibility-icon.tsx renamed to apps/next/src/common/visibility-icon.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { StudySetVisibility } from "@prisma/client";
1+
import type { StudySetVisibility } from "@quenti/prisma/client";
22
import { IconLink, IconLock, IconWorld } from "@tabler/icons-react";
33

44
export const visibilityIcon = (visibility: StudySetVisibility, size = 24) => {
File renamed without changes.

src/components/command-menu.tsx renamed to apps/next/src/components/command-menu.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ import {
1515
useColorMode,
1616
useColorModeValue,
1717
} from "@chakra-ui/react";
18-
import type { User } from "@prisma/client";
18+
import { env } from "@quenti/env/client";
19+
import type { User } from "@quenti/prisma/client";
1920
import {
2021
IconBooks,
2122
IconBuilding,
@@ -34,7 +35,6 @@ import {
3435
import { useSession } from "next-auth/react";
3536
import { useRouter } from "next/router";
3637
import React from "react";
37-
import { env } from "../env/client.mjs";
3838
import { menuEventChannel } from "../events/menu";
3939
import { useDevActions } from "../hooks/use-dev-actions";
4040
import { useShortcut } from "../hooks/use-shortcut";

src/components/edit-term-modal.tsx renamed to apps/next/src/components/edit-term-modal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
ModalOverlay,
1111
Stack,
1212
} from "@chakra-ui/react";
13-
import type { Term } from "@prisma/client";
13+
import type { Term } from "@quenti/prisma/client";
1414
import React from "react";
1515
import { useSetFolderUnison } from "../hooks/use-set-folder-unison";
1616
import { api } from "../utils/api";

src/components/flashcard.tsx renamed to apps/next/src/components/flashcard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
Text,
1111
useColorModeValue,
1212
} from "@chakra-ui/react";
13-
import type { Term } from "@prisma/client";
13+
import type { Term } from "@quenti/prisma/client";
1414
import {
1515
IconArrowBackUp,
1616
IconCheck,

src/components/folder-card.tsx renamed to apps/next/src/components/folder-card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Folder } from "@prisma/client";
1+
import type { Folder } from "@quenti/prisma/client";
22
import { IconFolder } from "@tabler/icons-react";
33
import React from "react";
44
import { GenericCard } from "./generic-card";
File renamed without changes.

src/components/generic-term-card.tsx renamed to apps/next/src/components/generic-term-card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react";
2-
import type { Term } from "@prisma/client";
2+
import type { Term } from "@quenti/prisma/client";
33
import { Box, Card, Flex, Text, useColorModeValue } from "@chakra-ui/react";
44
import { ScriptFormatter } from "./script-formatter";
55

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/components/root-flashcard-wrapper.tsx renamed to apps/next/src/components/root-flashcard-wrapper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Box } from "@chakra-ui/react";
2-
import type { Term } from "@prisma/client";
2+
import type { Term } from "@quenti/prisma/client";
33
import { useSession } from "next-auth/react";
44
import React from "react";
55
import { menuEventChannel } from "../events/menu";

src/components/share-resolver.tsx renamed to apps/next/src/components/share-resolver.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { EntityType } from "@prisma/client";
1+
import type { EntityType } from "@quenti/prisma/client";
22
import { useRouter } from "next/router";
33
import React from "react";
44
import { useLoading } from "../hooks/use-loading";

src/components/study-set-card.tsx renamed to apps/next/src/components/study-set-card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { StudySet } from "@prisma/client";
1+
import type { StudySet } from "@quenti/prisma/client";
22
import React from "react";
33
import { visibilityIcon } from "../common/visibility-icon";
44
import { GenericCard } from "./generic-card";
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/constants/payments.ts renamed to apps/next/src/constants/payments.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { env as clientEnv } from "../env/client.mjs";
2-
import { env as serverEnv } from "../env/server.mjs";
1+
import { env as clientEnv } from "@quenti/env/client";
2+
import { env as serverEnv } from "@quenti/env/server";
33

44
export const IS_PAYMENT_ENABLED = !!(
55
serverEnv.STRIPE_PRIVATE_KEY && clientEnv.NEXT_PUBLIC_STRIPE_PUBLIC_KEY
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { env } from "../env/client.mjs";
1+
import { env } from "@quenti/env/client";
22

33
/** The base url for all of Quenti */
44
export const BASE_URL = env.NEXT_PUBLIC_BASE_URL;

src/emails/components/footer.tsx renamed to apps/next/src/emails/components/footer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { env } from "@quenti/env/client";
12
import { Hr, Link } from "@react-email/components";
2-
import { env } from "../../env/server.mjs";
33
import { Logo } from "./logo";
44

55
interface FooterProps {

src/emails/components/logo.tsx renamed to apps/next/src/emails/components/logo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { env } from "@quenti/env/client";
12
import { Img } from "@react-email/components";
2-
import { env } from "../../env/server.mjs";
33

44
interface LogoProps {
55
width?: number;

src/emails/resend.ts renamed to apps/next/src/emails/resend.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import { env } from "@quenti/env/server";
12
import { Resend } from "resend";
23
import type { CreateEmailOptions } from "resend/build/src/emails/interfaces";
3-
import { env } from "../env/server.mjs";
44
import ConfirmCodeEmail, {
55
type ConfirmCodeEmailProps,
66
} from "./templates/confirm-code";
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/interfaces/question.ts renamed to apps/next/src/interfaces/question.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { StudySetAnswerMode, Term } from "@prisma/client";
1+
import type { StudySetAnswerMode, Term } from "@quenti/prisma/client";
22
import type { StudiableTerm } from "./studiable-term";
33

44
export interface Question {

src/interfaces/round-summary.ts renamed to apps/next/src/interfaces/round-summary.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Term } from "@prisma/client";
1+
import type { Term } from "@quenti/prisma/client";
22

33
export interface RoundSummary {
44
round: number;

src/interfaces/set-folder-entity.ts renamed to apps/next/src/interfaces/set-folder-entity.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { StudySetVisibility } from "@prisma/client";
1+
import type { StudySetVisibility } from "@quenti/prisma/client";
22

33
export interface SetFolderEntity {
44
type: "set" | "folder";

src/interfaces/studiable-term.ts renamed to apps/next/src/interfaces/studiable-term.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Term } from "@prisma/client";
1+
import type { Term } from "@quenti/prisma/client";
22

33
export type StudiableTerm = Term & {
44
correctness: number;
File renamed without changes.

src/lib/evaluator.ts renamed to apps/next/src/lib/evaluator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { MultipleAnswerMode } from "@prisma/client";
1+
import type { MultipleAnswerMode } from "@quenti/prisma/client";
22
import type { Language } from "./language";
33

44
export enum EvaluationResult {
File renamed without changes.

src/lib/language.ts renamed to apps/next/src/lib/language.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
import type { StudySetAnswerMode } from "@quenti/prisma/client";
12
import json from "../../languages.json";
23
const languages = json.languages;
34
const suggestions = json.suggestions;
4-
import type { StudySetAnswerMode } from "@prisma/client";
55

66
export type Language = keyof typeof languages;
77

File renamed without changes.

src/lib/urls.ts renamed to apps/next/src/lib/urls.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { env } from "../env/client.mjs";
1+
import { env } from "@quenti/env/client";
22

33
export const getBaseDomain = () => {
44
return env.NEXT_PUBLIC_BASE_URL.replace(/https?:\/\//, "");
File renamed without changes.

src/modules/admin/emails.tsx renamed to apps/next/src/modules/admin/emails.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
Thead,
2020
Tr,
2121
} from "@chakra-ui/react";
22-
import type { RecentFailedLogin } from "@prisma/client";
22+
import type { RecentFailedLogin } from "@quenti/prisma/client";
2323
import { IconPlus, IconTrash, IconUserPlus } from "@tabler/icons-react";
2424
import React from "react";
2525
import { useAdmin } from "../../hooks/use-admin";
File renamed without changes.

src/modules/create-sort-flashcards-data.tsx renamed to apps/next/src/modules/create-sort-flashcards-data.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Term } from "@prisma/client";
1+
import type { Term } from "@quenti/prisma/client";
22
import React from "react";
33
import { RootFlashcardContext } from "../components/root-flashcard-wrapper";
44
import { queryEventChannel } from "../events/query";

0 commit comments

Comments
 (0)