Skip to content

Commit 22bf256

Browse files
authored
Merge pull request #13 from mgierschdev/copilot/enhance-project-to-portfolio-grade
Portfolio-grade enhancement: externalized config, Docker, Swagger, tests, CI, docs, and chess rule fixes
2 parents ad1ac9c + e00fa32 commit 22bf256

26 files changed

Lines changed: 2044 additions & 254 deletions

.github/dependabot.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
version: 2
2+
updates:
3+
# Enable version updates for Gradle (backend)
4+
- package-ecosystem: "gradle"
5+
directory: "/backend"
6+
schedule:
7+
interval: "weekly"
8+
day: "monday"
9+
open-pull-requests-limit: 5
10+
labels:
11+
- "dependencies"
12+
- "backend"
13+
commit-message:
14+
prefix: "chore(deps)"
15+
reviewers:
16+
- "mgierschdev"
17+
18+
# Enable version updates for npm (frontend)
19+
- package-ecosystem: "npm"
20+
directory: "/frontend"
21+
schedule:
22+
interval: "weekly"
23+
day: "monday"
24+
open-pull-requests-limit: 5
25+
labels:
26+
- "dependencies"
27+
- "frontend"
28+
commit-message:
29+
prefix: "chore(deps)"
30+
reviewers:
31+
- "mgierschdev"
32+
33+
# Enable version updates for GitHub Actions
34+
- package-ecosystem: "github-actions"
35+
directory: "/"
36+
schedule:
37+
interval: "weekly"
38+
day: "monday"
39+
open-pull-requests-limit: 3
40+
labels:
41+
- "dependencies"
42+
- "ci"
43+
commit-message:
44+
prefix: "chore(deps)"

.github/workflows/ci.yml

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, develop, 'copilot/**' ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
backend:
14+
name: Backend Build and Test
15+
runs-on: ubuntu-latest
16+
17+
permissions:
18+
contents: read
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Set up JDK 17
24+
uses: actions/setup-java@v4
25+
with:
26+
java-version: '17'
27+
distribution: 'temurin'
28+
cache: 'gradle'
29+
30+
- name: Grant execute permission for gradlew
31+
run: chmod +x backend/gradlew
32+
33+
- name: Build with Gradle
34+
run: |
35+
cd backend
36+
./gradlew build --no-daemon
37+
38+
- name: Run tests
39+
run: |
40+
cd backend
41+
./gradlew test --no-daemon
42+
43+
- name: Upload test results
44+
if: always()
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: backend-test-results
48+
path: backend/build/reports/tests/test/
49+
50+
frontend:
51+
name: Frontend Build and Test
52+
runs-on: ubuntu-latest
53+
54+
permissions:
55+
contents: read
56+
57+
steps:
58+
- uses: actions/checkout@v4
59+
60+
- name: Set up Node.js
61+
uses: actions/setup-node@v4
62+
with:
63+
node-version: '18'
64+
cache: 'npm'
65+
cache-dependency-path: frontend/package-lock.json
66+
67+
- name: Install dependencies
68+
run: |
69+
cd frontend
70+
npm ci
71+
72+
- name: Run linter
73+
run: |
74+
cd frontend
75+
npm run lint
76+
77+
- name: Run tests
78+
run: |
79+
cd frontend
80+
npm test -- --passWithNoTests
81+
82+
- name: Build
83+
env:
84+
NEXT_TELEMETRY_DISABLED: 1
85+
run: |
86+
cd frontend
87+
npm run build
88+
89+
- name: Upload build artifacts
90+
uses: actions/upload-artifact@v4
91+
with:
92+
name: frontend-build
93+
path: frontend/.next/
94+
95+
docker:
96+
name: Docker Build
97+
runs-on: ubuntu-latest
98+
needs: [backend, frontend]
99+
100+
permissions:
101+
contents: read
102+
103+
steps:
104+
- uses: actions/checkout@v4
105+
106+
- name: Set up Docker Buildx
107+
uses: docker/setup-buildx-action@v3
108+
109+
- name: Build backend Docker image
110+
run: |
111+
docker build -t chess-backend:test ./backend
112+
113+
- name: Build frontend Docker image
114+
run: |
115+
docker build -t chess-frontend:test ./frontend

CONTRIBUTING.md

