Cossack Documentation

Welcome to the Cossack framework documentation. Cossack is a modern, full-stack TypeScript framework designed for the edge computing and AI era, inspired by Phoenix LiveView and .NET Blazor.

Quick Start

Create a new Cossack project in seconds:

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

Choose between Cloudflare Workers (default) or Node.js adapter during setup.

Core Concepts

  • File-Based Routing - No configuration needed. Your src/pages directory structure defines your routes.
  • Real-Time State - @State properties automatically synchronize between server and client.
  • Server Actions - @Server methods run on the server, with client proxies handled automatically.
  • Optimistic UI - @Optimistic decorators give instant feedback before the server responds.
  • Light DOM Components - Class-based components that render to Light DOM for easy styling.
  • Code Splitting - Automatic server-only code stripping keeps your client bundle lean and secure.

Architecture Overview

src/
├── App.ts                    # Global app component
├── pages/
│   ├── layout.ts             # Root layout (nav + footer)
│   ├── index/index.ts        # Home page (/)
│   ├── about/index.ts        # About page (/about)
│   ├── dashboard/
│   │   ├── layout.ts         # Dashboard layout
│   │   └── index.ts          # Dashboard page (/dashboard)
│   └── blog/
│       ├── index.mdx         # Blog listing (/blog)
│       └── hello/index.mdx   # Blog post (/blog/hello)
└── components/
    └── Button.ts             # Reusable component

Next Steps