Add initial project structure with configuration, printing, and routing functionality

- Created a new Rust project with Cargo configuration.
- Added `.gitignore` to exclude target directory.
- Implemented `Cargo.lock` for dependency management.
- Defined application configuration in `config/app.yaml` and `src/config.rs`.
- Developed printing logic in `src/printer.rs` using `cups_rs` for printer interactions.
- Established routing and request handling in `src/routes.rs` for health checks and print requests.
- Introduced a scheduler in `src/scheduler.rs` to manage print job distribution.
- Created models for print parameters and job responses in `src/models.rs`.
- Set up the main application entry point in `src/main.rs` with server initialization and configuration loading.
- Included necessary dependencies in `Cargo.toml` for async handling, tracing, and configuration management.
This commit is contained in:
2025-12-11 19:50:03 +08:00
commit 2f1bdac921
10 changed files with 2980 additions and 0 deletions

21
Cargo.toml Normal file
View File

@@ -0,0 +1,21 @@
[package]
name = "print-backend"
version = "0.1.0"
edition = "2024"
[dependencies]
anyhow = "1"
async-trait = "0.1"
axum = { version = "0.7", features = ["multipart", "json"] }
base64 = "0.21"
config = { version = "0.14", default-features = false, features = ["yaml"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde_yaml = "0.9"
thiserror = "1"
tokio = { version = "1", features = ["macros", "rt-multi-thread", "fs", "signal", "net"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["fmt", "env-filter"] }
tower-http = { version = "0.5", features = ["trace"] }
cups_rs = "0.3"
tempfile = "3"