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-appChoose between Cloudflare Workers (default) or Node.js adapter during setup.
Core Concepts
- File-Based Routing - No configuration needed. Your
src/pagesdirectory structure defines your routes. - Real-Time State -
@Stateproperties automatically synchronize between server and client. - Server Actions -
@Servermethods run on the server, with client proxies handled automatically. - Optimistic UI -
@Optimisticdecorators 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 componentNext Steps
- Installation Guide - Set up a new project
- Routing - Understand file-based routing
- State Management - Learn about state synchronization
- Components - Build reusable UI components