dto-domain
CommunityEnforce clean DTO/Row/Domain separation in Rust.
Authoradelabdelgawad
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Three-layer architecture discipline for Rust projects to clearly separate DB rows (Row), wire DTOs (Dto), and domain invariants, preventing leakage of internal state and ensuring consistent conversions.
Core Features & Use Cases
- Enforces a three-layer pattern (Row, Dto, Domain) per entity with explicit boundaries.
- Provides conversion direction: Row → Dto via From<Row> for Dto and Dto → Domain via TryFrom<Dto> for Domain.
- Encourages newtype wrappers for IDs (e.g., UserId) and camelCase DTOs via serde.
- Integrates validation through TryFrom and optional validator crate to guard domain invariants.
- Prevents leaking sensitive fields by keeping password hashes in Row only and not in Dto.
Quick Start
Start by organizing each database entity into Row, Dto, and Domain modules and implement From<Row> for Dto and TryFrom<Dto> for Domain.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: dto-domain Download link: https://github.com/adelabdelgawad/rust-fullstack-agents/archive/main.zip#dto-domain Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 510,000+ vetted skills library on demand.