Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backend improvements and add support for Google Sheet #3

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

honeytung
Copy link
Member

This PR Adds a couple of new features based on user feedback.

Backend Features:

  • New service GoogleAPIService that can call Google Sheet to get the part number and its corresponding weld counts
  • Hashed password to allow only supervisor to lock/unlock the Jig Lock
  • Basic progress/stats table in the end of the welding process that shows the number of parts completed for this shift (currently does not persist when shift ends)

Frontend Features:

  • Allow user to select part number from the database and prefilled the weld counts automatically
  • Allow user to enter part number and weld counts manually
  • Password entry page
  • Stats table at the end of the welding process

How to Review

The following files contains most of the changes to support the features mentioned above:

  • backend.py and config.py: contains all the backend logic and configuration settings
  • generate_hash.py: contains a CLI tool for generating hashed password which is used for generating a new supervisor password.
  • README.md: contains updated instructions, including a new configuration setting that needs to be configured to provide database support

UI testing can be done by cloning the repo and running the application on the local machine with poetry:

poetry run python run.py

The app can be accessed via 127.0.0.1:8000 (Note: GPIO will be disabled due to incompatible architecture)

Additionally, the app can be installed via GL Hub by specifying this repo URL.

Next Steps

  • Add CICD (Unit Tests, Deployments, ...etc)
  • Add Stacklight Logic
  • Code Cleanup

UI Previews

Screenshot 2024-12-23 at 3 53 49 PM

Screenshot 2024-12-23 at 3 54 07 PM

Screenshot 2024-12-23 at 3 50 58 PM

@honeytung honeytung changed the title Backend improvements and Add Google Sheet Support Backend improvements and add support for Google Sheet Dec 24, 2024
@honeytung honeytung marked this pull request as ready for review December 24, 2024 00:18
Copy link

@brandon-groundlight brandon-groundlight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks reasonable, and I don't want to block development while I'm out

export WELD_APP_SUPERVISOR_PASSWORD="HASHED_PASSWORD"
```

For balena deployment just copy the hashed password into the `Device Variables` tab.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is going to be awkward, since we'll need to have them send their desired password, or choose a password for them. Either way involves some password handoff which tends to be an awkward business

@@ -13,6 +13,8 @@ opencv-python = "4.9.0.80"
flask = "^3.1.0"
numpy = "1.26.4"
rpi-gpio = { version = "^0.7.1", markers = "sys_platform == 'linux' and (platform_machine == 'armv7l' or platform_machine == 'aarch64')" }
bcrypt = "^4.2.1"
google-api-python-client = "^2.156.0"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you write a bit more about what we're doing when we connect to google sheets? Is the sheet something the user owns? Do we have any guarantees on its structure?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants