From 055360a8775ded62f2e1458f9634e912bd5fda31 Mon Sep 17 00:00:00 2001
From: VL <56016278+myworldbox@users.noreply.github.com>
Date: Sun, 23 Apr 2023 04:34:54 +0800
Subject: [PATCH 01/43] Update index.ts
---
server/src/db/index.ts | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/server/src/db/index.ts b/server/src/db/index.ts
index 8ef0672..39438a4 100644
--- a/server/src/db/index.ts
+++ b/server/src/db/index.ts
@@ -1,6 +1,11 @@
import pg from "pg";
-export const db = new pg.Pool();
+export const db = new pg.Pool({
+ connectionString: process.env.DATABASE_URL,
+ ssl: {
+ rejectUnauthorized: false,
+ },
+});
export const INIT_TABLES = /* sql */ `
CREATE TABLE IF NOT EXISTS "user" (
From 7848e6630f2b593ee569922f1c4ebab7c694964c Mon Sep 17 00:00:00 2001
From: myworldbox <54nicholasleung45@gmail.com>
Date: Sun, 23 Apr 2023 05:28:55 +0800
Subject: [PATCH 02/43] ok
---
README.md | 10 +++++-----
client/src/app/[code]/page.tsx | 2 +-
client/src/app/archive/[id]/page.tsx | 2 +-
client/src/app/layout.tsx | 4 ++--
client/src/app/user/[name]/page.tsx | 2 +-
client/src/components/archive/ArchivedGame.tsx | 4 ++--
client/src/components/game/GamePage.tsx | 6 +++---
client/src/components/home/JoinGame.tsx | 2 +-
client/src/components/user/CopyLink.tsx | 4 ++--
9 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/README.md b/README.md
index 2065d8f..f3d4448 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-
-
+
+
@@ -11,7 +11,7 @@
> This project is still in the early stages of development. Expect bugs and incomplete features.
-Yet another Chess web app. Live demo at [ches.su](https://ches.su).
+Yet another Chess web app. Live demo at [chessust.vercel.app](https://chessust.vercel.app).
- play against other users in real-time
- spectate and chat in ongoing games with other users
@@ -28,8 +28,8 @@ Built with Next.js 13, Tailwind CSS + daisyUI, react-chessboard, chess.js, Expre
This project is structured as a monorepo using npm workspaces, separated into three packages:
-- `client` - Next.js application for the front-end, deployed to [ches.su](https://ches.su) via Vercel.
-- `server` - Node/Express.js application for the back-end, deployed to [server.ches.su](https://server.ches.su) via Railway.
+- `client` - Next.js application for the front-end, deployed to [chessust.vercel.app](https://chessust.vercel.app) via Vercel.
+- `server` - Node/Express.js application for the back-end, deployed to [server.chessust.vercel.app](https://server.chessust.vercel.app) via Railway.
- `types` - Shared type definitions for the client and server.
For separate deployments, you may exclude the `client` or `server` directory. However, you should include the `types` folder as it contains shared type definitions that are required by both packages.
diff --git a/client/src/app/[code]/page.tsx b/client/src/app/[code]/page.tsx
index 636f051..1c8404f 100644
--- a/client/src/app/[code]/page.tsx
+++ b/client/src/app/[code]/page.tsx
@@ -20,7 +20,7 @@ export async function generateMetadata({ params }: { params: { code: string } })
openGraph: {
title: "chessu",
description: `Play or watch a game with ${game.host?.name}`,
- url: `https://ches.su/${game.code}`,
+ url: `https://chessust.vercel.app/${game.code}`,
siteName: "chessu",
locale: "en_US",
type: "website"
diff --git a/client/src/app/archive/[id]/page.tsx b/client/src/app/archive/[id]/page.tsx
index a1c5dde..2959ca5 100644
--- a/client/src/app/archive/[id]/page.tsx
+++ b/client/src/app/archive/[id]/page.tsx
@@ -21,7 +21,7 @@ export async function generateMetadata({ params }: { params: { id: number } }) {
openGraph: {
title: "chessu",
description: `Archived game: ${game.white?.name} vs ${game.black?.name}`,
- url: `https://ches.su/archive/${game.id}`,
+ url: `https://chessust.vercel.app/archive/${game.id}`,
siteName: "chessu",
locale: "en_US",
type: "website"
diff --git a/client/src/app/layout.tsx b/client/src/app/layout.tsx
index c972a7d..a33ea8c 100644
--- a/client/src/app/layout.tsx
+++ b/client/src/app/layout.tsx
@@ -12,7 +12,7 @@ export const metadata = {
openGraph: {
title: "chessu",
description: "Play Chess online.",
- url: "https://ches.su",
+ url: "https://chessust.vercel.app",
siteName: "chessu",
locale: "en_US",
type: "website"
@@ -31,7 +31,7 @@ export const metadata = {
apple: { url: "/apple-touch-icon.png", sizes: "180x180" }
},
manifest: "/site.webmanifest",
- metadataBase: new URL(process.env.VERCEL ? "https://ches.su" : "http://localhost:3000")
+ metadataBase: new URL(process.env.VERCEL ? "https://chessust.vercel.app" : "http://localhost:3000")
};
export default function RootLayout({ children }: { children: React.ReactNode }) {
diff --git a/client/src/app/user/[name]/page.tsx b/client/src/app/user/[name]/page.tsx
index 7a768b5..2047169 100644
--- a/client/src/app/user/[name]/page.tsx
+++ b/client/src/app/user/[name]/page.tsx
@@ -21,7 +21,7 @@ export async function generateMetadata({ params }: { params: { name: string } })
openGraph: {
title: `${data.name} | chessu`,
description: `${data.name}'s profile on chessu`,
- url: `https://ches.su/user/${data.name}`,
+ url: `https://chessust.vercel.app/user/${data.name}`,
siteName: "chessu",
locale: "en_US",
type: "website"
diff --git a/client/src/components/archive/ArchivedGame.tsx b/client/src/components/archive/ArchivedGame.tsx
index b912181..6febbcb 100644
--- a/client/src/components/archive/ArchivedGame.tsx
+++ b/client/src/components/archive/ArchivedGame.tsx
@@ -68,7 +68,7 @@ export default function ArchivedGame({ game }: { game: Game }) {
}, []);
function copyLink() {
- const text = `https://ches.su/archive/${game.id}`;
+ const text = `https://chessust.vercel.app/archive/${game.id}`;
if ("clipboard" in navigator) {
navigator.clipboard.writeText(text);
} else {
@@ -266,7 +266,7 @@ export default function ArchivedGame({ game }: { game: Game }) {
onClick={copyLink}
>
+