7
Frontend/.env-example
Normal file
@ -0,0 +1,7 @@
|
||||
NEXT_PUBLIC_SITE_URL=http://localhost:3000
|
||||
NEXT_PUBLIC_TRIGGER_PUBLIC_API_KEY=
|
||||
|
||||
TRIGGER_API_KEY=
|
||||
TRIGGER_API_URL=https://trigger.example.com
|
||||
MONGO_URI=mongodb://127.0.0.1:27017
|
||||
SENTRY_AUTH_TOKEN=
|
3
Frontend/.eslintrc.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": ["next/core-web-vitals", "next/typescript"]
|
||||
}
|
41
Frontend/.gitignore
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
/.pnp
|
||||
.pnp.js
|
||||
.yarn/install-state.gz
|
||||
|
||||
# testing
|
||||
/coverage
|
||||
|
||||
# next.js
|
||||
/.next/
|
||||
/out/
|
||||
|
||||
# production
|
||||
/build
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
*.pem
|
||||
|
||||
# debug
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# local env files
|
||||
.env*.local
|
||||
|
||||
# vercel
|
||||
.vercel
|
||||
|
||||
# typescript
|
||||
*.tsbuildinfo
|
||||
next-env.d.ts
|
||||
|
||||
.idea
|
||||
|
||||
# Sentry Config File
|
||||
.env.sentry-build-plugin
|
12
Frontend/.prettierrc.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"semi": true,
|
||||
"tabWidth": 2,
|
||||
"useTabs": false,
|
||||
"singleQuote": false,
|
||||
"trailingComma": "es5",
|
||||
"printWidth": 120,
|
||||
"bracketSpacing": true,
|
||||
"arrowParens": "avoid",
|
||||
"jsxSingleQuote": false,
|
||||
"jsxBracketSameLine": false
|
||||
}
|
65
Frontend/Dockerfile
Normal file
@ -0,0 +1,65 @@
|
||||
FROM fascinated/docker-images:nodejs_20_with_pnpm AS base
|
||||
|
||||
# Install dependencies and build tools for canvas
|
||||
FROM base AS deps
|
||||
RUN apk add --no-cache python3 make g++ gcc pkgconfig pixman cairo-dev libjpeg-turbo-dev pango-dev giflib-dev
|
||||
WORKDIR /app
|
||||
COPY package.json* pnpm-lock.yaml* ./
|
||||
RUN pnpm install --frozen-lockfile --quiet
|
||||
|
||||
# Build from source
|
||||
FROM base AS builder
|
||||
WORKDIR /app
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
|
||||
# Install runtime dependencies
|
||||
RUN apk add --no-cache cairo pango libjpeg-turbo giflib
|
||||
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
|
||||
# Add the commit hash
|
||||
ARG GIT_REV
|
||||
ENV GIT_REV=${GIT_REV}
|
||||
|
||||
# Add the sentry auth token
|
||||
ARG SENTRY_AUTH_TOKEN
|
||||
ENV SENTRY_AUTH_TOKEN=${SENTRY_AUTH_TOKEN}
|
||||
|
||||
# Build the app
|
||||
RUN pnpm run build
|
||||
|
||||
# Final stage to run the app
|
||||
FROM base AS runner
|
||||
WORKDIR /app
|
||||
|
||||
# Install runtime dependencies
|
||||
RUN apk add --no-cache cairo pango libjpeg-turbo giflib
|
||||
|
||||
ENV NODE_ENV=production
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
|
||||
RUN addgroup --system --gid 1001 nodejs
|
||||
RUN adduser --system --uid 1001 nextjs
|
||||
|
||||
RUN mkdir .next
|
||||
RUN chown nextjs:nodejs .next
|
||||
|
||||
# Add the commit hash
|
||||
ARG GIT_REV
|
||||
ENV GIT_REV=${GIT_REV}
|
||||
|
||||
# Copy the built app from the builder stage
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/node_modules ./node_modules
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next ./.next
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/public ./public
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/package.json ./package.json
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/next.config.mjs ./next.config.mjs
|
||||
|
||||
USER nextjs
|
||||
|
||||
EXPOSE 3000
|
||||
ENV HOSTNAME="0.0.0.0"
|
||||
ENV PORT=3000
|
||||
|
||||
CMD ["pnpm", "start"]
|
20
Frontend/components.json
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"$schema": "https://ui.shadcn.com/schema.json",
|
||||
"style": "new-york",
|
||||
"rsc": true,
|
||||
"tsx": true,
|
||||
"tailwind": {
|
||||
"config": "tailwind.config.ts",
|
||||
"css": "src/app/globals.css",
|
||||
"baseColor": "stone",
|
||||
"cssVariables": true,
|
||||
"prefix": ""
|
||||
},
|
||||
"aliases": {
|
||||
"components": "@/app/components",
|
||||
"utils": "@/app/common/utils",
|
||||
"ui": "@/app/components/ui",
|
||||
"lib": "@/app/common",
|
||||
"hooks": "@/app/hooks"
|
||||
}
|
||||
}
|
3
Frontend/config.ts
Normal file
@ -0,0 +1,3 @@
|
||||
export const config = {
|
||||
siteUrl: process.env.NEXT_PUBLIC_SITE_URL || "https://ssr.fascinated.cc",
|
||||
};
|
61
Frontend/next.config.mjs
Normal file
@ -0,0 +1,61 @@
|
||||
import { withSentryConfig } from "@sentry/nextjs";
|
||||
import { format } from "@formkit/tempo";
|
||||
import nextBuildId from "next-build-id";
|
||||
import path from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url); // get the resolved path to the file
|
||||
const __dirname = path.dirname(__filename); // get the name of the directory
|
||||
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
experimental: {
|
||||
webpackMemoryOptimizations: true,
|
||||
},
|
||||
images: {
|
||||
remotePatterns: [
|
||||
{
|
||||
protocol: "https",
|
||||
hostname: "cdn.scoresaber.com",
|
||||
port: "",
|
||||
pathname: "/**",
|
||||
},
|
||||
],
|
||||
},
|
||||
env: {
|
||||
NEXT_PUBLIC_BUILD_ID:
|
||||
process.env.GIT_REV || nextBuildId.sync({ dir: __dirname }),
|
||||
NEXT_PUBLIC_BUILD_TIME: new Date().toLocaleDateString("en-US", {
|
||||
year: "numeric",
|
||||
month: "long",
|
||||
day: "numeric",
|
||||
hour: "numeric",
|
||||
minute: "numeric",
|
||||
timeZoneName: "short",
|
||||
}),
|
||||
NEXT_PUBLIC_BUILD_TIME_SHORT: format(new Date(), {
|
||||
date: "short",
|
||||
time: "short",
|
||||
}),
|
||||
},
|
||||
};
|
||||
|
||||
export default withSentryConfig(nextConfig, {
|
||||
org: "scoresaber-reloaded",
|
||||
project: "frontend",
|
||||
sentryUrl: "https://glitchtip.fascinated.cc/",
|
||||
silent: !process.env.CI,
|
||||
reactComponentAnnotation: {
|
||||
enabled: true,
|
||||
},
|
||||
tunnelRoute: "/monitoring",
|
||||
hideSourceMaps: true,
|
||||
disableLogger: true,
|
||||
sourcemaps: {
|
||||
disable: true,
|
||||
},
|
||||
release: {
|
||||
create: false,
|
||||
finalize: false,
|
||||
},
|
||||
});
|
66
Frontend/package.json
Normal file
@ -0,0 +1,66 @@
|
||||
{
|
||||
"name": "scoresaber-reloadedv3",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev --turbo",
|
||||
"build": "next build",
|
||||
"start": "next start",
|
||||
"lint": "next lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@formkit/tempo": "^0.1.2",
|
||||
"@heroicons/react": "^2.1.5",
|
||||
"@hookform/resolvers": "^3.9.0",
|
||||
"@radix-ui/react-avatar": "^1.1.0",
|
||||
"@radix-ui/react-icons": "^1.3.0",
|
||||
"@radix-ui/react-label": "^2.1.0",
|
||||
"@radix-ui/react-scroll-area": "^1.1.0",
|
||||
"@radix-ui/react-slot": "^1.1.0",
|
||||
"@radix-ui/react-toast": "^1.2.1",
|
||||
"@radix-ui/react-tooltip": "^1.1.2",
|
||||
"@sentry/nextjs": "8",
|
||||
"@tanstack/react-query": "^5.55.4",
|
||||
"@trigger.dev/nextjs": "^3.0.8",
|
||||
"@trigger.dev/react": "^3.0.8",
|
||||
"@trigger.dev/sdk": "^3.0.8",
|
||||
"@uidotdev/usehooks": "^2.4.1",
|
||||
"canvas": "3.0.0-rc2",
|
||||
"chart.js": "^4.4.4",
|
||||
"class-variance-authority": "^0.7.0",
|
||||
"clsx": "^2.1.1",
|
||||
"comlink": "^4.4.1",
|
||||
"dexie": "^4.0.8",
|
||||
"dexie-react-hooks": "^1.1.7",
|
||||
"extract-colors": "^4.0.8",
|
||||
"framer-motion": "^11.5.4",
|
||||
"js-cookie": "^3.0.5",
|
||||
"ky": "^1.7.2",
|
||||
"lucide-react": "^0.447.0",
|
||||
"mongoose": "^8.7.0",
|
||||
"next": "15.0.0-rc.0",
|
||||
"next-build-id": "^3.0.0",
|
||||
"next-themes": "^0.3.0",
|
||||
"react": "19.0.0-rc-3edc000d-20240926",
|
||||
"react-chartjs-2": "^5.2.0",
|
||||
"react-dom": "19.0.0-rc-3edc000d-20240926",
|
||||
"react-hook-form": "^7.53.0",
|
||||
"tailwind-merge": "^2.5.2",
|
||||
"tailwindcss-animate": "^1.0.7",
|
||||
"zod": "^3.23.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/js-cookie": "^3.0.6",
|
||||
"@types/node": "^20",
|
||||
"@types/react": "^18",
|
||||
"@types/react-dom": "^18",
|
||||
"eslint": "^8",
|
||||
"eslint-config-next": "14.2.14",
|
||||
"postcss": "^8",
|
||||
"tailwindcss": "^3.4.1",
|
||||
"typescript": "^5"
|
||||
},
|
||||
"trigger.dev": {
|
||||
"endpointId": "scoresaber-reloaded-KB0Z"
|
||||
}
|
||||
}
|
7582
Frontend/pnpm-lock.yaml
generated
Normal file
8
Frontend/postcss.config.mjs
Normal file
@ -0,0 +1,8 @@
|
||||
/** @type {import('postcss-load-config').Config} */
|
||||
const config = {
|
||||
plugins: {
|
||||
tailwindcss: {},
|
||||
},
|
||||
};
|
||||
|
||||
export default config;
|
BIN
Frontend/public/assets/background.jpg
Normal file
After Width: | Height: | Size: 1.4 MiB |
BIN
Frontend/public/assets/flags/ad.png
Normal file
After Width: | Height: | Size: 841 B |
BIN
Frontend/public/assets/flags/ae.png
Normal file
After Width: | Height: | Size: 132 B |
BIN
Frontend/public/assets/flags/af.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
Frontend/public/assets/flags/ag.png
Normal file
After Width: | Height: | Size: 766 B |
BIN
Frontend/public/assets/flags/ai.png
Normal file
After Width: | Height: | Size: 659 B |
BIN
Frontend/public/assets/flags/al.png
Normal file
After Width: | Height: | Size: 604 B |
BIN
Frontend/public/assets/flags/am.png
Normal file
After Width: | Height: | Size: 121 B |
BIN
Frontend/public/assets/flags/ao.png
Normal file
After Width: | Height: | Size: 522 B |
BIN
Frontend/public/assets/flags/aq.png
Normal file
After Width: | Height: | Size: 445 B |
BIN
Frontend/public/assets/flags/ar.png
Normal file
After Width: | Height: | Size: 320 B |
BIN
Frontend/public/assets/flags/as.png
Normal file
After Width: | Height: | Size: 909 B |
BIN
Frontend/public/assets/flags/at.png
Normal file
After Width: | Height: | Size: 109 B |
BIN
Frontend/public/assets/flags/au.png
Normal file
After Width: | Height: | Size: 554 B |
BIN
Frontend/public/assets/flags/aw.png
Normal file
After Width: | Height: | Size: 311 B |
BIN
Frontend/public/assets/flags/ax.png
Normal file
After Width: | Height: | Size: 179 B |
BIN
Frontend/public/assets/flags/az.png
Normal file
After Width: | Height: | Size: 214 B |
BIN
Frontend/public/assets/flags/ba.png
Normal file
After Width: | Height: | Size: 339 B |
BIN
Frontend/public/assets/flags/bb.png
Normal file
After Width: | Height: | Size: 324 B |
BIN
Frontend/public/assets/flags/bd.png
Normal file
After Width: | Height: | Size: 282 B |
BIN
Frontend/public/assets/flags/be.png
Normal file
After Width: | Height: | Size: 127 B |
BIN
Frontend/public/assets/flags/bf.png
Normal file
After Width: | Height: | Size: 254 B |
BIN
Frontend/public/assets/flags/bg.png
Normal file
After Width: | Height: | Size: 105 B |
BIN
Frontend/public/assets/flags/bh.png
Normal file
After Width: | Height: | Size: 326 B |
BIN
Frontend/public/assets/flags/bi.png
Normal file
After Width: | Height: | Size: 651 B |
BIN
Frontend/public/assets/flags/bj.png
Normal file
After Width: | Height: | Size: 127 B |
BIN
Frontend/public/assets/flags/bl.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
Frontend/public/assets/flags/bm.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
Frontend/public/assets/flags/bn.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
Frontend/public/assets/flags/bo.png
Normal file
After Width: | Height: | Size: 132 B |
BIN
Frontend/public/assets/flags/bq.png
Normal file
After Width: | Height: | Size: 810 B |
BIN
Frontend/public/assets/flags/br.png
Normal file
After Width: | Height: | Size: 792 B |
BIN
Frontend/public/assets/flags/bs.png
Normal file
After Width: | Height: | Size: 287 B |
BIN
Frontend/public/assets/flags/bt.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
Frontend/public/assets/flags/bv.png
Normal file
After Width: | Height: | Size: 206 B |
BIN
Frontend/public/assets/flags/bw.png
Normal file
After Width: | Height: | Size: 139 B |
BIN
Frontend/public/assets/flags/by.png
Normal file
After Width: | Height: | Size: 377 B |
BIN
Frontend/public/assets/flags/bz.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
Frontend/public/assets/flags/ca.png
Normal file
After Width: | Height: | Size: 359 B |
BIN
Frontend/public/assets/flags/cc.png
Normal file
After Width: | Height: | Size: 561 B |
BIN
Frontend/public/assets/flags/cd.png
Normal file
After Width: | Height: | Size: 523 B |
BIN
Frontend/public/assets/flags/cf.png
Normal file
After Width: | Height: | Size: 286 B |
BIN
Frontend/public/assets/flags/cg.png
Normal file
After Width: | Height: | Size: 344 B |
BIN
Frontend/public/assets/flags/ch.png
Normal file
After Width: | Height: | Size: 135 B |
BIN
Frontend/public/assets/flags/ci.png
Normal file
After Width: | Height: | Size: 123 B |
BIN
Frontend/public/assets/flags/ck.png
Normal file
After Width: | Height: | Size: 717 B |
BIN
Frontend/public/assets/flags/cl.png
Normal file
After Width: | Height: | Size: 263 B |
BIN
Frontend/public/assets/flags/cm.png
Normal file
After Width: | Height: | Size: 215 B |
BIN
Frontend/public/assets/flags/cn.png
Normal file
After Width: | Height: | Size: 286 B |
BIN
Frontend/public/assets/flags/co.png
Normal file
After Width: | Height: | Size: 135 B |
BIN
Frontend/public/assets/flags/cr.png
Normal file
After Width: | Height: | Size: 419 B |
BIN
Frontend/public/assets/flags/cu.png
Normal file
After Width: | Height: | Size: 362 B |
BIN
Frontend/public/assets/flags/cv.png
Normal file
After Width: | Height: | Size: 444 B |
BIN
Frontend/public/assets/flags/cw.png
Normal file
After Width: | Height: | Size: 260 B |
BIN
Frontend/public/assets/flags/cx.png
Normal file
After Width: | Height: | Size: 641 B |
BIN
Frontend/public/assets/flags/cy.png
Normal file
After Width: | Height: | Size: 486 B |
BIN
Frontend/public/assets/flags/cz.png
Normal file
After Width: | Height: | Size: 361 B |
BIN
Frontend/public/assets/flags/de.png
Normal file
After Width: | Height: | Size: 105 B |
BIN
Frontend/public/assets/flags/dj.png
Normal file
After Width: | Height: | Size: 530 B |
BIN
Frontend/public/assets/flags/dk.png
Normal file
After Width: | Height: | Size: 163 B |
BIN
Frontend/public/assets/flags/dm.png
Normal file
After Width: | Height: | Size: 501 B |
BIN
Frontend/public/assets/flags/do.png
Normal file
After Width: | Height: | Size: 459 B |
BIN
Frontend/public/assets/flags/dz.png
Normal file
After Width: | Height: | Size: 368 B |
BIN
Frontend/public/assets/flags/ec.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
Frontend/public/assets/flags/ee.png
Normal file
After Width: | Height: | Size: 106 B |
BIN
Frontend/public/assets/flags/eg.png
Normal file
After Width: | Height: | Size: 323 B |
BIN
Frontend/public/assets/flags/eh.png
Normal file
After Width: | Height: | Size: 358 B |
BIN
Frontend/public/assets/flags/er.png
Normal file
After Width: | Height: | Size: 533 B |
BIN
Frontend/public/assets/flags/es.png
Normal file
After Width: | Height: | Size: 828 B |
BIN
Frontend/public/assets/flags/et.png
Normal file
After Width: | Height: | Size: 559 B |
BIN
Frontend/public/assets/flags/fi.png
Normal file
After Width: | Height: | Size: 160 B |
BIN
Frontend/public/assets/flags/fj.png
Normal file
After Width: | Height: | Size: 991 B |
BIN
Frontend/public/assets/flags/fk.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
Frontend/public/assets/flags/fm.png
Normal file
After Width: | Height: | Size: 259 B |
BIN
Frontend/public/assets/flags/fo.png
Normal file
After Width: | Height: | Size: 192 B |
BIN
Frontend/public/assets/flags/fr.png
Normal file
After Width: | Height: | Size: 123 B |
BIN
Frontend/public/assets/flags/ga.png
Normal file
After Width: | Height: | Size: 106 B |
BIN
Frontend/public/assets/flags/gb-eng.png
Normal file
After Width: | Height: | Size: 134 B |
BIN
Frontend/public/assets/flags/gb-nir.png
Normal file
After Width: | Height: | Size: 566 B |
BIN
Frontend/public/assets/flags/gb-sct.png
Normal file
After Width: | Height: | Size: 428 B |
BIN
Frontend/public/assets/flags/gb-wls.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
Frontend/public/assets/flags/gb.png
Normal file
After Width: | Height: | Size: 384 B |
BIN
Frontend/public/assets/flags/gd.png
Normal file
After Width: | Height: | Size: 615 B |
BIN
Frontend/public/assets/flags/ge.png
Normal file
After Width: | Height: | Size: 307 B |
BIN
Frontend/public/assets/flags/gf.png
Normal file
After Width: | Height: | Size: 533 B |
BIN
Frontend/public/assets/flags/gg.png
Normal file
After Width: | Height: | Size: 222 B |
BIN
Frontend/public/assets/flags/gh.png
Normal file
After Width: | Height: | Size: 294 B |
BIN
Frontend/public/assets/flags/gi.png
Normal file
After Width: | Height: | Size: 817 B |
BIN
Frontend/public/assets/flags/gl.png
Normal file
After Width: | Height: | Size: 375 B |