-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
feat: render save service keys on web app ui #135
Merged
srbhr
merged 5 commits into
srbhr:resume-matcher-fullstack-webapp
from
Sayvai:resume-matcher-fullstack-webapp
Sep 10, 2023
Merged
feat: render save service keys on web app ui #135
srbhr
merged 5 commits into
srbhr:resume-matcher-fullstack-webapp
from
Sayvai:resume-matcher-fullstack-webapp
Sep 10, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Implemented new feature to allow users to view the required configurable service keys (and urls) to set, on the web app UI. The configurable required service keys data is dynamically derived from the backend master YAML config file (located in `/scripts/similarity/config.yml`), and its actual pre-saved secret key values derived from a localised programatically created git-ignored YAML secrets config file (located in `/scripts/similarity/config.local.yml`). Whenever a key is no longer required by the app, then it is safe to remove key from the master config file, and in turn this key and any pre-saved secret value will no longer render on the web UI. If a secret has yet to be set for any of the required keys, then the value will fallback to the default placeholder value defined in the master YAML config.
Add error handling on the backend api for when `similarity/config.yaml` does not exist, to which it responds with a 404 not found response. As a result, also added error handling on the frontend ui code to handle the above 404 backend api response edge case to not render the Service Keys ui section.
245333a
to
0830d6b
Compare
Logically abstracted out and renamed `Hero` component to its own folder, and corrected / renamed component filename.
d58ad84
to
8216e49
Compare
Pulled a bugfix for `requirements.txt` file from upstream fork origin repo main branch, which broke the webapp backend server run. Root cause was that the qdrant-client dependency was set with a specific version; `qdrant-client>=1.1.1`, but the upstream reversion fix; `qdrant-client` without explicitly specifying a version resolved the webapp backend server run issue.
8216e49
to
60b70b0
Compare
srbhr
approved these changes
Sep 10, 2023
srbhr
added a commit
that referenced
this pull request
Sep 16, 2023
* feat: add full stack web app Adds in a nextjs and fastapi webapp (experimental) * feat: render save service keys on web app ui (#135) * feat: render save service keys on web app ui Implemented new feature to allow users to view the required configurable service keys (and urls) to set, on the web app UI. The configurable required service keys data is dynamically derived from the backend master YAML config file (located in `/scripts/similarity/config.yml`), and its actual pre-saved secret key values derived from a localised programatically created git-ignored YAML secrets config file (located in `/scripts/similarity/config.local.yml`). Whenever a key is no longer required by the app, then it is safe to remove key from the master config file, and in turn this key and any pre-saved secret value will no longer render on the web UI. If a secret has yet to be set for any of the required keys, then the value will fallback to the default placeholder value defined in the master YAML config. * chore: update next.js version and dependencies * chore: error handling for missing keys config file Add error handling on the backend api for when `similarity/config.yaml` does not exist, to which it responds with a 404 not found response. As a result, also added error handling on the frontend ui code to handle the above 404 backend api response edge case to not render the Service Keys ui section. * chore: ui refactor resume.tsx to hero.tsx Logically abstracted out and renamed `Hero` component to its own folder, and corrected / renamed component filename. * chore: sync requirements.txt from upstream Pulled a bugfix for `requirements.txt` file from upstream fork origin repo main branch, which broke the webapp backend server run. Root cause was that the qdrant-client dependency was set with a specific version; `qdrant-client>=1.1.1`, but the upstream reversion fix; `qdrant-client` without explicitly specifying a version resolved the webapp backend server run issue. * chore: add debug troubleshooting steps to webapp readme (#141) This change is to add new sections labelled `Debugging` and `Troubleshooting` to the `webapp/README.md` file. The debugging section guides users on how to run the FastAPI backend server in VS Codes' debug mode, along with running the frontend server in isolation. The troubleshooting section currently highlights one potential common issue that users may encounter when only running the frontend server in isolation (e.g. `npm run next-dev`). --------- Co-authored-by: Sayvai <sayvai@hotmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Render and Save Third Party Service Keys (API Keys and URL) on Web App UI
Description
There is a requirement to allow users to securely enter and save third-party service keys (and URLs) to be able to work with the overall app (once the backend scripts are later to be completed).
Implemented new feature to allow users to view the required configurable service keys (and urls) to set, on the web app UI.
The configurable required service keys data is dynamically derived from the backend master YAML config file (located in
/scripts/similarity/config.yml
), and its actual pre-saved secret key values derived from a localised programatically created git-ignored YAML secrets config file (located in/scripts/similarity/config.local.yml
).Whenever a key is no longer required by the app, then it is safe to remove key from the master config file, and in turn this key and any pre-saved secret value will no longer render on the web UI.
If a secret has yet to be set for any of the required keys, then the value will fallback to the default placeholder value defined in the master YAML config.
Related Issue
N/A
Type
Proposed Changes
GET /api/service-keys/
) to dynamically retrieve required service keys, as derived from the master YAML config file/scripts/similarity/config.yml
, and replace placeholder service key values with actual secrets from localised git-ignored secrets YAML config file/scripts/similarity/config.local.yml
.PUT /api/service-keys/
) to dynamically update the service keys with new values, which writes to the new secrets to the localised git-ignored secrets YAML config file/scripts/similarity/config.local.yml
.*.local.yml
to.gitignore
file to ignore programmatically created YAML file which will pre-save the secrets.webapp/README.md
with update to supported and tested Python version (3.11.5
).package.json
file by replacingpip3
andpython3
withpip
andpython
commands respectively.environment.ts
to handle retrieving frontend environment and host URL information.service-keys.ts
to add frontend typings for the third-party service keys.Screenshots / Code Snippets (if applicable)
Annotated GIF demo of the new feature, showcasing the third-party service keys UI and backend secrets yaml config being created, and holding the secrets, while the master YAML config is safely left untouched.
How to Test
Checklist
Additional Information
/scripts/similarity/config.local.yml
, then any pre-existing Python project scripts which referenced to/scripts/similarity/config.yml
to previously retrieve hardcoded secrets, should be refactored to check for existence of saved user secrets from secrets YAML config file/scripts/similarity/config.local.yml
to programmatically retrieve secrets from there instead, otherwise fallback to master YAML config file/scripts/similarity/config.yml
.