01 · Challenge
A shared generation capability should work in both a direct web interface and team chat without duplicating logic or exposing platform tokens.
Secure interface · Slack events · Hugging Face
A credential-safe Gradio and Slack bot notebook with event handling, Hugging Face text generation, output formatting, and secret-store guidance instead of hard-coded tokens.

Case study brief
01 · Challenge
A shared generation capability should work in both a direct web interface and team chat without duplicating logic or exposing platform tokens.
02 · Response
I rebuilt the notebook around one reply engine used by Gradio and Slack event handlers, with Hugging Face generation and secrets loaded from the environment or Colab Secrets.
System anatomy
The architecture is expressed as responsibilities and boundaries so the model, workflow logic, interfaces, and human controls remain inspectable.
Gradio provides a direct interface for local text-generation tests
Slack event input is validated and mapped to the same generation function
Secrets remain outside source code and formatted replies return to the correct channel
Implementation
Created a direct Gradio interaction path for local testing.
Mapped Slack app mentions and direct messages to the same generation function.
Formatted replies for the correct channel and included safe error behavior.
Removed embedded live credentials and documented token rotation and secret storage.
Evidence & validation
Credential-safe executed notebook.
Slack event-handling code and Gradio output evidence.
README guidance, screenshot, and professional project post.
Reflection
Sharing a small, testable core function across interfaces improves consistency and makes security corrections easier to apply.
Next iteration
Outcomes
Secure replacement for previously embedded Slack tokens
Executable notebook with Gradio and Slack paths
Documented event handling and professional project evidence