This repository provides a terminal-based inventory management application for clocks. It leverages Rust and the ratatui crate to create an interactive, text-based user interface, crossterm for terminal handling, and serde + serde_json for data persistence.
This repository provides a terminal-based inventory management application for clocks.
Built with Rust, it uses:
- ratatui: For a rich, interactive, text-based user interface
- crossterm: For handling terminal I/O and screen manipulation
- serde + serde_json: For data serialization and persistence
The application allows you to:
- List Inventory: View all registered clocks and their quantities.
- Register Clocks: Add new clocks by specifying a code and initial quantity.
- Search: Find clocks by code, including approximate matches.
- Buy & Sell: Perform operations to add or remove quantities from the inventory.
- View History: Check an operational log (purchases, sales, and acquisitions).
- Filter History by Code: Easily filter the historical log for a specific clock code.
- Bar Chart Visualization: See a simple bar graph of sales and purchases from the last 7 days.
- Ensure Rust is installed.
- Clone the repository:
git clone https://github.com/your-username/clock-inventory.git cd clock-inventory
- Build the project:
cargo build --release
- Run the application:
cargo run --release
C
- Enter Registration mode (to add new clocks).B
- Enter Search mode.H
- Enter History mode (navigate with arrow keys, filter tabs with left/right).G
- Display the Bar Chart mode.A
- Buy/Add inventory for the selected clock.V
- Sell from the selected clock.Enter
- Select item in lists.Esc
- Return to Inventory mode, or cancel the current action.X
- Exit the application.
←/→
- Switch tabs: All, Purchases, Sales, Acquisitions.P
- Search history by code (press Enter to apply the filter).Up/Down
- Navigate within history results.
The application uses serde_json to read and write data to estoque.json
. Each inventory change (registration, purchase, sale) updates this file, ensuring that data is retained between sessions.