(Choose your language / Escolha seu idioma)
An interactive, modern command-line interface (CLI) application built in Rust for managing personal tasks (To-Do). It features persistent storage in a JSON file, clean architecture using the Repository pattern, advanced interactive prompts, automated CI/CD pipelines, and multi-stage Docker support.
- About the Project
- Key Features
- Architecture and Technologies
- Code Structure
- Installation and Usage
- CI/CD & Docker
- Author and License
TaskManager has been designed following best practices of production-grade Rust software engineering, focusing on high cohesion, loose coupling, and idiomatic error handling. It has evolved from a simple in-memory CLI to a professional CLI tool with durable persistence, serving as a robust portfolio showcase demonstrating traits, lifecycle tracking (timestamps using chrono), data serialization (serde), and integration tests.
- Premium Interactive UI: Replaced manual terminal inputs with rich selection menus using arrow keys via the
inquirecrate. - Persistent Storage: Automatically saves and loads tasks to/from a local
tasks.jsonfile. - Dynamic Color-Coded Statuses: Visually appealing rendering of task statuses (
Pendente,Em Andamento,Concluído) using ANSI coloring via thecoloredcrate. - Traceable Lifecycles: Real-time recording of
criada_em(created at) andatualizada_em(updated at) timestamps on every state transition. - Safe Deletions: Double-check confirmation prompts before removing tasks.
The project's architecture implements Clean Architecture patterns, divided into well-structured layers:
graph TD
A[main.rs - CLI Interface / inquire] -->|Uses| B[lib.rs - Core Library]
B --> C[repository.rs - Repository Pattern / JSON Persistence]
B --> D[task.rs - Entities & Domain Rules]
B --> E[error.rs - Idiomatic Error Handling]
| Layer / Component | Technology / Crate | Description / Usage |
|---|---|---|
| Domain Models | Rust (task.rs) |
Domain entities Task and Status with timestamps. |
| Repository Pattern | Rust (repository.rs) |
Abstraction TaskRepository and concrete JsonFileRepository implementation. |
| Error Handling | thiserror (error.rs) |
Custom typed errors represented idiomatically in Rust. |
| Interface (Frontend) | inquire & colored |
Arrow-key menu navigation and colored terminal formatting. |
| Persistence | serde & serde_json |
Serialization of Rust structures to and from JSON files. |
├── Cargo.toml
├── Dockerfile
├── tasks.json (Auto-generated)
├── .github
│ └── workflows
│ └── rust-ci.yml
└── src
├── error.rs # Custom error handling (TaskError)
├── lib.rs # Library crate module declarations
├── main.rs # Executable entry point
├── repository.rs # Repository trait & JSON file operations
└── task.rs # Domain Task & Status models
- Rust toolchain (rustup and cargo package manager) v1.75+
- Clone the repository:
git clone git@github.com:HenriqueSHA/TaskManeger.git cd TaskManeger - Run the application directly with Cargo:
cargo run
- Run the automated unit tests:
cargo test
The pipeline configured in .github/workflows/rust-ci.yml runs automatically on pushes and pull requests:
- Code formatting check (
cargo fmt --check) - Static code analysis with Rust's linter (
cargo clippy) - Test suite execution (
cargo test)
You can also package and run the application in a multi-stage Docker container, which keeps the production image extremely small:
- Build the Docker image locally:
docker build -t taskmanager:latest . - Run the application interactively via Docker:
(Note: The
docker run -it --rm -v $(pwd)/tasks.json:/app/tasks.json taskmanager:latest-vparameter bindstasks.jsonfrom the host system to persist your tasks locally)
Developed by Henrique Albergaria Santos.
Distributed under the MIT License. See LICENSE for more details.