The config file
Use seampact.config.yaml (an app’s config) to tell seampact where your contracts are, what to generate and what to check. Run the commands in the app folder. This page shows the three keys you set first; every key is in the Config reference.
Where the config lives
Section titled “Where the config lives”Put seampact.config.yaml in the root of your app, next to its build file: package.json, build.gradle.kts or pom.xml, composer.json or pyproject.toml. Every path in it is relative to that file. The command reads it from the folder you run it in.
Choose the generated folder
Section titled “Choose the generated folder”outDir is the one folder for all generated code. Without it, seampact writes to __generated__ beside the config.
outDir: src/__generated__Each target writes to a subfolder named after its id. Set out on a target to rename it. Each stack uses its own folder: see Generated files.
Point to a contract
Section titled “Point to a contract”A source is a name and a place. A local folder:
sources: notes: path: ./contractnotes here is the name of the source. A target’s apis lists api names, the name: under api: in the contract. In this guide both are notes.
A contract published by another team, pinned to a version (see sharing contracts). integrity is optional and starts with sha256-.
sources: notes: package: "@acme/notes-contract" version: 1.2.0 integrity: sha256-...Generated files
Section titled “Generated files”Where the files go, whether you commit them and who runs generate depends on the stack.
| Stack | outDir |
Commit it? | Who runs generate |
|---|---|---|---|
| Node servers and clients | src/__generated__ |
Yes | You, or a script: seampact generate |
| Spring Boot, Gradle | A folder under build/, such as build/generated/sources/seampact/main |
No | The build: ./gradlew build |
| Spring Boot, Maven | target/generated-sources/seampact |
No | The build: ./mvnw verify |
| Laravel | app/Generated |
Yes | You: vendor/bin/seampact generate |
| Symfony | src/Generated |
Yes | You: vendor/bin/seampact generate |
| FastAPI, Django REST Framework, Django Ninja | generated |
Yes | You: seampact generate |
A folder you commit is the one seampact check compares with the contract in CI: Check in CI. Never edit it by hand. The Gradle check skips an outDir under build/, since nobody commits it. outDir is __generated__ when you do not set it.
The entry of your stack
Section titled “The entry of your stack”A Node entry lists the apis in apis: [notes]. Every other entry names one api in api: notes and has no link.
| Stack | use |
Apis |
|---|---|---|
| NestJS, Express, Fastify, Hono, AdonisJS | "@seampact/codegen-nestjs", -express, -fastify, -hono, -adonis |
apis: [notes] |
| Spring Boot | io.github.jubasse:seampact-spring-boot |
api: notes |
| Laravel | seampact/laravel |
api: notes |
| Symfony | seampact/symfony |
api: notes |
| FastAPI, DRF, Ninja | pypi:seampact-fastapi, pypi:seampact-drf, pypi:seampact-ninja |
api: notes |
The full entry of each server is in its guide: server guides.
A full example
Section titled “A full example”outDir: src/__generated__sources: notes: path: ./contracttargets: - { id: server, use: "@seampact/codegen-nestjs", apis: [notes] }checks: generated: error- Next: Targets and links.
- Every key: Config reference. Also: validators, OpenAPI and docs, checks, monorepo.