Getting Started
Ticket is a Rails-shaped web framework written in Polar, for Polar projects. This page covers what it is, how far along it is, and what you need to try it.
What is Ticket?
If you've used Rails, most of Ticket will look familiar: resource routes, controllers with actions, views with layouts, and before-filters. What's different is that it's all Polar, so the type checker sees everything:
- Routes are a zone. A
routesblock generates the router and a typed path helper for every named route. A typo in a controller name is a compile error on the route line. - Controllers are modules of functions. Each action takes a
Connand returns aResponse. Its effects are in its signature. - Views are markup that type-checks. A
viewsblock turns JSX-style markup into functions returningHtml, with escaping built in. - No hidden state. A
Connis a value. Filters return a new one or a response, and nothing is mutated behind your back.
How far along is it?
Ticket is built in milestones. F1, request to response, is in progress: params, views, components, routing, controllers, filters and the routes task all work, and the ticket CLI is next. There is no database yet. That's F2.
Under construction: Ticket isn't published and its APIs will change between milestones. The roadmap lists what's done and what's next.
What you need
- The
polartoolchain on yourPATH. See Polar's getting started guide to build it from source. - Node.js 22.5 or newer.
- A checkout of Ticket next to your app, since apps depend on it by path for now.
$ git clone https://github.com/stepanvanzuriak/ticket
$ cd ticket
$ node scripts/test.mjs
The last command builds and runs every test project and example app, which is a quick way to check that your polar and Node versions work with Ticket.
Where next
Build a one-page app in Your First App, or jump straight to Routing if you know Rails already.