Compare commits

..

4 Commits

Author SHA1 Message Date
d5203e236a Add prisma to requestcontext type
All checks were successful
Test, Build, Deploy / Test, Build, and Deploy (push) Successful in 1m9s
Test, Build, Deploy / Create Sentry Release (push) Successful in 6s
2026-04-11 00:59:03 -04:00
71f56769c1 Add maintenance screen 2026-04-09 03:53:20 -04:00
61c75df368 Add prisma schema (and update) 2026-04-09 03:48:13 -04:00
91fa274df8 Add prisma 2026-04-06 01:53:22 -04:00
8 changed files with 1350 additions and 20 deletions

View File

@@ -27,6 +27,9 @@ jobs:
- name: Install Dependencies
run: npm ci --include=dev
- name: Generate Prisma Types
run: npx prisma generate
- name: Check Formatting
run: npm run check-format

2
.gitignore vendored
View File

@@ -37,3 +37,5 @@ public/build
# Wrangler data
.wrangler
/generated/prisma

View File

@@ -2,8 +2,10 @@ import {
ChakraProvider,
Container,
cookieStorageManagerSSR,
Flex,
Heading,
Link,
Spacer,
Text,
} from "@chakra-ui/react";
import { ClientStyleContext, ServerStyleContext } from "./context.js";
@@ -59,6 +61,42 @@ export function ErrorBoundary() {
const { status } = error;
const loaderData = useRouteLoaderData<typeof loader>("root") || {};
if (loaderData.mx)
return (
<DocumentWrapper loaderData={{ ...loaderData, hide: true }}>
<Container
left="50%"
maxW="container.md"
pos="absolute"
top="50%"
transform="translate(-50%, -50%)"
>
<Flex>
<Spacer />
<svg
xmlns="http://www.w3.org/2000/svg"
width="128"
height="128"
fill="currentColor"
viewBox="0 0 16 16"
>
<path d="M12.496 8a4.5 4.5 0 0 1-1.703 3.526L9.497 8.5l2.959-1.11q.04.3.04.61" />
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-1 0a7 7 0 1 0-13.202 3.249l1.988-1.657a4.5 4.5 0 0 1 7.537-4.623L7.497 6.5l1 2.5 1.333 3.11c-.56.251-1.18.39-1.833.39a4.5 4.5 0 0 1-1.592-.29L4.747 14.2A7 7 0 0 0 15 8m-8.295.139a.25.25 0 0 0-.288-.376l-1.5.5.159.474.808-.27-.595.894a.25.25 0 0 0 .287.376l.808-.27-.595.894a.25.25 0 0 0 .287.376l1.5-.5-.159-.474-.808.27.596-.894a.25.25 0 0 0-.288-.376l-.808.27z" />
</svg>
<Spacer />
</Flex>
<br />
<Heading textAlign="center">
The engineers are breaking stuff again
</Heading>
<br />
<Text textAlign="center">
Someday they will finish, come back later.
</Text>
</Container>
</DocumentWrapper>
);
switch (status) {
case 303:
return "";
@@ -136,6 +174,10 @@ export async function loader({
if (context.data.nonce) data.nonce = context.data.nonce;
if (context.data.theme) data.theme = context.data.theme;
try {
if (await context.env.DATA.get("mx")) data.mx = "1";
} catch {}
return data;
}

8
index.d.ts vendored
View File

@@ -1,3 +1,5 @@
import { type PrismaClient } from "./generated/prisma/client.js";
declare global {
module "*.css";
@@ -17,7 +19,11 @@ declare global {
token: string;
};
type RequestContext = EventContext<Env, string, { [k: string]: any }>;
type RequestContext = EventContext<
Env,
string,
{ prisma: PrismaClient; [k: string]: any }
>;
interface AppealCardProps {
approved: number | null;

1145
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -14,6 +14,8 @@
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.1",
"@fontsource-variable/plus-jakarta-sans": "^5.2.8",
"@prisma/adapter-d1": "^7.7.0",
"@prisma/client": "^7.7.0",
"@remix-run/cloudflare": "^2.17.4",
"@remix-run/cloudflare-pages": "^2.17.4",
"@remix-run/react": "^2.17.4",
@@ -34,6 +36,7 @@
"@types/react-dom": "^18.3.7",
"dotenv": "^17.3.1",
"prettier": "^3.8.1",
"prisma": "^7.7.0",
"typescript": "^5.9.3"
},
"overrides": {

12
prisma.config.ts Normal file
View File

@@ -0,0 +1,12 @@
import "dotenv/config";
import { defineConfig } from "prisma/config";
export default defineConfig({
schema: "prisma/schema.prisma",
migrations: {
path: "prisma/migrations",
},
datasource: {
url: process.env["DATABASE_URL"],
},
});

155
prisma/schema.prisma Normal file
View File

@@ -0,0 +1,155 @@
generator client {
provider = "prisma-client"
output = "../generated/prisma"
}
datasource db {
provider = "sqlite"
}
model Appeal {
approved Boolean?
ban_reason String
created_at DateTime @default(now())
id String @id @unique
learned String
reason_for_unban String
user Json
@@index([approved, created_at], name: "idx_appeals_approved_created_at")
@@map("appeals")
}
model AppealBan {
created_at DateTime @default(now())
created_by String
user String @id @unique
@@map("appeal_bans")
}
model EtMember {
created_at DateTime @default(now())
created_by String
id String @id @unique
is_management Boolean @default(false)
name String
points Int @default(0)
roblox_id Int?
@@index([id, name], name: "idx_et_members_id_name")
@@map("et_members")
}
model EtStrike {
created_at DateTime @default(now())
created_by String
id String @id @unique
reason String
user String
@@map("et_strikes")
}
model Event {
answer String?
answered_at DateTime?
approved Boolean @default(false)
created_at DateTime @default(now())
created_by String
day Int
details String
id String @id @unique
month Int
pending Boolean @default(true)
performed_at DateTime?
reached_minimum_player_count Boolean @default(false)
type String
year Int
@@index([month, year], name: "idx_events_month_year")
@@map("events")
}
model GameAppeal {
created_at DateTime @default(now())
id String @id @unique
reason_for_unban String
roblox_id Int
roblox_username String
type String
what_happened String
@@index([created_at], name: "idx_game_appeals_created_at")
@@map("game_appeals")
}
model GameModLog {
action String
evidence String
executed_at DateTime @default(now())
executor String
id String @id @unique
target Int
@@index([target], name: "idx_game_mod_logs_target")
@@map("game_mod_logs")
}
model GameModNote {
content String
created_at DateTime @default(now())
created_by String
id String @id @unique
target Int
@@index([target], name: "idx_game_mod_notes_target")
@@map("game_mod_notes")
}
model InactivityNotice {
created_at DateTime @default(now())
decisions Json
departments Json @default("[]")
end String
hiatus Boolean @default(false)
id String @id @unique
reason String
start String
user Json
@@index([end, start], name: "idx_inactivity_notices_end_start")
@@map("inactivity_notices")
}
model PushNotification {
created_at DateTime @default(now())
event_id String @unique
event_type String
token String
@@map("push_notifications")
}
model Report {
attachments Json @default("[]")
created_at DateTime @default(now())
id String @id @unique
open Boolean @default(true)
target_ids Json @default("[]")
target_usernames Json @default("[]")
type String @default("exploit")
user Json?
@@index([created_at, open], name: "idx_reports_created_at_open")
@@map("reports")
}
model ShortLink {
created_at DateTime @default(now())
destination String
path String @unique
user String
@@map("short_links")
}