RealChess is a full-stack real-time chess application that enables users to play chess online. The project is divided into two main parts:
- Backend: Located in backend1, it handles game logic using chess.js and real-time communication using WebSockets provided by the ws library.
- Frontend: Located in frontend, it is a React application built with Vite and styled with Tailwind CSS. It provides a responsive user interface with components like a chess board, play options, and landing screen.
- Open a terminal in the
backend1directory:cd backend1 npm install - Build the TypeScript files:
npx tsc
- Start the backend server (ensure you have Node.js installed):
The WebSocket server will run on port
node dist/index.js
8080as defined in src/index.ts.
- Open a terminal in the
frontenddirectory:cd frontend npm install - Start the development server:
npm run dev
- Open index.html in your browser or follow the URL provided by Vite.
The frontend uses React with Vite, Tailwind CSS (configured in tailwind.config.js) and routing in App.tsx.
- Frontend: React, TypeScript, Vite, Tailwind CSS, Framer Motion, React Icons
- Backend: Node.js, TypeScript, WebSockets (
ws), chess.js
npm run dev- Starts the development server.npm run build- Builds the frontend for production.npm run lint- Lints the source code.
- You can run custom scripts as needed. Currently, the backend package uses
nodefor running the built code.
Feel free to contribute by opening issues or submitting pull requests. If you have any questions, consult the documentation for Vite, React, or chess.js.
This project is open source. See the license file for details.