oss-slu / esp

MIT License
0 stars 5 forks source link

Issue95 - Sprint 4 - Added more functionality to one-click startup script #96

Closed Lyskawa-Aonyx closed 3 weeks ago

Lyskawa-Aonyx commented 1 month ago

Fixes #95

What was changed? -Removed esp.sh integration with ESP.app. Added that functionality directly into the ESP.app script. -Added functions in ESP.app to check for "docker compose up" completion before opening the user's browser. -Added functionality to safely close the application in one click. It runs "docker compose down --rmi all" to close and delete all docker containers and images associated with the program, and then safely closes docker.

Here, describe what part of the application you changed (e.g. login page, database, etc.). If possible, mention what specific components were added, removed, or modified. -I changed the start up functionality of the program as well as the close functionality. I believe this is the front-end.

Why was it changed? -It was changed to allow for easier use by the end user; someone who is unfamiliar with the command line, docker, and the terminal.

Here, describe the issue that you are fixing with this code, and why your code fixes it. -esp.sh was redundant and I implemented its functions into the existing script file, ESP.app. -ESP.app had no way of safely closing the program, so now it closes the program while also deleting the docker containers and images.

Here, get into detail about what files you modified, and talk about the most important lines in regards to fixing the issue. -ESP.app was the file that was changed, specifically ESP.app/contents/resources/scripts/main.scpt.

-Line "set userResponse to display dialog "Press the X to close the ESP app" buttons {"X"} default button "X" giving up after 0" is very important as this opens up the option for the user to safely close the program in one click. -Removed esp.sh file from repo.

Screenshots that show the changes (if applicable):

Lyskawa-Aonyx commented 1 month ago

All binary files included in this PR are necessary for ESP.app to function properly. They are created during the Apple Script compilation process.

kate-holdener commented 1 month ago

Fixes #issue_number

@Lyskawa-Aonyx please edit your PR providing the issue number (don't leave it as issue_number)

kate-holdener commented 1 month ago

@Lyskawa-Aonyx @SiriChandanaGarimella This seems like a complicated solution. It's unclear how the client be able to run the code using this solution. Here's an alternate solutions to a similar problem that another team is working on: https://github.com/oss-slu/bubble_scan/issues/108

Lyskawa-Aonyx commented 1 month ago

@Lyskawa-Aonyx @SiriChandanaGarimella This seems like a complicated solution. It's unclear how the client be able to run the code using this solution. Here's an alternate solutions to a similar problem that another team is working on: oss-slu/bubble_scan#108

I believe this solution isn't the final one. It was meant to be a temporary stop-gap to allow the professor and anyone testing the code to more easily run/close the program and all dependencies. If the user is on a Mac, (which our Professor is), the ESP.app/contents will appear as an application the user should just be able to double click on and run the program.

SiriChandanaGarimella commented 1 month ago

@kate-holdener - Electron is a great option for desktop applications, but implementing it would require version management and new builds each time we share updates with the client. Instead, we're using AppleScript as a temporary solution. As @Lyskawa-Aonyx mentioned, this allows our client to run the application on their Mac machine with a single click rather than manually running the 'docker-compose up' command and opening the browser. AppleScript is lightweight and requires no additional setup - it simply runs the docker-compose without the need for builds or version management. This works well as a temporary solution until we move to cloud deployment.

If you'd prefer a more robust solution before cloud deployment, we can implement Electron.

Screenshot of how it appears as an application in File Explorer:

image
SiriChandanaGarimella commented 4 weeks ago

@Lyskawa-Aonyx - Great work! This looks clean and is working fine on Mac. Can you please update the issue number in the PR description from 'Fixes Issue 95' to 'Fixes #95'?

SiriChandanaGarimella commented 3 weeks ago

@Lyskawa-Aonyx - I've updated the issue number in the PR description. For future PRs, please make sure the issue number is provided in the format 'Fixes #issue_number' rather than 'Fixes Issue issue_number.'