Skip to content

DominicNyabuto/Workshop-Smart-Cabinet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Workshop Smart Cabinet

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.

Features

  • 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 async capabilities with the Tokio runtime for non-blocking communication with AWS services.

Tech Stack

  • Programming Language: Rust
  • User Interface: Slint
  • Asynchronous Runtime: Tokio
  • Cloud Services (AWS):
  • Serialization: Serde

How It Works

  1. Authentication: The application starts with a login screen. Users enter their credentials, which are then verified against an Amazon Cognito User Pool.
  2. Inventory Display: Upon successful login, the application fetches the current inventory from a DynamoDB table and displays it in the main window.
  3. 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.

Login Screen: Login Screen

Inventory View: Inventory View

Getting Started

Prerequisites

  • Rust and Cargo installed (see rustup.rs)
  • An AWS account with credentials configured on your local machine.
  • A .env file in the project root.

Setup

  1. Clone the repository:

    git clone <repository-url>
    cd workshop-smart-cabinet
  2. 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 like part_number, tool_name, status, location, assigned_to, and quantity.
  3. Create a .env file: In the root of the project, create a file named .env and 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
    

Running the Application

Once the setup is complete, you can run the application with Cargo:

cargo run

This will compile the Slint UI, build the Rust application, and launch the smart cabinet interface.

Project Structure

.
├── 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

About

A desktop application for managing a "smart cabinet" for tools and equipment, built with Rust and AWS services - provides a secure way for authorized personnel to access and manage inventory using a login system (AWS Cognito) for authentication and an inventory management system with AWS DynamoDB.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors