Puerto
Puerto is a Rust CLI that scaffolds DDD backends following Clean Architecture (Hexagonal / Ports &
Adapters): a workspace with one crate per context and layer, a poem-openapi REST API, dependency
injection generated from a manifest, and tests for every layer. What it generates is written in
Spanish (RepositorioProducto, crear_producto, /productos). Website and docs:
https://puerto-rs.vercel.app.
Install
--locked builds with the dependency versions Puerto was tested with; without it, cargo may pick
newer transitive dependencies that require a newer Rust than yours.
Quick start
Commands
|||
Field syntax: nombre:String, precio:i64! (unique), nota:opt:String, etiquetas:vec:String,
nombre:Nombre:String (value object), estado:Estado:enum:Activo/Archivado, email:Email
(shared VO), cliente_id:ref:Cliente (a reference).
What every generated project gets
- One crate per context and layer:
contextos/<c>/{dominio,aplicacion,infraestructura,rest}(dominio_<c>,aplicacion_<c>,infra_<c>,rest_<c>),nucleofor shared value objects,presentacion/{cableado,api}— Cargo enforces that dependencies point inward only puerto.tomlas the source of truth;presentacion/cableadoandpresentacion/api/src/generado/bootstrap.rswired from it- Unit tests per use case, Object Mothers,
mockalldoubles; Postgres integration tests with--db GET /health,GET /health/ready(pings the database), graceful shutdown on SIGTERM- Error bodies
{ codigo, mensaje }with a machine-readable code (producto.no_encontrado); validation is422 - Logging through
tracing; a pinned toolchain (rust-toolchain.toml), edition 2024 AGENTS.md+CLAUDE.mdinstructions for coding agents- A
make lint(clippy-D warnings) that passes out of the box
License
MIT