A desktop application for managing a "smart cabinet" for tools and equipment, built with Rust and AWS services. This application provides a secure way for authorized personnel to access and manage inventory using a login system (AWS Cognito) for password input and an inventory management system with AWS DynamoDB.
- Secure Authentication: User login is handled securely via Amazon Cognito.
- Real-time Inventory Management: Tool and equipment inventory is stored and managed in Amazon DynamoDB.
- Desktop UI: A cross-platform desktop user interface built with the Slint UI toolkit.
- Asynchronous Operations: Leverages Rust's
asynccapabilities with the Tokio runtime for non-blocking communication with AWS services.
- Programming Language: Rust
- User Interface: Slint
- Asynchronous Runtime: Tokio
- Cloud Services (AWS):
- Amazon Cognito: For user authentication and identity management.
- Amazon DynamoDB: As the database for inventory tracking.
- Serialization: Serde
- Authentication: The application starts with a login screen. Users enter their credentials, which are then verified against an Amazon Cognito User Pool.
- Inventory Display: Upon successful login, the application fetches the current inventory from a DynamoDB table and displays it in the main window.
- Inventory Actions: Users can view the status of each item (Available or In-Use), see who it's assigned to, and perform actions like checking out or returning items (users can only return items they checked out and not another users'). These actions would update the item's status in the DynamoDB table.
- Rust and Cargo installed (see rustup.rs)
- An AWS account with credentials configured on your local machine.
- A
.envfile in the project root.
-
Clone the repository:
git clone <repository-url> cd workshop-smart-cabinet
-
Set up AWS Resources:
- Amazon Cognito: Create a User Pool and a User Pool Client.
- Amazon DynamoDB: Create a table to store the inventory. The table should have a primary key (e.g.,
id) and attributes likepart_number,tool_name,status,location,assigned_to, andquantity.
-
Create a
.envfile: In the root of the project, create a file named.envand add the following, replacing the placeholder values with your AWS resource information:COGNITO_CLIENT_ID=your_cognito_client_id TABLE_NAME=your_dynamodb_table_name
Once the setup is complete, you can run the application with Cargo:
cargo runThis will compile the Slint UI, build the Rust application, and launch the smart cabinet interface.
.
├── Cargo.toml # Rust project manifest and dependencies
├── build.rs # Build script to compile the Slint UI
├── src/
│ ├── main.rs # Main application logic
│ ├── auth.rs # Authentication module (for AWS Cognito)
│ └── inventory.rs# Inventory management module (for AWS DynamoDB)
└── ui/
└── appwindow.slint # Slint UI definition

