Composable web game framework with a Rust/WASM ECS core and TypeScript-first DX.
GWEN helps you build games with a clear structure:
- scenes for game flow
- systems for logic
- components for data
- prefabs for reusable entities
- UI modules for menus/HUD
Quick Start · Documentation · Project Structure · CLI
- Config-first workflow via
gwen.config.ts - CLI scaffolding for fast project creation
- Plugin architecture (input, audio, renderer, debug, html-ui)
- High-performance ECS powered by Rust + WASM
- Type-safe APIs for systems, scenes, services, and plugins
pnpm create@djodjonx/gwen-app my-game
cd my-game
pnpm dev# Usually
http://localhost:3000gwen buildGWEN ships with a CLI designed around the same workflow as the playground.
# Create project
pnpm create@djodjonx/gwen-app my-game
# Development
gwen dev
# Prepare generated typing/runtime files
gwen prepare
# Production build
gwen build
# Code quality
gwen lint
gwen format --checkSee full command reference in docs/CLI.md.
GWEN targets a structure like the playground app:
src/
components/ # ECS component definitions
prefabs/ # reusable entity blueprints
scenes/ # game flow and scene lifecycle
systems/ # gameplay logic (runs every frame/event)
ui/ # HUD/menu UI modules
This structure is intentional: it keeps gameplay code discoverable as the project grows.
- Configure engine and plugins in
gwen.config.ts - Define components in
src/components - Implement systems in
src/systems - Compose scenes in
src/scenes - Reuse entities via
src/prefabs - Start with
gwen dev
Example config shape:
import { defineConfig } from '@djodjonx/gwen-kit';
import { InputPlugin } from '@djodjonx/gwen-plugin-input';
import { AudioPlugin } from '@djodjonx/gwen-plugin-audio';
import { Canvas2DRenderer } from '@djodjonx/gwen-renderer-canvas2d';
export default defineConfig({
engine: { maxEntities: 2000, targetFPS: 60, debug: false },
plugins: [
new InputPlugin(),
new AudioPlugin(),
new Canvas2DRenderer({ width: 480, height: 640 }),
],
});Your Game (Scenes / Systems / Components / UI)
-> GWEN Plugins (Renderer, Input, Audio, Debug, ...)
-> GWEN Core (Rust/WASM ECS)
For technical details, see docs/ARCHITECTURE.md.
Full Documentation: https://djodjonx.github.io/gwen/
Reference files:
docs/GETTING_STARTED.md- setup and first rundocs/CLI.md- command reference and scaffoldingdocs/ARCHITECTURE.md- technical architecturedocs/DEPLOYMENT.md- production deployment (SharedArrayBuffer headers)docs/NPM_RELEASE.md- npm publishing guideCONTRIBUTING.md- contribution guideSECURITY.md- vulnerability reporting
Quick start:
# 1. Build
./scripts/build-wasm.sh && pnpm build:ts
# 2. Publish
pnpm publish -r --access publicSee docs/QUICK_RELEASE.md for complete workflow with Changesets.
We welcome issues, ideas, and PRs.
- Report bugs: https://github.com/djodjonx/gwen/issues
- Discuss features: https://github.com/djodjonx/gwen/discussions
- Read contribution guide:
CONTRIBUTING.md
GWEN is licensed under Mozilla Public License 2.0 (MPL-2.0).
See LICENSE.