Project Structure
Workspace Layout
efision/
├── Cargo.toml # Workspace root
├── crates/
│ ├── core/ # efision-core: shared business logic
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── lib.rs
│ │ ├── domain/
│ │ │ ├── entities/ # Data model structs
│ │ │ │ ├── customers/
│ │ │ │ ├── products/
│ │ │ │ ├── sales/
│ │ │ │ └── warehouse/
│ │ │ ├── dtos/ # Data transfer objects
│ │ │ └── repositories/ # Repository traits
│ │ ├── infrastructure/
│ │ │ ├── config.rs # DB connection, region resolution
│ │ │ └── sqlserver/ # SQL Server implementations
│ │ │ ├── customers/
│ │ │ ├── products/
│ │ │ ├── sales/
│ │ │ └── warehouse/
│ │ └── services/ # Business logic
│ │ ├── customers/
│ │ ├── products/
│ │ ├── sales/
│ │ └── warehouse/
│ └── cli/ # efision-cli: command-line binary
│ ├── Cargo.toml
│ └── src/
│ ├── main.rs # Entry point, command routing
│ └── commands/
│ └── commands.rs # Clap command definitions
├── docs/ # Documentation source (schema, architecture)
├── docs-site/ # mdBook documentation site
├── scripts/ # Build and setup scripts
├── sheets-sync/ # Google Sheets sync tools
├── pn-references/ # Part number reference data
├── .env # Database credentials (git-ignored)
└── .env.example # Template for .env
Crate Responsibilities
efision-core
The shared library containing all business logic. Has no knowledge of CLI or any specific presentation layer.
- domain/entities/ — Rust structs mirroring SQL Server tables, with
serdederives - domain/repositories/ — Async trait definitions (the “ports”)
- infrastructure/sqlserver/ — Tiberius-based implementations (the “adapters”)
- services/ — Business logic generic over repository traits
efision-cli
The CLI binary. Depends on efision-core for all business operations.
- commands/ — Clap derive macro definitions for all CLI commands
- main.rs — Entry point, region/config resolution, command routing
Key Dependencies
| Crate | Purpose |
|---|---|
tiberius | SQL Server TDS driver |
tokio | Async runtime |
clap (derive) | CLI argument parsing |
serde + csv | Serialization and CSV export |
anyhow + thiserror | Error handling |
chrono | Date/time types |
rust_decimal | Precise decimal arithmetic |
dialoguer | Interactive CLI prompts |
owo-colors | Terminal color output |
comfy-table | Table formatting |
indicatif | Progress bars |