Lines changed: 224 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,224 @@
1+
# Contributing to ChessEngine
2+
3+
Thank you for your interest in contributing to ChessEngine! This document provides guidelines for contributing to the project.
4+
5+
## Getting Started
6+
7+
### Prerequisites
8+
9+
- **Java 17 or higher** - For backend development
10+
- **Node.js 18+** - For frontend development
11+
- **Git** - For version control
12+
- **Docker** (optional) - For containerized development
13+
14+
### Development Setup
15+
16+
1. **Fork and clone the repository**
17+
```bash
18+
git clone https://github.com/<your-username>/ChessEngine.git
19+
cd ChessEngine
20+
```
21+
22+
2. **Backend setup**
23+
```bash
24+
cd backend
25+
./gradlew build
26+
./gradlew bootRun
27+
```
28+
Backend will run on `http://localhost:8080`
29+
30+
3. **Frontend setup**
31+
```bash
32+
cd frontend
33+
npm install
34+
npm run dev
35+
```
36+
Frontend will run on `http://localhost:3000`
37+
38+
### Using Make Commands
39+
40+
The project includes a Makefile for common tasks:
41+
42+
```bash
43+
make dev # Run backend + frontend locally
44+
make test # Run all tests
45+
make docker-up # Start with Docker Compose
46+
make docker-down # Stop Docker services
47+
```
48+
49+
## Development Workflow
50+
51+
### 1. Create a Feature Branch
52+
53+
```bash
54+
git checkout -b feature/your-feature-name
55+
```
56+
57+
Use descriptive branch names:
58+
- `feature/` - New features
59+
- `fix/` - Bug fixes
60+
- `docs/` - Documentation updates
61+
- `test/` - Test additions or improvements
62+
- `refactor/` - Code refactoring
63+
64+
### 2. Make Your Changes
65+
66+
- Follow existing code style and conventions
67+
- Write clear, descriptive commit messages
68+
- Keep commits focused and atomic
69+
- Add tests for new functionality
70+
- Update documentation as needed
71+
72+
### 3. Test Your Changes
73+
74+
**Backend:**
75+
```bash
76+
cd backend
77+
./gradlew test
78+
```
79+
80+
**Frontend:**
81+
```bash
82+
cd frontend
83+
npm run lint
84+
npm test
85+
npm run build
86+
```
87+
88+
**All tests:**
89+
```bash
90+
make test
91+
```
92+
93+
### 4. Commit Your Changes
94+
95+
Follow conventional commit format:
96+
```
97+
<type>(<scope>): <subject>
98+
99+
<body>
100+
101+
<footer>
102+
```
103+
104+
Types: `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore`
105+
106+
Examples:
107+
```
108+
feat(backend): add stalemate detection
109+
fix(frontend): correct piece highlighting bug
110+
docs(readme): update Docker instructions
111+
test(chess): add castling validation tests
112+
```
113+
114+
### 5. Push and Create Pull Request
115+
116+
```bash
117+
git push origin feature/your-feature-name
118+
```
119+
120+
Then create a Pull Request on GitHub with:
121+
- Clear title describing the change
122+
- Description of what changed and why
123+
- Steps to test the changes
124+
- Screenshots (for UI changes)
125+
- Link to related issues
126+
127+
## Code Style Guidelines
128+
129+
### Backend (Java)
130+
131+
- Follow standard Java naming conventions
132+
- Use meaningful variable and method names
133+
- Document complex logic with comments
134+
- Keep methods focused and under 50 lines when possible
135+
- Write unit tests for new functionality
136+
137+
### Frontend (TypeScript/React)
138+
139+
- Use TypeScript for type safety
140+
- Follow Next.js and React best practices
141+
- Use functional components and hooks
142+
- Keep components focused and reusable
143+
- Use meaningful prop and state names
144+
- Follow ESLint rules: `npm run lint`
145+
146+
## Testing Guidelines
147+
148+
### Backend Tests
149+
150+
- Place tests in `backend/src/test/java/`
151+
- Use JUnit 5 for test framework
152+
- Name tests descriptively: `testFeatureUnderSpecificCondition`
153+
- Test edge cases and error conditions
154+
- Aim for meaningful test coverage
155+
156+
### Frontend Tests
157+
158+
- Place tests next to components: `*.test.tsx`
159+
- Use Jest and React Testing Library
160+
- Test user interactions and component behavior
161+
- Mock external dependencies (API calls)
162+
- Focus on behavior, not implementation
163+
164+
## What We're Looking For
165+
166+
### Good Contributions
167+
168+
**Bug fixes** - Especially with test cases
169+
**Test additions** - Improve code coverage
170+
**Documentation improvements** - Clearer explanations
171+
**Performance improvements** - With benchmarks
172+
**Chess rule correctness** - Edge case handling
173+
**UI/UX enhancements** - Better user experience
174+
175+
### Contributions We Won't Accept
176+
177+
**Database additions** - Keep it in-memory by design
178+
**Authentication systems** - Out of scope
179+
**AI opponents** - Future feature, not ready yet
180+
**Online multiplayer** - Out of scope
181+
**Major architectural changes** - Discuss first
182+
183+
## Known Limitations (As Designed)
184+
185+
These are **intentional design choices**, not bugs:
186+
187+
- **In-memory game state** - No persistence between restarts
188+
- **Single game instance** - One game per server
189+
- **No draw detection** - Stalemate not implemented
190+
- **No move history export** - No PGN/FEN support
191+
- **Local only** - No production deployment
192+
193+
If you want to address these, please open an issue first to discuss.
194+
195+
## Pull Request Process
196+
197+
1. **Ensure CI passes** - All tests must pass
198+
2. **Update documentation** - If behavior changes
199+
3. **Add tests** - For new features
200+
4. **Keep PRs focused** - One feature/fix per PR
201+
5. **Respond to feedback** - Be open to suggestions
202+
6. **Be patient** - Reviews may take a few days
203+
204+
## Getting Help
205+
206+
- **Issues** - Check existing issues or open a new one
207+
- **Discussions** - For questions and ideas
208+
- **Documentation** - Read README.md thoroughly
209+
210+
## Code of Conduct
211+
212+
- Be respectful and professional
213+
- Welcome newcomers and help them learn
214+
- Focus on constructive feedback
215+
- Keep discussions on-topic
216+
217+
## Recognition
218+
219+
Contributors will be:
220+
- Acknowledged in release notes
221+
- Listed in GitHub contributors
222+
- Thanked in the community
223+
224+
Thank you for contributing! 🎉

0 commit comments

Comments
 (0)