Hey everyone,
I'm thrilled to announce the release of my Rust Inventory Management System! š
I am using Rust Version 1.77.1 and Cursive Version 0.21.1
For those of you who donāt know me, Iām Amir, a software developer and content creator with a passion for programming, especially in systems languages like Rust. Over the past few weeks, Iāve been working on a simple yet powerful inventory management application that uses Rust and the Cursive library to create a smooth text-based user experience.
Rust is an incredible language known for its speed, safety, and memory managementāmaking it perfect for building robust applications. By integrating the Cursive crate, we can create a beautiful text user interface (TUI) right in the terminal, which is essential for managing our inventory effectively.
Key Features:
- Add Products: Easily add products with essential details like type, quantity, price per unit, sales tax, and total price.
- View Inventory: Get a comprehensive list of all inventory items along with calculated sales tax and total prices.
- Delete by ID: Quickly remove any product from your inventory.
-
Persistent Storage: All your data is saved in
inventory.json
, ensuring your products are retained between sessions.
Technologies Used:
- Rust: For application logic and data handling.
- Cursive: To build a user-friendly text-based UI.
- Serde: For seamless JSON serialization and deserialization (pronounced "sir-dee").
- Arc and Mutex: Ensuring safe, thread-safe shared ownership.
Getting Started:
Hereās how to set it up:
Clone the Repository and run the app:
git clone https://github.com/BekBrace/inv-tui-rust
cd inv-tui-rust
cargo run
Usage Guide
The app provides a straightforward interface for inventory management. Hereās how to use it:
- Add Product: Enter the product details and watch sales tax and total price calculate automatically.
- Show All: View all inventory items along with their details.
- Delete by ID: Simply enter the ID of the product you want to remove.
- Quit: Exit the application gracefully.
Code Structure
- Product Struct: Defines the product attributes like type, quantity, price per unit, sales tax, and total price.
-
File Operations: Manages JSON serialization/deserialization for saving/loading data from
inventory.json
. - Cursive UI: Handles all user interactions for efficient product management.
I canāt wait for you to try it out! If you will, please let me know your thoughts. Your feedback helps me improve upon those apps I create and adds collective value to everyone.
Thank you š
Best,
Amir
Top comments (0)