Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
44 changes: 44 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
version: 2
updates:
# Enable version updates for Gradle (backend)
- package-ecosystem: "gradle"
directory: "/backend"
schedule:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 5
labels:
- "dependencies"
- "backend"
commit-message:
prefix: "chore(deps)"
reviewers:
- "mgierschdev"

# Enable version updates for npm (frontend)
- package-ecosystem: "npm"
directory: "/frontend"
schedule:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 5
labels:
- "dependencies"
- "frontend"
commit-message:
prefix: "chore(deps)"
reviewers:
- "mgierschdev"

# Enable version updates for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 3
labels:
- "dependencies"
- "ci"
commit-message:
prefix: "chore(deps)"
115 changes: 115 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: CI

on:
push:
branches: [ main, develop, 'copilot/**' ]
pull_request:
branches: [ main, develop ]

permissions:
contents: read

jobs:
backend:
name: Backend Build and Test
runs-on: ubuntu-latest

permissions:
contents: read

steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'

- name: Grant execute permission for gradlew
run: chmod +x backend/gradlew

- name: Build with Gradle
run: |
cd backend
./gradlew build --no-daemon

- name: Run tests
run: |
cd backend
./gradlew test --no-daemon

- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: backend-test-results
path: backend/build/reports/tests/test/

frontend:
name: Frontend Build and Test
runs-on: ubuntu-latest

permissions:
contents: read

steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json

- name: Install dependencies
run: |
cd frontend
npm ci

- name: Run linter
run: |
cd frontend
npm run lint

- name: Run tests
run: |
cd frontend
npm test -- --passWithNoTests

- name: Build
env:
NEXT_TELEMETRY_DISABLED: 1
run: |
cd frontend
npm run build

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: frontend-build
path: frontend/.next/

docker:
name: Docker Build
runs-on: ubuntu-latest
needs: [backend, frontend]

permissions:
contents: read

steps:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build backend Docker image
run: |
docker build -t chess-backend:test ./backend

- name: Build frontend Docker image
run: |
docker build -t chess-frontend:test ./frontend
224 changes: 224 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
# Contributing to ChessEngine

Thank you for your interest in contributing to ChessEngine! This document provides guidelines for contributing to the project.

## Getting Started

### Prerequisites

- **Java 17 or higher** - For backend development
- **Node.js 18+** - For frontend development
- **Git** - For version control
- **Docker** (optional) - For containerized development

### Development Setup

1. **Fork and clone the repository**
```bash
git clone https://github.com/<your-username>/ChessEngine.git
cd ChessEngine
```

2. **Backend setup**
```bash
cd backend
./gradlew build
./gradlew bootRun
```
Backend will run on `http://localhost:8080`

3. **Frontend setup**
```bash
cd frontend
npm install
npm run dev
```
Frontend will run on `http://localhost:3000`

### Using Make Commands

The project includes a Makefile for common tasks:

```bash
make dev # Run backend + frontend locally
make test # Run all tests
make docker-up # Start with Docker Compose
make docker-down # Stop Docker services
```

## Development Workflow

### 1. Create a Feature Branch

```bash
git checkout -b feature/your-feature-name
```

Use descriptive branch names:
- `feature/` - New features
- `fix/` - Bug fixes
- `docs/` - Documentation updates
- `test/` - Test additions or improvements
- `refactor/` - Code refactoring

### 2. Make Your Changes

- Follow existing code style and conventions
- Write clear, descriptive commit messages
- Keep commits focused and atomic
- Add tests for new functionality
- Update documentation as needed

### 3. Test Your Changes

**Backend:**
```bash
cd backend
./gradlew test
```

**Frontend:**
```bash
cd frontend
npm run lint
npm test
npm run build
```

**All tests:**
```bash
make test
```

### 4. Commit Your Changes

Follow conventional commit format:
```
<type>(<scope>): <subject>

<body>

<footer>
```

Types: `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore`

Examples:
```
feat(backend): add stalemate detection
fix(frontend): correct piece highlighting bug
docs(readme): update Docker instructions
test(chess): add castling validation tests
```

### 5. Push and Create Pull Request

```bash
git push origin feature/your-feature-name
```

Then create a Pull Request on GitHub with:
- Clear title describing the change
- Description of what changed and why
- Steps to test the changes
- Screenshots (for UI changes)
- Link to related issues

## Code Style Guidelines

### Backend (Java)

- Follow standard Java naming conventions
- Use meaningful variable and method names
- Document complex logic with comments
- Keep methods focused and under 50 lines when possible
- Write unit tests for new functionality

### Frontend (TypeScript/React)

- Use TypeScript for type safety
- Follow Next.js and React best practices
- Use functional components and hooks
- Keep components focused and reusable
- Use meaningful prop and state names
- Follow ESLint rules: `npm run lint`

## Testing Guidelines

### Backend Tests

- Place tests in `backend/src/test/java/`
- Use JUnit 5 for test framework
- Name tests descriptively: `testFeatureUnderSpecificCondition`
- Test edge cases and error conditions
- Aim for meaningful test coverage

### Frontend Tests

- Place tests next to components: `*.test.tsx`
- Use Jest and React Testing Library
- Test user interactions and component behavior
- Mock external dependencies (API calls)
- Focus on behavior, not implementation

## What We're Looking For

### Good Contributions

βœ… **Bug fixes** - Especially with test cases
βœ… **Test additions** - Improve code coverage
βœ… **Documentation improvements** - Clearer explanations
βœ… **Performance improvements** - With benchmarks
βœ… **Chess rule correctness** - Edge case handling
βœ… **UI/UX enhancements** - Better user experience

### Contributions We Won't Accept

❌ **Database additions** - Keep it in-memory by design
❌ **Authentication systems** - Out of scope
❌ **AI opponents** - Future feature, not ready yet
❌ **Online multiplayer** - Out of scope
❌ **Major architectural changes** - Discuss first

## Known Limitations (As Designed)

These are **intentional design choices**, not bugs:

- **In-memory game state** - No persistence between restarts
- **Single game instance** - One game per server
- **No draw detection** - Stalemate not implemented
- **No move history export** - No PGN/FEN support
- **Local only** - No production deployment

If you want to address these, please open an issue first to discuss.

## Pull Request Process

1. **Ensure CI passes** - All tests must pass
2. **Update documentation** - If behavior changes
3. **Add tests** - For new features
4. **Keep PRs focused** - One feature/fix per PR
5. **Respond to feedback** - Be open to suggestions
6. **Be patient** - Reviews may take a few days

## Getting Help

- **Issues** - Check existing issues or open a new one
- **Discussions** - For questions and ideas
- **Documentation** - Read README.md thoroughly

## Code of Conduct

- Be respectful and professional
- Welcome newcomers and help them learn
- Focus on constructive feedback
- Keep discussions on-topic

## Recognition

Contributors will be:
- Acknowledged in release notes
- Listed in GitHub contributors
- Thanked in the community

Thank you for contributing! πŸŽ‰
Loading
Loading