← Back to Blog

Announcing Cossack Framework

Today we're excited to announce Cossack, a modern, full-stack TypeScript framework designed for the edge computing and AI era.

What is Cossack?

Cossack is a framework that lets you write stateful, real-time web applications with a unified syntax that runs on both the server and client. Inspired by Phoenix LiveView and .NET Blazor, it abstracts away the complexity of client-server communication.

Key Features

  • Real-time by default - WebSocket connections and state synchronization are built in
  • Edge-first - Designed for Cloudflare Workers with fast cold starts
  • TypeScript native - Full type safety with decorators and metadata
  • File-based routing - Convention over configuration with nested layouts
  • Optimistic UI - Built-in support for instant feedback on actions
  • Light DOM - Components render to Light DOM for easy global styling
  • Code splitting - Automatic server-only code stripping from client bundles
  • MDX support - Zero-configuration markdown pages with full layout support

The Architecture

Cossack uses a unique approach to state management. Instead of managing separate client and server state stores, you write a single component with decorators:

@Page({ transport: 'durable-object' })
export class Counter extends Cossack {
    @State() count = 0;

    @Server()
    increment() {
        this.count++;
    }

    render() {
        return html`
            <button @click=${this.increment}>
                Count: ${this.count}
            </button>
        `;
    }
}

When this.count++ is called on the server, the framework automatically detects the change and broadcasts the update to all connected clients. No manual state management, no API endpoints, no fetch calls.

Security First

One of our core design principles is security. The framework includes a Vite plugin that automatically strips server-only code from client bundles. Methods without decorators are treated as server-only by default, ensuring database queries, API keys, and business logic never reach the browser.

Get Started

npx create-cossack-app@latest my-cossack-app

Check out the documentation to learn more, or explore the examples to see Cossack in action.

What's Next?

This is just the beginning. We're actively working on:

  • Authentication and authorization
  • Database integration (D1, Drizzle)
  • File upload handling
  • Testing utilities
  • DevTools integration
  • Plugin ecosystem

We'd love to hear your feedback. Star us on GitHub and join the community!