First off, thank you for considering contributing to OpenFront.io! It's people like you that make OpenFront such a great game.
We welcome contributions from everyone. By participating in this project, you agree to abide by our code of conduct and treat all community members with respect.
- Game: https://openfront.io/
- Discord: Join the Development Discord
- Translations: Crowdin Project
- Issues: GitHub Issues
- Node.js: Ensure you have a recent version installed.
- npm: Version 10.9.2 or higher.
- Git: For version control.
- Fork the repository on GitHub.
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/OpenFrontIO.git cd OpenFrontIO - Install dependencies:
Important: Use
npm run instinstead ofnpm install. This runsnpm ci --ignore-scriptsto ensure a consistent and secure environment.npm run inst
-
Full Development Mode (Client + Server):
npm run dev
This starts the webpack dev server and the game server, and opens your browser.
-
Client Only:
npm run start:client
-
Server Only:
npm run start:server-dev
Create a new branch for each feature or bug fix:
git checkout -b feature/your-feature-name
# or
git checkout -b fix/issue-number-bug-nameWe enforce code quality using ESLint and Prettier.
- Format Code:
npm run format
- Lint Code:
npm run lint
- Lint & Fix:
npm run lint:fix
All new features and bug fixes should include relevant tests. We use Vitest.
- Run Tests:
npm test - Run Coverage:
npm run test:coverage
Note: All code changes in src/core MUST be tested to ensure game logic stability.
-
Commit your changes:
- Write clear, concise commit messages.
- Use the present tense ("Add feature" not "Added feature").
git commit -m "Add new map rendering logic" -
Push to your fork:
git push origin feature/your-feature-name
-
Open a Pull Request (PR):
- Go to the original repository and click "New Pull Request".
- Select your branch.
- Fill out the PR Template completely.
Before submitting, ensure you have:
- Linked the relevant issue (e.g.,
Resolves #123). - Added screenshots for any UI changes.
- Processed text through
translateText()and added strings toen.json. - Added/Updated tests in the
tests/directory. - Verified that
npm testpasses. - Provided your Discord username in the PR description for communication.
We use Crowdin for translations. If you want to help translate OpenFront.io:
- Join the Translation Discord.
- Visit our Crowdin Project.
- Select your language or request a new one.
src/client: Frontend game client (rendering, input, UI).src/server: Backend game server (networking, game state).src/core: Shared game logic used by both client and server.resources: Static assets (images, sounds, maps).tests: Unit and integration tests.
By contributing, you agree that your contributions will be licensed under the GNU Affero General Public License v3.0 (AGPL v3.0).