Online browser-based RTS game
  • TypeScript 91.4%
  • GLSL 2.6%
  • JavaScript 1.8%
  • HTML 1.7%
  • CSS 0.9%
  • Other 1.5%
Find a file
2026-06-10 10:39:59 -07:00
.github Bump the updates group with 2 updates (#4140) 2026-06-04 11:50:00 -07:00
.husky build: migrate build system to Vite and test runner to Vitest & Remove depracated husky usage (#2703) 2025-12-28 22:10:26 -08:00
.vscode VSCode: have it recommend trusted Prettier and Socket Security extensions (#3658) 2026-04-13 20:21:08 -07:00
__mocks__ Add trains (#1159) 2025-06-22 08:14:08 -07:00
docs Serve hashed assets from R2 via CDN_BASE (#3773) 2026-04-27 11:27:54 -06:00
map-generator Adds Hong Kong map (#4191) 2026-06-09 18:39:48 -07:00
proprietary Tos update (#3917) 2026-05-31 15:09:08 +01:00
resources Add territory saturation and opacity graphics settings 2026-06-09 19:16:04 -07:00
scripts Fix PR gate trusting author_association for org membership 2026-06-04 11:51:53 -07:00
src meta: increase trade ship sigmoid midpoint 200 => 400 2026-06-10 10:39:59 -07:00
tests Add territory saturation and opacity graphics settings 2026-06-09 19:16:04 -07:00
.dockerignore Update docker build to be smaller & faster (#2693) 2025-12-25 12:49:00 -08:00
.editorconfig Add prettier-plugin-sh (#762) 2025-05-15 23:09:39 -04:00
.gitignore Add CLAUDE.md 2026-04-29 12:49:19 -06:00
.gitmodules uncomment husky 2025-03-06 15:50:29 -08:00
.prettierrc Add prettier-plugin-sh (#762) 2025-05-15 23:09:39 -04:00
.swcrc Switch to @swc/jest to speed up tests Fixes #1679 (#1680) 2025-09-03 16:07:43 -07:00
build-deploy.sh remove falk1 from deployment 2026-03-23 13:59:34 -07:00
build.sh bugfix: include --metadata-file in the build.sh that was accidently removed 2025-12-25 20:27:50 -08:00
CLAUDE.md Add CLAUDE.md 2026-04-29 12:49:19 -06:00
CODEOWNERS fix: Update CODEOWNERS (#2981) 2026-01-21 10:00:55 -08:00
CONTRIBUTING.md Move contributing docs to CONTRIBUTING.md and require approved issues 2026-06-01 21:44:16 -07:00
CREDITS.md Add map los angeles (with roads) (#3708) 2026-04-27 22:05:17 -06:00
deploy.sh refactor: collapse per-env Configs into ClientEnv + ServerEnv (#3906) 2026-05-11 19:24:01 -07:00
Dockerfile increasing staging deployments ttl from 18h=>25h 2026-04-13 08:37:01 -07:00
eslint.config.js HPA* Pathfinding (#2815) 2026-01-08 13:34:18 -08:00
example.env Serve hashed assets from R2 via CDN_BASE (#3773) 2026-04-27 11:27:54 -06:00
index.html Add Graphics Settings modal with live name-label tuning (#4065) 2026-05-28 13:06:43 -07:00
LICENSE Refine AGPL Section 7 attribution terms 2025-12-16 16:33:51 -08:00
LICENSE-ASSETS Tos update (#3917) 2026-05-31 15:09:08 +01:00
LICENSING.md Tos update (#3917) 2026-05-31 15:09:08 +01:00
nginx.conf Merge branch 'v30' 2026-04-01 20:03:39 -07:00
package-lock.json Bump qs from 6.15.0 to 6.15.2 in the npm_and_yarn group across 1 directory (#3995) 2026-05-24 17:03:57 +01:00
package.json Gate Vite dev server LAN binding behind VITE_HOST=lan 2026-06-04 12:50:24 -07:00
README.md Move contributing docs to CONTRIBUTING.md and require approved issues 2026-06-01 21:44:16 -07:00
setup.sh upload manifest to r2 before starting container (#3767) 2026-04-25 21:15:49 -06:00
supervisord.conf remove cloudflare tunnels (#3556) 2026-04-01 19:33:55 -07:00
tsconfig.json TypeScript update to 6.0.3 (#3806) 2026-04-30 15:49:24 -06:00
update.sh Include Vite's bundle output in the manifest (#3772) 2026-04-25 21:46:02 -06:00
vite.config.ts Gate Vite dev server LAN binding behind VITE_HOST=lan 2026-06-04 12:50:24 -07:00

OpenFrontIO Logo

OpenFront.io is an online real-time strategy game focused on territorial control and alliance building. Players compete to expand their territory, build structures, and form strategic alliances in various maps based on real-world geography.

This is a fork/rewrite of WarFront.io. Credit to https://github.com/WarFrontIO.

CI Crowdin CLA assistant License: AGPL v3 Assets: CC BY-SA 4.0

License

OpenFront source code is licensed under the GNU Affero General Public License v3.0

Current copyright notices appear in:

  • Footer: "© OpenFront and Contributors"
  • Loading screen: "© OpenFront and Contributors"

Modified versions must preserve these notices in reasonably visible locations.

See the LICENSE for complete requirements.

For asset licensing, see LICENSE-ASSETS.
For license history, see LICENSING.md.

🌟 Features

  • Real-time Strategy Gameplay: Expand your territory and engage in strategic battles
  • Alliance System: Form alliances with other players for mutual defense
  • Multiple Maps: Play across various geographical regions including Europe, Asia, Africa, and more
  • Resource Management: Balance your expansion with defensive capabilities
  • Cross-platform: Play in any modern web browser

📋 Prerequisites

  • npm (v10.9.2 or higher)
  • A modern web browser (Chrome, Firefox, Edge, etc.)

🚀 Installation

  1. Clone the repository

    git clone https://github.com/openfrontio/OpenFrontIO.git
    cd OpenFrontIO
    
  2. Install dependencies

    npm run inst
    

    Do NOT use npm install nor npm i but instead use our npm run inst. It runs the safer npm ci --ignore-scripts to install dependencies exactly according to the versions in package-lock.json and doesn't run scripts. This can prevent being hit by a supply chain attack.

🎮 Running the Game

Development Mode

Run both the client and server in development mode with live reloading:

npm run dev

This will:

  • Start the webpack dev server for the client
  • Launch the game server with development settings
  • Open the game in your default browser (to disable this behavior, set SKIP_BROWSER_OPEN=true in your environment)

Client Only

To run just the client with hot reloading:

npm run start:client

Server Only

To run just the server with development settings:

npm run start:server-dev

Connecting to staging or production backends

Sometimes it's useful to connect to production servers when replaying a game, testing user profiles, purchases, or login flow.

To replay a production game, make sure you're on the same commit that the game you want to replay was executed on, you can find the gitCommit value via https://api.openfront.io/game/[gameId]. Unfinished games cannot be replayed on localhost.

To connect to staging api servers:

npm run dev:staging

To connect to production api servers:

npm run dev:prod

🛠️ Development Tools

  • Format code:

    npm run format
    
  • Lint code:

    npm run lint
    
  • Lint and fix code:

    npm run lint:fix
    
  • Testing

    npm test
    

🏗️ Project Structure

  • /src/client - Frontend game client
  • /src/core - Deterministic game simulation
  • /src/server - Backend game server
  • /resources - Static assets (images, maps, etc.)

🤝 Contributing

Contributions and translations are welcome! See CONTRIBUTING.md for the workflow, the approved-issue process, project governance, and translation info.