Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
055360a
Update index.ts
myworldbox Apr 22, 2023
7848e66
ok
myworldbox Apr 22, 2023
5ce8a1c
ok
myworldbox Apr 22, 2023
3a0f4cf
ok
myworldbox Apr 22, 2023
132e221
ok
myworldbox Apr 23, 2023
0311618
ok
myworldbox Apr 23, 2023
b36bc69
ok
myworldbox Apr 23, 2023
1563ff5
init
myworldbox Apr 23, 2023
2195fb8
init
myworldbox Apr 23, 2023
891d0df
init
myworldbox Apr 23, 2023
928a11c
init
myworldbox Apr 23, 2023
f86dc40
init
myworldbox Apr 23, 2023
75afca3
init
myworldbox Apr 23, 2023
9e6c0e1
init
myworldbox Apr 23, 2023
4b73b91
init
myworldbox Apr 23, 2023
cbaf0aa
init
myworldbox Apr 23, 2023
c958a11
init
myworldbox Apr 23, 2023
4283810
init
myworldbox Apr 23, 2023
a6a2572
init
myworldbox Apr 23, 2023
b7fa296
init
myworldbox Apr 23, 2023
7bb1c3f
init
myworldbox Apr 23, 2023
be5f15f
init
myworldbox Apr 23, 2023
03e93ce
init
myworldbox Apr 23, 2023
28da23c
init
myworldbox Apr 23, 2023
78f0b21
init
myworldbox Apr 23, 2023
1509cd7
init
myworldbox Apr 23, 2023
54f3dea
init
myworldbox Apr 23, 2023
84bf9cc
init
myworldbox Apr 23, 2023
c8c89b2
init
myworldbox Apr 23, 2023
8002584
init
myworldbox Apr 23, 2023
31f91b7
init
myworldbox Apr 23, 2023
f73da65
init
myworldbox Apr 23, 2023
a9cdd12
init
myworldbox Apr 23, 2023
861dafc
init
myworldbox Apr 23, 2023
97d99c2
init
myworldbox Apr 23, 2023
e921f7e
init
myworldbox Apr 23, 2023
7bfcc08
init
myworldbox Apr 23, 2023
2444707
init
myworldbox Apr 23, 2023
49d651c
init
myworldbox Apr 23, 2023
85a2246
init
myworldbox Apr 23, 2023
ccbeb2b
init
myworldbox Apr 23, 2023
d50f36c
init
myworldbox Apr 23, 2023
606d68f
init
myworldbox Apr 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<h1 align="center">
<img src="./assets/chessu.png" alt="chessu" height="128" />
<img src="./assets/chessu.png" alt="chessust" height="128" />
</h1>
<p align="center">
<a href="https://ches.su">
<img src="https://img.shields.io/github/deployments/nizewn/chessu/Production?label=deployment&style=for-the-badge" alt="ches.su" />
<a href="https://chessust.vercel.app">
<img src="https://img.shields.io/github/deployments/nizewn/chessu/Production?label=deployment&style=for-the-badge" alt="chessust.vercel.app" />
</a>
<img src="https://img.shields.io/github/license/nizewn/chessu?color=blue&style=for-the-badge" alt="MIT Licensed" />
<img src="https://img.shields.io/github/last-commit/nizewn/chessu?style=for-the-badge" alt="Last commit" />
</p>

> 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
Expand All @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions client/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@chessu/client",
"name": "@chessust/client",
"version": "0.0.0",
"private": true,
"scripts": {
Expand All @@ -18,7 +18,7 @@
"socket.io-client": "^4.6.1"
},
"devDependencies": {
"@chessu/types": "*",
"@chessust/types": "*",
"@types/node": "18.15.13",
"@types/react": "18.0.38",
"@types/react-dom": "18.0.11",
Expand Down
6 changes: 3 additions & 3 deletions client/src/app/[code]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ export async function generateMetadata({ params }: { params: { code: string } })
return {
description: `Play or watch a game with ${game.host?.name}`,
openGraph: {
title: "chessu",
title: "chessust",
description: `Play or watch a game with ${game.host?.name}`,
url: `https://ches.su/${game.code}`,
siteName: "chessu",
url: `https://chessust.vercel.app/${game.code}`,
siteName: "chessust",
locale: "en_US",
type: "website"
},
Expand Down
8 changes: 4 additions & 4 deletions client/src/app/archive/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ArchivedGame from "@/components/archive/ArchivedGame";
import { fetchArchivedGame } from "@/lib/game";
import type { Game } from "@chessu/types";
import type { Game } from "@chessust/types";
import { notFound } from "next/navigation";

export async function generateMetadata({ params }: { params: { id: number } }) {
Expand All @@ -19,10 +19,10 @@ export async function generateMetadata({ params }: { params: { id: number } }) {
return {
description: `Archived game: ${game.white?.name} vs ${game.black?.name}`,
openGraph: {
title: "chessu",
title: "chessust",
description: `Archived game: ${game.white?.name} vs ${game.black?.name}`,
url: `https://ches.su/archive/${game.id}`,
siteName: "chessu",
url: `https://chessust.vercel.app/archive/${game.id}`,
siteName: "chessust",
locale: "en_US",
type: "website"
},
Expand Down
14 changes: 7 additions & 7 deletions client/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import AuthModal from "@/components/auth/AuthModal";
import ContextProvider from "@/context/ContextProvider";

export const metadata = {
title: "chessu",
title: "chessust",
description: "Play Chess online.",
openGraph: {
title: "chessu",
title: "chessust",
description: "Play Chess online.",
url: "https://ches.su",
siteName: "chessu",
url: "https://chessust.vercel.app",
siteName: "chessust",
locale: "en_US",
type: "website"
},
Expand All @@ -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 }) {
Expand All @@ -55,9 +55,9 @@ export default function RootLayout({ children }: { children: React.ReactNode })
id="load-theme"
dangerouslySetInnerHTML={{
__html: `if (localStorage.theme === "dark" || (!("theme" in localStorage) && window.matchMedia("(prefers-color-scheme: dark)").matches)) {
document.documentElement.setAttribute("data-theme", "chessuDark");
document.documentElement.setAttribute("data-theme", "chessustDark");
} else {
document.documentElement.setAttribute("data-theme", "chessuLight");
document.documentElement.setAttribute("data-theme", "chessustLight");
}`
}}
></script>
Expand Down
12 changes: 6 additions & 6 deletions client/src/app/user/[name]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ export async function generateMetadata({ params }: { params: { name: string } })
};
}
return {
title: `${data.name} | chessu`,
title: `${data.name} | chessust`,
description: `${data.name}'s profile`,
openGraph: {
title: `${data.name} | chessu`,
description: `${data.name}'s profile on chessu`,
url: `https://ches.su/user/${data.name}`,
siteName: "chessu",
title: `${data.name} | chessust`,
description: `${data.name}'s profile on chessust`,
url: `https://chessust.vercel.app/user/${data.name}`,
siteName: "chessust",
locale: "en_US",
type: "website"
},
Expand Down Expand Up @@ -64,7 +64,7 @@ export default async function Profile({ params }: { params: { name: string } })
<div>
<h2 className="mb-1 text-lg font-bold">Recent games</h2>
<ul className="bg-base-300 flex h-[60vh] flex-col gap-1 overflow-y-scroll rounded-lg">
{data.recentGames.map((game) => (
{data.recentGames.map((game:any) => (
<li
key={game.id}
className="border-base-100 flex flex-wrap items-center justify-between gap-8 border-b-2 p-3"
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ export default function Footer() {
<p>
&copy; 2023{" "}
<a
href="https://nize.ph"
href="https://myworldbox.github.io"
target="_blank"
rel="noopener noreferrer"
className="link-hover"
>
nize
myworldbox
</a>
</p>
</div>
<div className="items-center">
<a
href="https://github.com/nizewn/chessu"
href="https://github.com/myworldbox/chessust"
target="_blank"
rel="noopener noreferrer"
className="btn btn-ghost btn-sm gap-1 normal-case"
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function Header() {
>
<path d="M237.84 383.74c13.61 23.9 35.9 48.09 32.29 80.27H17.83c-3.62-32.18 21.67-56.37 35.28-80.27h184.73zM69.68 120.41h148.64c7.51 0 13.66 6.18 13.66 13.66s-6.18 13.66-13.66 13.66H69.68c-7.48 0-13.66-6.15-13.66-13.66s6.15-13.66 13.66-13.66zM120.55 0h48.95v56.29c0 3.87 3.18 7.04 7.04 7.04h24.32c3.86 0 6.32-3.23 7.04-7.04L218.59 0h43.56L244.7 85.8c-4.01 12.59-13.6 18.96-28.35 19.63H66.56c-12.93-.28-20.33-6.82-22.54-19.63L25.85 0h45.62l10.69 56.29c.71 3.81 3.17 7.04 7.03 7.04h24.32c3.86 0 7.04-3.17 7.04-7.04V0zM70.94 162.75c-1.5 60.45-7.75 119.42-22.87 158.47h191.86c-17.59-44.3-24.65-102.49-26.68-158.47H70.94zM46.28 336.2h195.44c8.94 0 16.26 7.36 16.26 16.26v.01c0 8.9-7.36 16.26-16.26 16.26H46.28c-8.9 0-16.26-7.32-16.26-16.26v-.01c0-8.94 7.32-16.26 16.26-16.26zM16.82 479.03h254.36c9.25 0 16.82 7.57 16.82 16.81v.01c0 9.25-7.57 16.81-16.82 16.81H16.82C7.57 512.66 0 505.1 0 495.85v-.01c0-9.24 7.57-16.81 16.82-16.81z" />
</svg>
chessu
chessust
</Link>
<div className="dropdown dropdown-right hover:dropdown-open">
<label tabIndex={0} className="badge badge-sm cursor-help">
Expand All @@ -32,9 +32,9 @@ export default function Header() {
>
<div className="card-body cursor-default">
<p className="text-left text-xs">
This project is a work in progress. You can view the roadmap{" "}
This project is a work in progress.{" "}
<a
href="https://github.com/users/nizewn/projects/2"
href="https://github.com/myworldbox"
target="_blank"
rel="noopener noreferrer"
className="link"
Expand Down
8 changes: 4 additions & 4 deletions client/src/components/ThemeToggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default function ThemeToggle() {
const [darkTheme, setDarkTheme] = useState(true);

useEffect(() => {
if (document.documentElement.getAttribute("data-theme") === "chessuDark") {
if (document.documentElement.getAttribute("data-theme") === "chessustDark") {
setDarkTheme(true);
} else {
setDarkTheme(false);
Expand All @@ -16,14 +16,14 @@ export default function ThemeToggle() {

function toggleTheme() {
if (
document.documentElement.getAttribute("data-theme") === "chessuDark" ||
document.documentElement.getAttribute("data-theme") === "chessustDark" ||
(!("theme" in localStorage) && window.matchMedia("(prefers-color-scheme: dark)").matches)
) {
document.documentElement.setAttribute("data-theme", "chessuLight");
document.documentElement.setAttribute("data-theme", "chessustLight");
localStorage.theme = "light";
setDarkTheme(false);
} else {
document.documentElement.setAttribute("data-theme", "chessuDark");
document.documentElement.setAttribute("data-theme", "chessustDark");
localStorage.theme = "dark";
setDarkTheme(true);
}
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/archive/ArchivedGame.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { Game } from "@chessu/types";
import { Game } from "@chessust/types";
import { Chessboard } from "react-chessboard";
import { useEffect, useReducer, useState, useRef } from "react";
import {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -266,7 +266,7 @@ export default function ArchivedGame({ game }: { game: Game }) {
onClick={copyLink}
>
<IconCopy size={16} />
ches.su/archive/{game.id}
chessust.vercel.app/archive/{game.id}
</label>
<div tabIndex={0} className="dropdown-content badge badge-neutral text-xs shadow">
copied to clipboard
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/game/GameAuthWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { useContext } from "react";
import { SessionContext } from "@/context/session";
import GamePage from "./GamePage";
import type { Game } from "@chessu/types";
import type { Game } from "@chessust/types";

export default function GameAuthWrapper({ initialLobby }: { initialLobby: Game }) {
const session = useContext(SessionContext);
Expand Down
Loading