+ Copied! +
+Copy
+{children}
; +} diff --git a/apps/webapp/app/components/primitives/text/BodyBold.tsx b/apps/webapp/app/components/primitives/text/BodyBold.tsx new file mode 100644 index 000000000..18e8cc18e --- /dev/null +++ b/apps/webapp/app/components/primitives/text/BodyBold.tsx @@ -0,0 +1,12 @@ +export type BodyBoldProps = { + children: React.ReactNode; + className: string; +}; + +export function BodyBold({ children, className }: BodyBoldProps) { + return ( ++ {children} +
+ ); +} diff --git a/apps/webapp/app/components/primitives/text/ExtraLargeTitle.tsx b/apps/webapp/app/components/primitives/text/ExtraLargeTitle.tsx new file mode 100644 index 000000000..60aed1867 --- /dev/null +++ b/apps/webapp/app/components/primitives/text/ExtraLargeTitle.tsx @@ -0,0 +1,8 @@ +export type ExtraLargeTitleProps = { + children: React.ReactNode; + className: string; +}; + +export function ExtraLargeTitle({ children, className }: ExtraLargeTitleProps) { + return{children}
; +} diff --git a/apps/webapp/app/components/primitives/text/ExtraSmallBody.tsx b/apps/webapp/app/components/primitives/text/ExtraSmallBody.tsx new file mode 100644 index 000000000..6a927eedc --- /dev/null +++ b/apps/webapp/app/components/primitives/text/ExtraSmallBody.tsx @@ -0,0 +1,8 @@ +export type ExtraSmallBodyProps = { + children: React.ReactNode; + className?: string; +}; + +export function ExtraSmallBody({ children, className }: ExtraSmallBodyProps) { + return{children}
; +} diff --git a/apps/webapp/app/components/primitives/text/LargeTitle.tsx b/apps/webapp/app/components/primitives/text/LargeTitle.tsx new file mode 100644 index 000000000..6b957d866 --- /dev/null +++ b/apps/webapp/app/components/primitives/text/LargeTitle.tsx @@ -0,0 +1,8 @@ +export type LargeTitleProps = { + children: React.ReactNode; + className?: string; +}; + +export function LargeTitle({ children, className }: LargeTitleProps) { + return{children}
; +} diff --git a/apps/webapp/app/components/primitives/text/SmallBody.tsx b/apps/webapp/app/components/primitives/text/SmallBody.tsx new file mode 100644 index 000000000..e770abbc3 --- /dev/null +++ b/apps/webapp/app/components/primitives/text/SmallBody.tsx @@ -0,0 +1,8 @@ +export type SmallBodyProps = { + children: React.ReactNode; + className: string; +}; + +export function SmallBody({ children, className }: SmallBodyProps) { + return{children}
; +} diff --git a/apps/webapp/app/components/primitives/text/SmallTitle.tsx b/apps/webapp/app/components/primitives/text/SmallTitle.tsx new file mode 100644 index 000000000..7579cf7fd --- /dev/null +++ b/apps/webapp/app/components/primitives/text/SmallTitle.tsx @@ -0,0 +1,8 @@ +export type SmallTitleProps = { + children: React.ReactNode; + className?: string; +}; + +export function SmallTitle({ children, className }: SmallTitleProps) { + return{children}
; +} diff --git a/apps/webapp/app/components/primitives/text/Title.tsx b/apps/webapp/app/components/primitives/text/Title.tsx new file mode 100644 index 000000000..565763869 --- /dev/null +++ b/apps/webapp/app/components/primitives/text/Title.tsx @@ -0,0 +1,8 @@ +export type TitleProps = { + children: React.ReactNode; + className?: string; +}; + +export function Title({ children, className }: TitleProps) { + return{children}
; +} diff --git a/apps/webapp/app/db.server.ts b/apps/webapp/app/db.server.ts new file mode 100644 index 000000000..e3a94d313 --- /dev/null +++ b/apps/webapp/app/db.server.ts @@ -0,0 +1,71 @@ +import { PrismaClient, Prisma } from ".prisma/client"; +import invariant from "tiny-invariant"; +import { fieldEncryptionMiddleware } from "prisma-field-encryption"; + +let prisma: PrismaClient; + +declare global { + var __db__: PrismaClient; +} + +// this is needed because in development we don't want to restart +// the server with every change, but we want to make sure we don't +// create a new connection to the DB with every change either. +// in production we'll have a single connection to the DB. +if (process.env.NODE_ENV === "production") { + prisma = getClient(); +} else { + if (!global.__db__) { + global.__db__ = getClient(); + } + prisma = global.__db__; +} + +function getClient() { + const { DATABASE_URL } = process.env; + invariant(typeof DATABASE_URL === "string", "DATABASE_URL env var not set"); + + const databaseUrl = new URL(DATABASE_URL); + + const isLocalHost = databaseUrl.hostname === "localhost"; + + const PRIMARY_REGION = isLocalHost ? null : process.env.PRIMARY_REGION; + const FLY_REGION = isLocalHost ? null : process.env.FLY_REGION; + + const isReadReplicaRegion = !PRIMARY_REGION || PRIMARY_REGION === FLY_REGION; + + if (!isLocalHost) { + databaseUrl.host = `${FLY_REGION}.${databaseUrl.host}`; + if (!isReadReplicaRegion) { + // 5433 is the read-replica port + databaseUrl.port = "5433"; + } + } + + console.log(`🔌 setting up prisma client to ${databaseUrl.host}`); + // NOTE: during development if you change anything in this function, remember + // that this only runs once per server restart and won't automatically be + // re-run per request like everything else is. So if you need to change + // something in this file, you'll need to manually restart the server. + const client = new PrismaClient({ + datasources: { + db: { + url: databaseUrl.toString(), + }, + }, + }); + + client.$use( + fieldEncryptionMiddleware({ + dmmf: Prisma.dmmf, + }) + ); + + // connect eagerly + client.$connect(); + + return client; +} + +export { prisma }; +export type { PrismaClient } from ".prisma/client"; diff --git a/apps/webapp/app/entry.client.tsx b/apps/webapp/app/entry.client.tsx new file mode 100644 index 000000000..6342ff939 --- /dev/null +++ b/apps/webapp/app/entry.client.tsx @@ -0,0 +1,22 @@ +import { RemixBrowser, useLocation, useMatches } from "@remix-run/react"; +import { hydrate } from "react-dom"; +import * as Sentry from "@sentry/remix"; +import { useEffect } from "react"; + +hydrate(Legal stuff
+{page.title}
+ +