Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nizewn/chessu
Online multiplayer chess built with Next.js, Express, & socket.io
https://github.com/nizewn/chessu
chess express full-stack fullstack game hacktoberfest javascript multiplayer next-js nextjs postgresql react reactjs socket socket-io socketio sql tailwind-css tailwindcss typescript
Last synced: about 2 months ago
JSON representation
Online multiplayer chess built with Next.js, Express, & socket.io
- Host: GitHub
- URL: https://github.com/nizewn/chessu
- Owner: dotnize
- License: mit
- Created: 2023-01-03T07:35:17.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-26T14:19:58.000Z (6 months ago)
- Last Synced: 2024-08-05T10:07:57.058Z (5 months ago)
- Topics: chess, express, full-stack, fullstack, game, hacktoberfest, javascript, multiplayer, next-js, nextjs, postgresql, react, reactjs, socket, socket-io, socketio, sql, tailwind-css, tailwindcss, typescript
- Language: TypeScript
- Homepage:
- Size: 873 KB
- Stars: 70
- Watchers: 3
- Forks: 28
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-pinoy-made - GitHub
README
Yet another Chess web app.
- play against other users in real-time
- spectate and chat in ongoing games with other users
- _optional_ user accounts for tracking stats and game history
- ~~play solo against Stockfish~~ (wip)
- mobile-friendly
- ... and more ([view roadmap](https://github.com/users/dotnize/projects/2))Built with Next.js 14, Tailwind CSS + daisyUI, react-chessboard, chess.js, Express.js, socket.io and PostgreSQL.
## Development
> Node.js 20 or newer is recommended.
This project is structured as a monorepo using **pnpm** workspaces, separated into three packages:
- `client` - Next.js application for the front-end, ~~deployed to ches.su via Vercel~~.
- `server` - Node/Express.js application for the back-end, ~~deployed to server.ches.su via Railway~~.
- `types` - Shared type definitions required by the client and server.### Getting started
1. Install [pnpm](https://pnpm.io/installation).
2. Install the necessary dependencies by running `pnpm install` in the root directory of the project.
3. In the `server` directory, create a `.env` file for your PostgreSQL database. You can try [ElephantSQL](https://www.elephantsql.com/) or [Aiven](https://aiven.io/postgresql) for a free hosted database.
```env
PGHOST=db.example.com
PGUSER=exampleuser
PGPASSWORD=examplepassword
PGDATABASE=chessu
```
4. Run the development servers with `pnpm dev`.
- To run the frontend and backend servers separately, use `pnpm dev:client` and `pnpm dev:server`, respectively.
5. You can now access the frontend at http://localhost:3000 and the backend at http://localhost:3001.## Running chessu with Docker
To build the project with Docker, you can use the provided `Dockerfile`.
```sh
docker build -t chessu .
```This command will build the Docker image with the name `chessu`. You can then run the image with the following command:
```sh
docker run -p 3000:3000 -p 3001:3001 chessu
```Once built, to start the project with POSTGRES, you can use the provided `docker-compose.yml` file.
```sh
docker-compose up
```
Please make sure to modify the values in the `server/.env` file to match the values in the `docker-compose.yml` file or vice versa.The entrypoint for the Docker image is set to run pnpm.
The Dockerfile's `CMD` instruction is set to run the project in production mode.
If you want to run the project in development mode, you can override the `CMD` instruction by running the following command:
```sh
docker run -p 3000:3000 -p 3001:3001 chessu dev # runs both client and server in development mode
docker run -p 3000:3000 -p 3001:3001 chessu dev:client # runs only the client in development mode
docker run -p 3000:3000 -p 3001:3001 chessu dev:server # runs only the server in development mode
```
## ContributingPlease read our [Contributing Guidelines](./CONTRIBUTING.md) before starting a pull request.
## License
[MIT](./LICENSE)