Skip to content

About

A templatef or a WebView based Idle Game

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Idle Game Template

An open-source desktop idle-game template built with Tauri 2, React 18, and TypeScript. It ships a complete, working idle game on top of a reusable engine and UI framework — fork it, swap the content, and build your own.

The included game is deliberately generic: mine resources across a multi-sector map, refine ore into materials, manufacture ships, fight pirates, train skills, and trade at stations. All of it is placeholder content meant to be replaced.

To see it in action, check this video: https://www.youtube.com/watch?v=4MyZ7BZFun0

What you get

  • Deterministic tick engine — a pure, framework-free simulation in src/game/. Time and randomness are inputs, so saves round-trip exactly and the whole simulation is trivially testable.
  • Offline progress — adaptive catch-up simulation when the app reopens.
  • Schema-versioned saves — Zod-validated saves, a sequential migration pipeline, atomic writes, rolling backups, and corrupt-save recovery.
  • Floating-window UI — draggable, resizable, tab-mergeable panels with layout persistence; a configurable navbar and status bar.
  • Data-driven content — every entity is JSON in src/game/data/, validated at startup. No game stats are hardcoded in TypeScript.
  • Optional feedback system — an in-app bug-report / feedback panel that works as an inert stub until you configure an endpoint.

Tech stack

Tauri 2 · React 18 · TypeScript (strict) · Zustand + Immer · Zod · Tailwind CSS v4 · Vite · Vitest · Biome. Package manager: bun.

Getting started

bun install
bun run tauri dev        # full desktop app (Tauri shell + frontend)

Other commands:

bun run dev              # frontend only, in a browser (vite dev server)
bun run build            # type-check + production frontend build
bun run tauri build      # native installers for the current platform
bun run test             # run the test suite (vitest)
bunx biome check --write .   # lint + format

Project layout

src/
  game/        pure simulation — no React, Zustand, Tauri, or DOM
    engine/    tick loop, scheduler, seeded RNG, offline catch-up
    systems/   one file per tick system (mining, refining, combat, …)
    data/      JSON entity definitions + Zod schemas + registries
    events/    event bus
  store/       Zustand boundary (game state + UI/window stores)
  save/        serialization, schema versioning, migrations, recovery
  ui/          React — floating-window shell, panels, notifications
  feedback/    optional in-app feedback / bug-report system
src-tauri/     Rust backend — file IO, atomic saves, backups, OS hooks

The architecture and conventions are documented in detail in CLAUDE.md.

Making it your own

  • Content — edit the JSON in src/game/data/. The Zod schemas in schemas.ts validate it on startup, so a bad reference fails loudly.
  • Systems — add a tick system in src/game/systems/ and register it in src/game/engine/tick.ts.
  • UI — add a panel in src/ui/panels/ and register it in src/ui/panels/registry.tsx. The window framework itself is game-agnostic.
  • Saves — when you change the game state shape, bump CURRENT_SAVE_VERSION and add a migration under src/save/migrations/.

Feedback system

The in-app feedback panel is optional and inert by default. To enable submissions, copy .env.example to .env and set an endpoint + key. Left unset, the panel still renders but submissions are disabled.

License

MIT — use it freely.

About

A templatef or a WebView based Idle Game

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages