Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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 serde derives
  • 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

CratePurpose
tiberiusSQL Server TDS driver
tokioAsync runtime
clap (derive)CLI argument parsing
serde + csvSerialization and CSV export
anyhow + thiserrorError handling
chronoDate/time types
rust_decimalPrecise decimal arithmetic
dialoguerInteractive CLI prompts
owo-colorsTerminal color output
comfy-tableTable formatting
indicatifProgress bars