About SyncEngine

The idea behind SyncEngine started with a recurring frustration developers face when building collaborative applications: every new application brings another set of synchronization decisions to make. How should state changes be shared between users? How should conflicting updates be handled? How do you ensure everyone sees a consistent state, and how can that state be recovered when something goes wrong? Even when building different features within the same application, developers often end up solving variations of these problems again and again.

We wanted to explore whether this common problem could be solved once, so developers could focus on building their products instead of repeatedly reinventing their synchronization layer.

That became SyncEngine.

🛠️ What We Built

SyncEngine is a reusable foundation for building collaborative, multi-user applications. It provides a structured way to define application state, process and validate actions, synchronize changes between clients, and maintain a verifiable history of what happened.

Instead of tightly coupling synchronization logic to a particular application, we designed SyncEngine around reusable contracts and injected components. This allows different applications to define their own rules and behavior while relying on the same underlying engine.

To demonstrate that this wasn't limited to a single use case, we built two applications on top of it.

The first is a collaborative whiteboard. Multiple users can join a shared space, create and edit shapes, draw, add sticky notes, and collaborate together. It demonstrates how SyncEngine can support applications where shared state changes frequently through user interactions.

AeroBoard

The second is a multiplayer first-person battle royale game. Players enter an island, interact with the game world, fight opponents, and compete on a leaderboard. This was a very different challenge from the whiteboard, but it uses the same underlying engine for important match-state updates such as player health, hits, kills, deaths, and respawns.

GenX0

Building these two applications helped us demonstrate the flexibility of the same foundation across two very different kinds of experiences.

⚙️ How We Built It

We developed SyncEngine in TypeScript, with a modular architecture that separates the core synchronization logic from application-specific behavior.

Applications define their state, actions, validation rules, and transitions through a common interface. The engine handles the shared infrastructure around processing those actions and maintaining state history.

📦 What's Inside the Skeleton

Feature What it does
Rooms and reconnect Clients join rooms and catch up by sequence number after a disconnect, with no lost or doubled events.
Action pipeline Shape checks, role permissions, duplicate detection, per-client rate limits and conflict handling, all before your rules run.
Hash-chained event log An append-only, versioned log in which every entry is hash-linked to the one before it. The log is the source of truth.
Replay and time travel Rebuild the state at any step of a room's history, with snapshots so jumps stay fast.
Per-item history See who changed a given item and when. The whiteboard uses this for its shape history card.
Ephemeral channel A fast channel for cursors, movement and aiming that stays out of the log.
Log verifier A standalone command-line tool that detects any edit to an exported log.
Client SDK A client library that connects, submits actions and listens for state changes.
Shared data types Ready-made counters, registers, lists, maps, sets and positions for building app state.
Test kit Helpers for testing your rules, including replay and determinism checks.

🚀 Getting Started with a New Application

One of the main goals behind SyncEngine was to make it easier for developers to build collaborative applications without having to implement synchronization infrastructure from scratch.

Getting started is straightforward. Developers first define their application's state, actions, validation rules, and state transitions using SyncEngine's typed contracts. Next, they connect the required storage and communication layers through adapters.

Once these are in place, SyncEngine takes care of the common infrastructure — processing actions, validating updates, maintaining event history, and reconstructing application state through replay and snapshots.

This allows developers to focus on their application's actual functionality instead of spending time rebuilding synchronization, event logging, and state recovery mechanisms for every project.

In short: define how your application works, connect the required components, and let SyncEngine take care of the synchronization behind it. ⚡

🤖 How We Used Kiro

Building SyncEngine alongside two complete applications was a fairly ambitious undertaking. We weren't just writing application code — we were designing a reusable architecture, maintaining consistency across multiple codebases, testing real-time interactions, and preparing infrastructure for deployment.

We wanted to make the most of AI-assisted development without sacrificing code quality or architectural discipline. This is where Kiro became central to our workflow.

Rather than treating it as a tool we asked for code snippets, we built a development workflow around its ecosystem. We used specs to plan complex features, steering documents to maintain architectural consistency, hooks to automate safeguards, and MCP integrations to let Kiro interact with our actual applications and infrastructure.

Here's how we used each part of Kiro in the project:

