# skeld documentation
Build a service around one contract. Use it to validate incoming data, constrain outgoing data, and type the client that calls it.
If you are new to skeld, start with [Install skeld](): it takes you from `npm install @skeld/core` to a running server and a typed client call. Then follow [your first request]() in a checkout of the repository. You will run a larger example, send an invalid request, and see exactly where the contract takes effect. Neither needs an external service.
## Learn the model
```mermaid
flowchart TD
Contract["Contract
Routes and schemas"] -->|Defines| Client["Client
Typed calls
Validate replies"]
Contract -->|Defines| Server["Server
Validate input
Serialize output"]
Client -->|HTTP
request| Server
Server -->|HTTP
response| Client
```
The contract supplies both sides. HTTP still crosses a trust boundary: server validation protects the handler, and client validation checks responses for declared statuses. Sharing TypeScript types alone would establish neither property.
Read these in order, or jump to the task you are working on:
| Guide | What you will be able to do |
| ---------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| [Install skeld]() | Add the package to a new project, run one route, and call it through its contract |
| [Your first request]() | Run the hello service and distinguish validation from application behavior |
| [Design a contract]() | Choose bounds, response fields, and explicit application outcomes |
| [Call a service and handle errors]() | Narrow responses by status and separate HTTP outcomes from failed calls |
| [Organize a service]() | Give a feature its own routes, hooks, state, and cleanup |
| [Classify data]() | Keep secret and personal values out of schema-aware logs and control response exposure |
| [Connect a browser]() | Configure CORS, cross-site checks, cookies, and redirects together |
| [Run a service]() | Set the public origin, proxy trust, timeouts, logging, and shutdown behavior |
| [Troubleshoot]() | Diagnose startup failures, refused requests, missing logs, and invalid responses |
| [Add authentication]() | Declare route access, decide it with policies, and sign people in with sessions, API keys, JWTs or OpenID Connect |
| [Meet the application's obligations]() | Sign people in, change credentials and keep grants in the order auth relies on |
| [Publish an OpenAPI document]() | Generate OpenAPI 3.1.2 from a contract, describe its security and read what it cannot say |
| [Store data in PostgreSQL or SQLite]() | Query a database through tagged SQL, run transactions and migrations, and limit requests per client address |
These explanations connect the guides: [the request lifecycle]() shows when each stage runs; [security boundaries]() names what skeld enforces and what the application must supply. The [core threat model]() maps actors, data flows and trust boundaries to STRIDE threats, controls and residual responsibilities.
## Look up a detail
- [API reference](): signatures and rules generated from the public source documentation.
- [Logging](): options, delivery behavior, and limits; [record format](), [events](), [error disclosure](), and [Collector ingestion]().
- [Runnable examples](): hello, classified logging, a scoped task service, [authentication]() and [OpenAPI generation]().
- [Core behavior reference](): runtime requirements for each entry point and a compact feature reference.
- [Auth behavior reference](): `@skeld/auth` options, routes, refusals, events, store outcomes, and what is not included.
- [OpenAPI behavior reference](): `@skeld/openapi` options, mappings, limits and refusals.
- [Data behavior reference](): `@skeld/data` options, the connection URL, error codes, value tables and the limiter.
To improve skeld or its documentation, see the repository's [contribution guide]().