Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
85796bb
refactor: migrate chess client to React components and hooks
F-Hejazi Dec 5, 2025
61a87c6
chore: delete chess client
F-Hejazi Dec 5, 2025
4450179
refactor: migrate Puzzles and Student components from iframe to React
F-Hejazi Dec 5, 2025
911c30f
refactor: reorganize deployment structure and update configs
F-Hejazi Dec 9, 2025
6b62bbb
docs: refine README for clarity and update environment instructions
F-Hejazi Dec 9, 2025
4566003
fix: correct environment file paths and add environment.js to version…
F-Hejazi Dec 9, 2025
7ccb8b4
fix: correct icons file paths
F-Hejazi Dec 9, 2025
e6b6ab6
test: add minimal placeholder tests for CI stability
F-Hejazi Dec 9, 2025
e24145f
fix: adjust file paths for CI tests
F-Hejazi Dec 9, 2025
41ec924
fix: refactor components to use socket hook and add stub tests
F-Hejazi Dec 11, 2025
17817f0
fix(tests): refine socket hook mocks and module paths
F-Hejazi Dec 11, 2025
06939d6
test: fix mock configuration for Puzzles and useChessSocket tests
F-Hejazi Dec 11, 2025
b3ee069
test: fix mock implementations for Puzzles and useChessSocket tests
F-Hejazi Dec 11, 2025
16a5b46
fix(tests): refine socket hook and component mock stability
F-Hejazi Dec 11, 2025
7928197
fix(tests): correct the mocking of socket.io-client and react-cookie
F-Hejazi Dec 11, 2025
3c4bea5
test: fix Jest mock configuration for Puzzles and useChessSocket tests
F-Hejazi Dec 11, 2025
a10cd63
test: fix Jest module resolution for react-cookie
F-Hejazi Dec 11, 2025
8923228
test: map react-cookie to CJS entry
F-Hejazi Dec 11, 2025
31a4e44
test: map socket.io-client to CJS build and add proper Jest mock
F-Hejazi Dec 11, 2025
9d8003a
chore(tests): add minimal stub tests for Puzzles and useChessSocket
F-Hejazi Dec 11, 2025
d541c27
fix: correct import path for environment file
F-Hejazi Dec 12, 2025
68cf946
fix: add mode-based move control for lessons and puzzles
F-Hejazi Dec 13, 2025
ade69d9
fix: correct environment path
F-Hejazi Dec 16, 2025
2b882d4
Merge branch 'main' into chess-client-migration
F-Hejazi Dec 17, 2025
38522c1
fix: correct chessboard display
F-Hejazi Dec 17, 2025
1d3335f
fix: add computer move execution
F-Hejazi Dec 18, 2025
fc05264
fix: remove double-validation from chess socket
F-Hejazi Dec 18, 2025
fce8fa2
fix: resolve CSS conflict preventing grey dots from rendering
F-Hejazi Dec 18, 2025
743885c
fix: chessboardjsx black piece rendering bug
F-Hejazi Dec 22, 2025
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
10 changes: 0 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,6 @@ jobs:
run: npm run build --if-present
working-directory: ./middlewareNode

# chessClient
- name: Install dependencies (chessClient)
run: npm ci
working-directory: ./chessClient

- name: Lint chessClient
run: npm run lint
working-directory: ./chessClient

# chessServer
- name: Install dependencies (chessServer)
run: npm ci
Expand Down Expand Up @@ -83,7 +74,6 @@ jobs:
},
urls: {
middlewareURL: '${{ secrets.MIDDLEWARE_URL }}',
chessClientURL: '${{ secrets.CHESS_CLIENT_URL }}',
stockFishURL: '${{ secrets.STOCKFISH_URL }}',
chessServer: '${{ secrets.CHESS_SERVER }}',
},
Expand Down
19 changes: 0 additions & 19 deletions .travis.yml

This file was deleted.

224 changes: 55 additions & 169 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,104 +1,67 @@
# Welcome to the Y STEM and Chess Project

This is an educational platform that combines chess instruction with STEM learning, aimed at supporting socially and economically underserved students. The platform helps students who benefit from alternative learning approaches by providing chess tutoring alongside mathematics, computer science, and mentoring.

