| Crates.io | cargo-smith |
| lib.rs | cargo-smith |
| version | 0.3.0 |
| created_at | 2025-12-04 23:20:00.440929+00 |
| updated_at | 2025-12-04 23:20:00.440929+00 |
| description | NestJS-inspired code generator for Rust web applications |
| homepage | |
| repository | https://github.com/Hero472/cargo-smith |
| max_upload_size | |
| id | 1967296 |
| size | 115,019 |
A powerful CLI tool for quickly scaffolding new Actix Web projects with production-ready structure and best practices.
This tool aims to become the NestJS of the Rust world - a comprehensive framework and CLI for building efficient, scalable, and maintainable backend systems with Rust. We're building more than just a project generator; we're creating a complete ecosystem for backend development.
cargo-mold new my-app - done in secondscargo install cargo-mold
# Create a new Actix Web project
cargo-mold new my-awesome-project
# Generate a CRUD resource (users, products, etc.)
cargo-mold generate resource users
cargo-mold g resource users
# See all available commands
cargo-mold --help
my-project/
├── Cargo.toml
├── .cargo-mold
├── .env.example
└── src/
├── main.rs
├── lib.rs
├── routes/
│ ├── mod.rs
│ ├── routes.rs
│ └── user_routes.rs # Generated with resource command
├── handlers/
│ ├── mod.rs
│ ├── handlers.rs
│ └── user_handlers.rs # Generated with resource command
├── models/
│ ├── mod.rs
│ ├── models.rs
│ └── user.rs # Generated with resource command
├── server/
│ ├── mod.rs
│ └── server.rs
└── utils/
└── mod.rs
# Generate a new project
cargo-mold new my-web-app
# Navigate to your new project
cd my-web-app
# Run the server
cargo run
# Visit http://127.0.0.1:8080/api/hello to see it working!
Create complete CRUD APIs in seconds:
# Generate a users resource with full CRUD operations
cargo mold generate resource users
# This creates:
# - Model (src/models/user.rs)
# - Handlers (src/handlers/user_handlers.rs)
# - Routes (src/routes/user_routes.rs)
# - Automatic route registration
# Available endpoints:
# GET /api/users
# POST /api/users
# GET /api/users/{id}
# PUT /api/users/{id}
# DELETE /api/users/{id}
Built-in authentication system:
use cargo_mold::auth::AuthService;
use cargo_mold::jwt::JwtMiddleware;
// Create auth service
let auth_service = AuthService::new("secret".to_string());
// Create JWT middleware
let jwt_middleware = JwtMiddleware::new("secret".to_string());
// Use in Actix Web app
App::new()
.wrap(jwt_middleware)
.route("/protected", web::get().to(protected_handler))
This is just the beginning! We're building a comprehensive backend framework that combines Rust's performance with developer experience excellence. Your feedback and contributions will help shape the future of backend development in Rust.
See CHANGELOG.md for what's new in each version.
MIT