Contract Kit Example

A comprehensive example demonstrating all features of Contract Kit

📋 Todos Demo

Interactive todo list demonstrating:

  • Contract definitions with Zod schemas
  • React Query integration (queries & mutations)
  • React Hook Form integration
  • Type-safe API client
View Todos Demo →

📡 API Documentation

Auto-generated OpenAPI documentation from your contracts.

  • OpenAPI 3.1 spec generation
  • Automatic schema validation
  • Interactive API explorer
View OpenAPI Spec →

🏗️ Architecture

This example demonstrates:

  • Hexagonal architecture with ports
  • Use case layer (queries & commands)
  • Provider pattern for dependencies
  • In-memory database provider
  • Event bus integration
  • Structured logging with Pino

🔗 API Routes

Available API endpoints:

  • GET /api/todos - List todos
  • POST /api/todos - Create todo
  • GET /api/todos/:id - Get todo
  • PUT /api/todos/:id - Update todo
  • DELETE /api/todos/:id - Delete todo
  • GET /api/users - List users
  • GET /api/users/:id - Get user

🚀 Getting Started

This example is running with an in-memory database. All data will be reset when the server restarts. Check out the source code to see how everything is wired together: