Skip to content

Commit a15ef16

Browse files
dveltonCopilot
andcommitted
Integrate chess.js, deploy to GitHub Pages, prune deps
Chess engine: - Replace custom move validation with chess.js for full rule support (check, checkmate, stalemate, en passant, castling, promotion, draws) - Remove duplicated replay logic in App.tsx — now uses getStateAtMove() - Move history now displays standard algebraic notation (Nf3, exd5) Sharing: - Add URL-based game sharing (moves encoded in query params) - Add 'Copy Share Link' button alongside existing ASCII copy/paste - Load game state from URL on page load Platform migration: - Remove GitHub Spark dependency — app is now a standalone Vite/React app - Replace useKV with localStorage for persistence - Remove Spark vite plugins and theme system - Add GitHub Actions workflow for GitHub Pages deployment - Set vite base path to /dm-chess/ for Pages hosting Dependency cleanup: - Remove 40+ unused packages (three.js, d3, recharts, framer-motion, octokit, react-hook-form, zod, 20+ radix components, etc.) - Remove 38 unused UI components from src/components/ui/ - Remove unused hooks (use-mobile.ts) - Net reduction: ~11,200 lines deleted, ~2,300 added Housekeeping: - Rename package from spark-template to dm-chess - Rewrite README without emoji formatting - Fix phosphor icon imports - Remove Spark artifacts (.spark-initial-sha, theme.json) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 41c0dbb commit a15ef16

57 files changed

Lines changed: 2331 additions & 11200 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/deploy.yml‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: 20
25+
cache: npm
26+
- run: npm ci
27+
- run: npm run build
28+
- uses: actions/upload-pages-artifact@v3
29+
with:
30+
path: dist
31+
32+
deploy:
33+
needs: build
34+
runs-on: ubuntu-latest
35+
environment:
36+
name: github-pages
37+
url: ${{ steps.deployment.outputs.page_url }}
38+
steps:
39+
- id: deployment
40+
uses: actions/deploy-pages@v4

‎.spark-initial-sha‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎README.md‎

Lines changed: 40 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,62 @@
1-
# ♟️ DM-chess
1+
# DM-Chess
22

3-
> Play chess with a colleague—right from your DMs. No apps. No logins. Just pure ASCII chess.
3+
Play chess with a colleague right from your DMs. No apps, no logins — just copy, paste, and play.
44

5-
<p align="center">
6-
<img src="screenshot1.png" alt="DM-chess Screenshot 1" width="600">
7-
</p>
5+
![DM-Chess Screenshot](screenshot1.png)
86

9-
---
7+
## What is this?
108

11-
## 🧩 What Is DM-chess?
9+
DM-Chess is a lightweight chess game you play by sharing text over Slack, Teams, or any messaging app. Make your move in the browser, copy the game state, paste it to your opponent. They paste it back into their browser, make their move, and send it back.
1210

13-
**DM-chess** is a lightweight, ASCII-based chess game you can play directly via **Slack DMs** or **text messages**—no installation, no logins, no integrations.
11+
There's nothing to install and no accounts to create.
1412

15-
Just type and play.
13+
**Play it here: [dvelton.github.io/dm-chess](https://dvelton.github.io/dm-chess)**
1614

17-
---
15+
## How it works
1816

19-
## 🕹️ How It Works
17+
1. Open the app and make your move by clicking a piece and then its destination.
18+
2. Go to the **Share** tab and either:
19+
- **Copy the ASCII text** and paste it in Slack/Teams, or
20+
- **Copy a share link** your opponent can open directly.
21+
3. Your opponent loads the game (paste text + "Load Game", or just open the link), makes their move, and sends it back.
22+
4. Repeat until checkmate.
2023

21-
- ♟️ Try it [here](https://gh.io/dm-chess)
22-
- 🗺️ The game board is sent as clean ASCII art
23-
- ➡️ Make moves in algebraic notation (e.g. `e2 e4`)
24-
- ✅ The board updates automatically after each move
24+
The game auto-saves in your browser between sessions.
2525

26-
---
26+
## Features
2727

28-
## 📸 Screenshots
28+
- Full chess rules via [chess.js](https://github.com/jhlywa/chess.js) — check, checkmate, stalemate, castling, en passant, pawn promotion, draw detection
29+
- ASCII board output for sharing in any text channel
30+
- URL-based sharing (game state encoded in query params)
31+
- Move history with step-through replay
32+
- Captured piece tracking
33+
- Persistent local storage — close the tab and come back later
2934

30-
<p align="center">
31-
<img src="screenshot1.png" alt="Game Start" width="600"><br>
32-
<em>Game Start: Board appears in your DM</em>
33-
</p>
35+
## Screenshots
3436

35-
<p align="center">
36-
<img src="screenshot2.png" alt="Move Response" width="600"><br>
37-
<em>Move submitted and board updated</em>
38-
</p>
37+
| Start | Mid-game | Move history |
38+
|-------|----------|--------------|
39+
| ![Game Start](screenshot1.png) | ![Move Response](screenshot2.png) | ![Ongoing Match](screenshot3.png) |
3940

40-
<p align="center">
41-
<img src="screenshot3.png" alt="Ongoing Match" width="600"><br>
42-
<em>Simple, ongoing gameplay in plain text</em>
43-
</p>
41+
## Development
4442

45-
</details>
43+
```bash
44+
npm install
45+
npm run dev
46+
```
4647

47-
---
48+
Build for production:
4849

49-
## ✨ Features
50+
```bash
51+
npm run build
52+
```
5053

51-
| Feature | Description |
52-
|--------------------------|-------------|
53-
| 📦 **Zero Setup** | No accounts, no auth, no browser needed |
54-
| ✉️ **Slack DMs & SMS** | Play where you already communicate |
55-
| 🔡 **Text-Only Board** | Clean, readable ASCII chessboards |
56-
| 🎯 **Command-Based Play**| Use simple commands like `e2 e4` to make moves |
57-
| 🛡️ **Secure by Design** | No external integrations or data sharing |
54+
Deploys automatically to GitHub Pages on push to `main`.
5855

59-
---
56+
## Tech stack
6057

61-
## ✅ Why You'll Love It
58+
React, TypeScript, Vite, Tailwind CSS, chess.js, Radix UI primitives.
6259

63-
- [x] No distractions, just chess
64-
- [x] Great for casual games with colleagues
65-
- [x] Fully text-based—works even on feature phones
66-
- [ ] No Elo rating shame (yet)
67-
68-
---
69-
70-
## 🚀 Getting Started
71-
72-
There’s nothing to install.
73-
74-
- 🕊️ Start a match and send your first move!
75-
76-
---
77-
78-
> _Chess isn't about fancy UIs. It’s about the moves you make._
60+
## License
7961

62+
[MIT](LICENSE)

‎index.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<head>
55
<meta charset="UTF-8" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>Slack Chess</title>
7+
<title>DM-Chess</title>
88
<link rel="preconnect" href="https://fonts.googleapis.com">
99
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
1010
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&family=Roboto+Mono&display=swap" rel="stylesheet">

0 commit comments

Comments
 (0)