# Contributing to CodeTrail

Thanks for helping. The two most useful contributions are bug reports with steps to reproduce, and new problems.

## Before you start

- Open an issue first for anything bigger than a small fix, so nobody duplicates work.
- Keep pull requests focused on one change.
- Match the code style around your change. No reformatting of files you did not otherwise touch.

## Adding a problem

1. Read [backend/arena/docs/problems.md](backend/arena/docs/problems.md).
2. Create `backend/arena/problems/<id>.json` and three reference solutions, `backend/arena/solutions/<id>.js`, `<id>.py` and `<id>.java`, written independently.
3. Run `cd backend && npm run validate:problems`. All three references must pass every example and test.
4. Problems must be your own work. Do not copy statements or tests from other sites or from any private problem bank.

## Adding a language

Players can write Python, JavaScript, TypeScript or Java today. C++ and Go are
open for contributors: [C++ (#2)](https://github.com/codearena-oss/codearena/issues/2)
and [Go (#3)](https://github.com/codearena-oss/codearena/issues/3).

## Running the checks

```bash
cd backend && npm test
cd frontend && npm test && npm run lint
node scripts/check-boundary.js
```

The boundary check fails on credentials, personal email addresses, local file paths and anything that must not be published. CI runs the same checks on every pull request.

## Code of conduct

Be kind. This is a place to practice, so people here are learning in public; treat mistakes gently. Harassment is not tolerated. Maintainers may remove comments, commits or contributors that break this.

## Licensing of contributions

By submitting a pull request you agree that your contribution is your own work (or you have the right to submit it) and that it will be licensed under the project's license.
