# ๐น Chopin CLI
[](https://github.com/kowito/chopin/actions/workflows/CI.yml)
[](https://crates.io/crates/chopin-cli)
[](https://crates.io/crates/chopin-cli)
[](https://github.com/kowito/chopin/blob/main/LICENSE)
[](https://www.rust-lang.org)
[](https://github.com/kowito/chopin)
**Scaffolding and code generation tool for the Chopin web framework.**
Generate ChopinModules following MVSR pattern (Model-View-Service-Router), manage migrations, and bootstrap new projects with sensible defaults.
## Installation
```bash
cargo install chopin-cli
```
## Quick Start
Create a new Chopin project with modular architecture:
```bash
chopin new my-app
cd my-app
cargo run
```
## Commands
### `new` โ Create a new project
```bash
chopin new my-project [--template basic|api]
```
Creates a new Chopin project with:
- Modular architecture using ChopinModule trait
- MVSR pattern (Model-View-Service-Router)
- Configured `Cargo.toml` with dependencies
- Example auth module (signup, login)
- Development SQLite database
- OpenAPI documentation setup
Templates:
- `basic` โ Minimal setup (default)
- `api` โ Full CRUD API with posts module
### `generate module` โ Scaffold a new module
```bash
chopin generate module blog
```
Generates MVSR structure:
```
src/modules/blog/
โโโ mod.rs # ChopinModule implementation
โโโ services.rs # Business logic (unit-testable)
โโโ handlers.rs # HTTP handlers
โโโ models.rs # SeaORM entities
โโโ migrations.rs # Database migrations
```
### `generate` โ Generate specific components
```bash
chopin generate service posts # Service layer
chopin generate handler posts # HTTP handler
chopin generate model post # SeaORM entity
chopin generate migration create_posts_table
```
### `db` โ Database management
```bash
chopin db migrate
chopin db reset
```
## Features
- โก Zero-configuration project setup with MVSR pattern
- ๐ฆ ChopinModule scaffolding
- ๐ Built-in authentication scaffolding
- ๐๏ธ Database migration helpers
- ๐ OpenAPI documentation
- ๐งช Testing utilities included
## Documentation
For more information, see the [main repository](https://github.com/kowito/chopin):
- [**Modular Architecture Guide**](https://github.com/kowito/chopin/blob/main/docs/modular-architecture.md) โ ChopinModule trait, MVSR pattern
- [Debugging & Logging](https://github.com/kowito/chopin/blob/main/docs/debugging-and-logging.md) โ Enable request logging
- [Example Projects](https://github.com/kowito/chopin/tree/main/chopin-examples) โ basic-api shows MVSR pattern
- [API Reference](https://docs.rs/chopin-core)
## License
WTFPL (Do What The Fuck You Want To Public License)