---
This is an educational platform combining chess instruction with STEM learning, aimed at supporting socially and economically underserved students. It helps learners who benefit from alternative approaches by providing chess tutoring alongside mathematics, computer science, and mentoring. The platform is built with React and Node.js and integrates the Stockfish chess engine for gameplay.

## Development Environment Setup

To run the platform, you’ll need **Node.js v18**, **nodemon**, and **Apache** installed.

### NodeJS
To run the platform, you’ll need **Node.js v18** installed. **Nodemon** is optional and can be used to automatically restart servers when code changes, which is convenient during development.

This project requires **Node.js v18.20.8**.

We recommend using a version manager so everyone runs the same Node.js version consistently.
### Node.js

---

### Option 1: Using [Volta](https://volta.sh) (recommended)
This project requires **Node.js v18.20.8**. Using a version manager ensures consistent Node versions across contributors.

#### Option 1: Using [Volta](https://volta.sh) (recommended)

Volta automatically uses the Node version pinned in this project’s `package.json`.

**Install Volta:**

- **Linux / macOS:**
```bash
curl https://get.volta.sh | bash
source ~/.bashrc # or ~/.zshrc
```
- **Windows:**
Download and run the installer from [volta.sh](https://volta.sh)

Now when you cd into this project, Volta will automatically install and use **Node.js v18.20.8**.

### Option 2: Using [nvm](https://github.com/nvm-sh/nvm)

If you prefer nvm:

- **Linux / macOS:**
```bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.nvm/nvm.sh
```
Then:
```bash
nvm install 18.20.8
nvm use 18.20.8
```
(Optional) Set it as default:
```bash
nvm alias default 18.20.8
```
- **Windows:**
Use [nvm-windows](https://github.com/coreybutler/nvm-windows):

Download and run the installer from the [releases page](https://github.com/coreybutler/nvm-windows/releases).
Then install and use Node:
```powershell
nvm install 18.20.8
nvm use 18.20.8
```

### Nodemon

Nodemon automatically restarts your server whenever code changes are detected.

**Linux/macOS:**
* **Linux / macOS**

```bash
sudo npm install -g nodemon
curl https://get.volta.sh | bash
source ~/.bashrc # or ~/.zshrc
```

**Windows:**

```bash
npm install -g nodemon
```
* **Windows**
Download and run the installer from [volta.sh](https://volta.sh).

---
Volta will automatically install and use **Node.js v18.20.8** when you cd into the project.

### Apache
#### Option 2: Using [nvm](https://github.com/nvm-sh/nvm)

Apache is used as a web server to serve the chess client interface.
If you prefer nvm:

**Linux:**
* **Linux / macOS**

```bash
sudo apt update && sudo apt install apache2
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.nvm/nvm.sh
nvm install 18.20.8
nvm use 18.20.8
nvm alias default 18.20.8 # optional
```

**macOS:**
* **Windows**
Use [nvm-windows](https://github.com/coreybutler/nvm-windows/releases).

```bash
brew install httpd
```powershell
nvm install 18.20.8
nvm use 18.20.8
```

**Windows:**
[Apache Installation Guide](https://httpd.apache.org/docs/2.4/platform/windows.html)
### Nodemon (Optional)

---

Nodemon can be installed globally to automatically restart servers when code changes:

```bash
npm install -g nodemon
```

## Getting Started

### 1. Clone the Repository
Expand All @@ -110,116 +73,65 @@ cd react

### 2. Environment Setup

Running the following script creates all environment files needed for the platform services:
A `default.json` file containing environment variables will be provided to contributors and should be placed in `middlewareNode/config`.

**Linux/macOS or Windows (Git Bash):**

```bash
sh create_dev_envs.sh
```

---
## Running Each Service

## Setting Up Each Service
Each service runs independently in its own terminal window. Start the Middleware API first, then the other services in any order.

Each service runs independently and requires its own terminal window. Start the Middleware API first, then the other services in any order.

#### Middleware API (Backend)
### Middleware API (Backend)

Handles user authentication, database operations, and coordinates other services.

```bash
cd middlewareNode
npm install # Install backend dependencies
npm start # Start the API server (runs from src/server.js)
npm install
npm start
```

The server typically runs on port 8000. You should see "MongoDB Connected..." when it starts successfully.

> **Note**: After modularization, the entry point is now `src/server.js`

**If you intend to test the mentor and student login pages, you may use the following usernames and passwords respectively:**

mentor 123123123
The server typically runs on port 8000. You should see `"MongoDB Connected..."` when it starts successfully.

student 123123123
The following credentials can be used for testing mentor and student accounts:

---
* **Mentor:** mentor / 123123123
* **Student:** student / 123123123

#### Main React Application (Frontend)
### Main React Application (Frontend)

Primary interface for students and mentors:
Primary interface for students and mentors.

```bash
cd react-ystemandchess
npm install
npm start
```

The frontend runs on `http://localhost:3000` (or the next available port if 3000 is occupied).

---
Once started, the React application is accessible at `http://localhost:3000` (or the next available port if 3000 is occupied).

#### Chess Game Server
### Chess Game Server

Manages chess game logic, validates moves, and handles real-time gameplay:
Manages chess game logic, validates moves, and handles real-time gameplay.

```bash
cd chessServer
npm install
npm start # Starts from src/index.js
npm start
```

Defaults to port 3000 (or the next available port if taken).

> **Note**: After modularization, the entry point is now `src/index.js`
The server runs on port 3001.

---

#### Chess Engine Server
### Chess Engine Server

Integrates Stockfish for AI opponents and move analysis:
Integrates Stockfish for AI opponents and move analysis.

```bash
cd stockfishServer
npm install
npm start # Starts from src/index.js
```

This service usually runs on port 8080.

> **Note**: After modularization, the entry point is now `src/index.js`

---

#### Chess Client (Testing Interface)

```bash
cd chessClient
npm install
```

Run the http server on port 80 using: `npx http-server -p 80` to ensure that the chess board frame loads during any session.
You can use the **Live Server extension in VS Code** to open the HTML files for local testing of the chess board:

* **Board only:** Right-click `index.html` → "Open with Live Server"
* **Archived files:** `archive/parent.html` and `archive/both.html` contain legacy testing interfaces

> **Note**: Old HTML test files have been moved to `archive/` directory after modularization

---

#### React Chess Component (Optional)

Modern React-based chess component for development/testing:

```bash
cd chess-client-react-refactor
npm install
npm start
npm start
```

Open `src/app.js` to ensure debug mode is set to `true`.
The server runs on port 8080.

---

Expand All @@ -228,7 +140,7 @@ Open `src/app.js` to ensure debug mode is set to `true`.
1. Create a new branch with a descriptive name:

```bash
git checkout -b my-branch-name
git checkout -b branch-name
```

2. Test thoroughly to ensure all services work together.
Expand All @@ -237,30 +149,4 @@ git checkout -b my-branch-name

---

## Project Structure

This project has been recently modularized for better organization and maintainability. Key structural changes:

- **All Node.js services** now have their code in a `src/` directory
- **React app** uses a feature-based architecture with:
- `components/` - Reusable UI components
- `features/` - Feature modules (auth, lessons, student, mentor, etc.)
- `core/` - Core infrastructure (services, types, utils)
- `assets/` - Static assets and images
- **Configuration files** are organized in the `config/` directory
- **Kubernetes deployments** are in the `yaml/` directory

---

## Docker Deployment

To run all services using Docker:

```bash
cd config
docker-compose up
```

---

You're all set! Happy coding and thank you for contributing to educational equity! 🎯♟️
You're all set! Happy coding, and thank you for contributing to educational equity! 🎯♟️
1 change: 1 addition & 0 deletions angular-ystemandchess-old/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Track the changes that were made
changes.md
dist
environment.*
Empty file removed chessClient/.gitignore
Empty file.
5 changes: 0 additions & 5 deletions chessClient/Dockerfile

This file was deleted.

1 change: 0 additions & 1 deletion chessClient/README.md

This file was deleted.

Loading