Kiro Feature How We Used It Impact on the Project
Spec-Driven Development Broke the project into structured requirements, technical designs, and implementation tasks. The syncengine-core spec alone contains 130 tasks covering everything from monorepo scaffolding and JCS canonicalization to hash chaining, middleware, and the verification pipeline. We also created dedicated specs for the whiteboard and six game features. Instead of building a large system through disconnected prompts, we had a traceable implementation plan. Across the project, our specs contain over 5,500 lines of requirements, designs, and tasks, with 350+ completed tasks.
Bugfix Specs Used a dedicated bugfix spec to document 12 critical issues found during whiteboard code review. Each issue included its current behavior, expected behavior, and existing behavior that must not regress. Kiro then worked through a structured set of 65 tasks. Turned code-review findings into a systematic repair process. This included issues such as users being able to obtain host privileges by choosing a name beginning with host, and a colour-selection action that could permanently disconnect a client.
Steering Documents Created project-wide rules in project-principles.md, commit-per-feature.md, and AGENTS.MD. These instructed Kiro to keep the event log as the source of truth, enforce deterministic logic, use ports-and-adapters boundaries, avoid unseeded randomness and wall-clock time, and never log rejected actions. Kept architectural decisions consistent across SyncEngine, the whiteboard, and the game. The same determinism and dependency rules applied even when Kiro was implementing features in completely different parts of the repository.
Agent Hooks Added three automated safeguards: a PreToolUse hook to block staging secrets and local-only files; a PostFileSave hook to check files against our determinism rules; and another PostFileSave hook to run SyncEngine tests automatically. Moved important checks closer to the moment code changes happen. This helps catch accidental secret staging, violations of SyncEngine's deterministic design, and test regressions without relying entirely on someone remembering to run every check manually.
Playwright MCP Connected Kiro to real browser sessions. It could open the whiteboard and game, click and type, hold movement keys, inspect console output, and open separate tabs to simulate multiple players interacting with the applications. Let Kiro verify behavior through the same browser interfaces users interact with, rather than relying only on code inspection. We used it to test real application flows and multiplayer interactions, reducing repetitive manual testing.
Terraform MCP Used Terraform MCP to help write and refine infrastructure-as-code for Azure deployment. The infrastructure includes an Azure Static Web Apps client and an Azure Container Apps match server, with supporting resources such as Log Analytics and Terraform state storage. Extended Kiro's role beyond application code into deployment infrastructure. We could use the same agent-assisted workflow to reason about and create reproducible cloud infrastructure instead of manually configuring every resource.
Custom Agent Skills Built five reusable skills: feature-design compares alternative designs; feature-slice breaks a chosen design into implementable steps; slice-predict guides us to reason through implementation; slice-walkthrough explains completed code; and slice-qna quizzes us on the implementation. Made Kiro useful not only for building the project, but also for understanding it. The skills encouraged us to evaluate architecture, implement features in manageable slices, and learn the code rather than blindly accepting generated changes.
Property-Based Testing Used Kiro to translate correctness requirements into properties and tests using fast-check. These tests generate many inputs to check important guarantees, particularly that replaying the same event log reconstructs the same state and hashes. Tested SyncEngine's core deterministic-replay guarantee across many generated cases, rather than relying only on a handful of manually written examples. This was especially important for a framework where consistency is fundamental.

🎯 The Result

Specs gave Kiro a plan. Steering gave it architectural context. Hooks automated safeguards. MCP connected it to real applications and infrastructure. Custom skills helped us reason about and understand the code it produced.

Kiro wasn't just helping us write code faster; it helped us build a repeatable engineering workflow around planning, implementation, testing, and deployment.

🧩 Challenges We Faced

One of the biggest challenges was designing something general enough to support different applications without making it unnecessarily complicated.

A whiteboard and a multiplayer shooter have very different interaction patterns. A whiteboard needs to synchronize edits to shared objects, while a game has frequent updates where not every piece of information needs to be stored in a permanent event history.

We had to think carefully about which changes should go through the logged synchronization flow and which should use a separate, high-frequency communication path. In the game, for example, important match-state changes are handled through SyncEngine, while movement, aiming, and other high-frequency presentation updates use an ephemeral channel.

Another challenge was maintaining predictable state reconstruction. It wasn't enough to simply send updates between clients. We wanted a system where actions could be recorded, checked, and replayed to rebuild the state. Designing the event log, snapshots, and verification flow around that goal required careful separation of responsibilities.

Integrating the engine into two applications also exposed architectural decisions that might not have been obvious if we had built only one demo. Each application helped us test whether the abstractions were genuinely reusable or just convenient for a single use case.

💡 What We Learned

This project taught us that reusable infrastructure is much harder to design than application-specific functionality. An abstraction that works perfectly for one application may become a limitation when a second application starts using it.

We learned a lot about state synchronization, event-driven architectures, deterministic replay, modular software design, and the trade-offs involved in handling real-time data.

Most importantly, we learned to think beyond the immediate application. Instead of asking how to implement a particular feature, we started asking what common capability that feature depends on and whether it could become part of a reusable foundation.

🔮 What's Next?

We see SyncEngine as a starting point for building many kinds of collaborative applications — from shared workspaces and multiplayer experiences to other systems where multiple users need to interact with consistent shared state.

Our goal was not just to build a whiteboard and a game. It was to build the foundation underneath them, and show that the same engine could power both.

Built With

Share this project:

Updates

Submission history