OSS-first docs
These docs teach the open system first: contracts, generated surfaces, runtimes, governance, and incremental adoption. Studio shows up as the operating layer on top, not as the source of truth.
Installation
Add ContractSpec to your existing Next.js or Bun project, or start fresh.
Prerequisites
- Node.js 20+ (or Bun 1.0+)
- Existing Next.js app or Bun HTTP server
- PostgreSQL database (for persistence)
Install Core Libraries
Add the contracts runtime and your choice of adapter:
bun add @contractspec/lib.contracts-spec @contractspec/lib.schemaFor Next.js projects
bun add @contractspec/lib.contracts-specFor database models
bun add @contractspec/app.cli-database prisma @prisma/clientSet up your project
Initialize a new ContractSpec project structure:
bunx contractspec init
# Follow the interactive prompts to configure your projectInitialize the database
If using Prisma, set up your schema and generate the client:
bunx prisma init
# Edit prisma/schema.prisma with your models
bunx prisma generate
bunx prisma migrate dev --name initStart here
The fastest path from install to your first contract and generated surface.
Hello world
Define a first operation, generate the surface, and verify the end-to-end loop.
Why ContractSpec
Keep educational and comparison content reachable without letting it define the primary OSS learning path.