diff --git a/.eslintrc b/.eslintrc
index 4c444ea..c5d43a6 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -1,3 +1,3 @@
{
- "extends": ["@remix-run/eslint-config", "@remix-run/eslint-config/node", "prettier"]
+ "extends": ["next", "prettier"]
}
diff --git a/README.md b/README.md
index e40da7c..8b9619c 100644
--- a/README.md
+++ b/README.md
@@ -4,8 +4,8 @@
Online 2-player chess. Live demo at [ches.su](https://ches.su)
-- React (Remix)
-- Tailwind CSS
+- React (Next.js)
+- Tailwind CSS + daisyUI
- [react-chessboard](https://github.com/Clariity/react-chessboard)
- [chess.js](https://github.com/jhlywa/chess.js)
- Express.js
diff --git a/client/.gitignore b/client/.gitignore
index b32d337..c87c9b3 100644
--- a/client/.gitignore
+++ b/client/.gitignore
@@ -1,9 +1,36 @@
-.cache
-.vercel
-.output
+# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
-/build/
-/public/build
-/api/index.js
-/api/index.js.map
-/app/styles/app.css
\ No newline at end of file
+# dependencies
+/node_modules
+/.pnp
+.pnp.js
+
+# testing
+/coverage
+
+# next.js
+/.next/
+/out/
+
+# production
+/build
+
+# misc
+.DS_Store
+*.pem
+
+# debug
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+.pnpm-debug.log*
+
+# local env files
+.env*.local
+
+# vercel
+.vercel
+
+# typescript
+*.tsbuildinfo
+next-env.d.ts
diff --git a/client/README.md b/client/README.md
deleted file mode 100644
index 944936b..0000000
--- a/client/README.md
+++ /dev/null
@@ -1,34 +0,0 @@
-# Welcome to Remix!
-
-- [Remix Docs](https://remix.run/docs)
-
-## Deployment
-
-After having run the `create-remix` command and selected "Vercel" as a deployment target, you only need to [import your Git repository](https://vercel.com/new) into Vercel, and it will be deployed.
-
-If you'd like to avoid using a Git repository, you can also deploy the directory by running [Vercel CLI](https://vercel.com/cli):
-
-```sh
-npm i -g vercel
-vercel
-```
-
-It is generally recommended to use a Git repository, because future commits will then automatically be deployed by Vercel, through its [Git Integration](https://vercel.com/docs/concepts/git).
-
-## Development
-
-To run your Remix app locally, make sure your project's local dependencies are installed:
-
-```sh
-npm install
-```
-
-Afterwards, start the Remix development server like so:
-
-```sh
-npm run dev
-```
-
-Open up [http://localhost:3000](http://localhost:3000) and you should be ready to go!
-
-If you're used to using the `vercel dev` command provided by [Vercel CLI](https://vercel.com/cli) instead, you can also use that, but it's not needed.
diff --git a/client/app/components/Footer.tsx b/client/app/components/Footer.tsx
deleted file mode 100644
index 117cf79..0000000
--- a/client/app/components/Footer.tsx
+++ /dev/null
@@ -1,4 +0,0 @@
-const Footer = () => {
- return
Footer
;
-};
-export default Footer;
diff --git a/client/app/components/Header.tsx b/client/app/components/Header.tsx
deleted file mode 100644
index 342e4c2..0000000
--- a/client/app/components/Header.tsx
+++ /dev/null
@@ -1,44 +0,0 @@
-import { Link } from "@remix-run/react";
-
-const Header = () => {
- return (
-
- chessu
-
-
-
-
-
-
-
-
-
-
- Play
-
-
-
-
- Watch
-
-
-
-
-
- themebtn
- Sign in
-
-
-
- );
-};
-export default Header;
diff --git a/client/app/components/game/Board.tsx b/client/app/components/game/Board.tsx
deleted file mode 100644
index ed50e21..0000000
--- a/client/app/components/game/Board.tsx
+++ /dev/null
@@ -1,10 +0,0 @@
-import { Chessboard } from "react-chessboard";
-
-const Board = () => {
- return (
-
-
-
- );
-};
-export default Board;
diff --git a/client/app/entry.client.tsx b/client/app/entry.client.tsx
deleted file mode 100644
index 8338545..0000000
--- a/client/app/entry.client.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-import { RemixBrowser } from "@remix-run/react";
-import { startTransition, StrictMode } from "react";
-import { hydrateRoot } from "react-dom/client";
-
-function hydrate() {
- startTransition(() => {
- hydrateRoot(
- document,
-
-
-
- );
- });
-}
-
-if (typeof requestIdleCallback === "function") {
- requestIdleCallback(hydrate);
-} else {
- // Safari doesn't support requestIdleCallback
- // https://caniuse.com/requestidlecallback
- setTimeout(hydrate, 1);
-}
diff --git a/client/app/entry.server.tsx b/client/app/entry.server.tsx
deleted file mode 100644
index fb8ea87..0000000
--- a/client/app/entry.server.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import type { EntryContext } from "@remix-run/node";
-import { RemixServer } from "@remix-run/react";
-import { renderToString } from "react-dom/server";
-
-export default function handleRequest(
- request: Request,
- responseStatusCode: number,
- responseHeaders: Headers,
- remixContext: EntryContext
-) {
- const markup = renderToString(
-
- );
-
- responseHeaders.set("Content-Type", "text/html");
-
- return new Response("" + markup, {
- headers: responseHeaders,
- status: responseStatusCode,
- });
-}
diff --git a/client/app/root.tsx b/client/app/root.tsx
deleted file mode 100644
index 725bb2a..0000000
--- a/client/app/root.tsx
+++ /dev/null
@@ -1,34 +0,0 @@
-import type { MetaFunction } from "@remix-run/node";
-import { Links, LiveReload, Meta, Outlet, Scripts, ScrollRestoration } from "@remix-run/react";
-
-import Header from "./components/Header";
-import Footer from "./components/Footer";
-
-// Tailwind CSS
-import styles from "./styles/app.css";
-export const links = () => [{ rel: "stylesheet", href: styles }];
-
-export const meta: MetaFunction = () => ({
- charset: "utf-8",
- title: "Chessu",
- viewport: "width=device-width,initial-scale=1"
-});
-
-export default function App() {
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
-}
diff --git a/client/app/routes/index.tsx b/client/app/routes/index.tsx
deleted file mode 100644
index b74e8a7..0000000
--- a/client/app/routes/index.tsx
+++ /dev/null
@@ -1,3 +0,0 @@
-export default function Index() {
- return Index
;
-}
diff --git a/client/next.config.js b/client/next.config.js
new file mode 100644
index 0000000..eda88d1
--- /dev/null
+++ b/client/next.config.js
@@ -0,0 +1,6 @@
+/** @type {import('next').NextConfig} */
+const nextConfig = {
+ reactStrictMode: true
+};
+
+module.exports = nextConfig;
diff --git a/client/package.json b/client/package.json
index 2f04bb9..fa9af48 100644
--- a/client/package.json
+++ b/client/package.json
@@ -1,33 +1,31 @@
{
"name": "@chessu/client",
+ "version": "0.0.0",
"private": true,
- "sideEffects": false,
"scripts": {
- "build": "npm run build:css && remix build",
- "build:css": "tailwindcss -m -i ./styles/app.css -o app/styles/app.css",
- "dev": "concurrently \"npm run dev:css\" \"remix dev\"",
- "dev:css": "tailwindcss -w -i ./styles/app.css -o app/styles/app.css",
- "typecheck": "tsc"
+ "dev": "next dev",
+ "build": "next build",
+ "start": "next start",
+ "lint": "next lint"
},
"dependencies": {
- "@remix-run/node": "^1.12.0",
- "@remix-run/react": "^1.12.0",
- "@remix-run/vercel": "^1.12.0",
- "@vercel/node": "^2.9.0",
+ "@next/font": "13.1.6",
"chess.js": "^1.0.0-beta.3",
- "react": "^18.2.0",
+ "next": "13.1.6",
+ "react": "18.2.0",
"react-chessboard": "^2.0.8",
- "react-dom": "^18.2.0",
- "remix-utils": "^6.0.0",
- "socket.io-client": "^4.5.4"
+ "react-dom": "18.2.0",
+ "socket.io-client": "^4.6.0"
},
"devDependencies": {
"@chessu/types": "*",
- "@remix-run/dev": "^1.12.0",
- "@remix-run/serve": "^1.12.0",
- "@types/react": "^18.0.27",
- "@types/react-dom": "^18.0.10",
- "tailwindcss": "^3.2.4",
- "typescript": "^4.9.5"
+ "@types/node": "18.13.0",
+ "@types/react": "18.0.28",
+ "@types/react-dom": "18.0.10",
+ "autoprefixer": "^10.4.13",
+ "daisyui": "^2.50.0",
+ "postcss": "^8.4.21",
+ "tailwindcss": "^3.2.6",
+ "typescript": "4.9.5"
}
}
diff --git a/client/postcss.config.js b/client/postcss.config.js
new file mode 100644
index 0000000..fe66dd6
--- /dev/null
+++ b/client/postcss.config.js
@@ -0,0 +1,6 @@
+module.exports = {
+ plugins: {
+ tailwindcss: {},
+ autoprefixer: {}
+ }
+};
diff --git a/client/public/favicon.ico b/client/public/favicon.ico
deleted file mode 100644
index 8830cf6..0000000
Binary files a/client/public/favicon.ico and /dev/null differ
diff --git a/client/remix.config.js b/client/remix.config.js
deleted file mode 100644
index 6cc3164..0000000
--- a/client/remix.config.js
+++ /dev/null
@@ -1,13 +0,0 @@
-/** @type {import('@remix-run/dev').AppConfig} */
-module.exports = {
- serverBuildTarget: "vercel",
- // When running locally in development mode, we use the built in remix
- // server. This does not understand the vercel lambda module format,
- // so we default back to the standard build output.
- server: process.env.NODE_ENV === "development" ? undefined : "./server.js",
- ignoredRouteFiles: ["**/.*"]
- // appDirectory: "app",
- // assetsBuildDirectory: "public/build",
- // serverBuildPath: "api/index.js",
- // publicPath: "/build/",
-};
diff --git a/client/remix.env.d.ts b/client/remix.env.d.ts
deleted file mode 100644
index dcf8c45..0000000
--- a/client/remix.env.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-///
-///
diff --git a/client/server.js b/client/server.js
deleted file mode 100644
index 4e2a0e0..0000000
--- a/client/server.js
+++ /dev/null
@@ -1,4 +0,0 @@
-import { createRequestHandler } from "@remix-run/vercel";
-import * as build from "@remix-run/dev/server-build";
-
-export default createRequestHandler({ build, mode: process.env.NODE_ENV });
diff --git a/client/src/pages/_app.tsx b/client/src/pages/_app.tsx
new file mode 100644
index 0000000..a7a790f
--- /dev/null
+++ b/client/src/pages/_app.tsx
@@ -0,0 +1,6 @@
+import "@/styles/globals.css";
+import type { AppProps } from "next/app";
+
+export default function App({ Component, pageProps }: AppProps) {
+ return ;
+}
diff --git a/client/src/pages/_document.tsx b/client/src/pages/_document.tsx
new file mode 100644
index 0000000..b2fff8b
--- /dev/null
+++ b/client/src/pages/_document.tsx
@@ -0,0 +1,13 @@
+import { Html, Head, Main, NextScript } from "next/document";
+
+export default function Document() {
+ return (
+
+
+
+
+
+
+ );
+}
diff --git a/client/src/pages/api/hello.ts b/client/src/pages/api/hello.ts
new file mode 100644
index 0000000..c50d809
--- /dev/null
+++ b/client/src/pages/api/hello.ts
@@ -0,0 +1,10 @@
+// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
+import type { NextApiRequest, NextApiResponse } from "next";
+
+type Data = {
+ name: string;
+};
+
+export default function handler(req: NextApiRequest, res: NextApiResponse) {
+ res.status(200).json({ name: "John Doe" });
+}
diff --git a/client/src/pages/index.tsx b/client/src/pages/index.tsx
new file mode 100644
index 0000000..83d39dc
--- /dev/null
+++ b/client/src/pages/index.tsx
@@ -0,0 +1,5 @@
+const index = () => {
+ return index
;
+};
+
+export default index;
diff --git a/client/styles/app.css b/client/src/styles/globals.css
similarity index 100%
rename from client/styles/app.css
rename to client/src/styles/globals.css
diff --git a/client/tailwind.config.js b/client/tailwind.config.js
index 81ad874..a689d9c 100644
--- a/client/tailwind.config.js
+++ b/client/tailwind.config.js
@@ -1,8 +1,12 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
- content: ["./app/**/*.{js,ts,jsx,tsx}"],
+ content: ["./src/**/*.{js,ts,jsx,tsx}"],
theme: {
extend: {}
},
- plugins: []
+ plugins: [require("daisyui")],
+ daisyui: {
+ themes: ["cmyk", "night"],
+ darkTheme: "night"
+ }
};
diff --git a/client/tsconfig.json b/client/tsconfig.json
index 20f8a38..ee95d38 100644
--- a/client/tsconfig.json
+++ b/client/tsconfig.json
@@ -1,22 +1,24 @@
{
- "include": ["remix.env.d.ts", "**/*.ts", "**/*.tsx"],
- "compilerOptions": {
- "lib": ["DOM", "DOM.Iterable", "ES2019"],
- "isolatedModules": true,
- "esModuleInterop": true,
- "jsx": "react-jsx",
- "moduleResolution": "node",
- "resolveJsonModule": true,
- "target": "ES2019",
- "strict": true,
- "allowJs": true,
- "forceConsistentCasingInFileNames": true,
- "baseUrl": ".",
- "paths": {
- "~/*": ["./app/*"]
+ "compilerOptions": {
+ "target": "es5",
+ "lib": ["dom", "dom.iterable", "esnext"],
+ "allowJs": true,
+ "skipLibCheck": true,
+ "strict": true,
+ "forceConsistentCasingInFileNames": true,
+ "noEmit": true,
+ "esModuleInterop": true,
+ "module": "esnext",
+ "moduleResolution": "node",
+ "resolveJsonModule": true,
+ "isolatedModules": true,
+ "jsx": "preserve",
+ "incremental": true,
+ "baseUrl": ".",
+ "paths": {
+ "@/*": ["./src/*"]
+ }
},
-
- // Remix takes care of building everything in `remix build`.
- "noEmit": true
- }
+ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
+ "exclude": ["node_modules"]
}
diff --git a/package.json b/package.json
index b646c8c..b729fcb 100644
--- a/package.json
+++ b/package.json
@@ -15,11 +15,11 @@
"format": "prettier --write ."
},
"devDependencies": {
- "@remix-run/eslint-config": "^1.12.0",
"concurrently": "^7.6.0",
- "eslint": "^8.33.0",
+ "eslint": "^8.34.0",
+ "eslint-config-next": "13.1.6",
"eslint-config-prettier": "^8.6.0",
- "prettier": "^2.8.3",
+ "prettier": "^2.8.4",
"prettier-plugin-tailwindcss": "^0.2.2"
},
"engines": {