From 70be95f6deb9abb71806623c117de961b45bd077 Mon Sep 17 00:00:00 2001 From: Maneesh-Relanto Date: Tue, 3 Feb 2026 02:02:15 +0530 Subject: [PATCH] feat: Prepare Streamlit UI for cloud deployment - Update requirements.txt to install RBAC library from repo - Add .streamlit/config.toml for theming and configuration - Add DEPLOYMENT.md with step-by-step deployment guide - Ready for Streamlit Community Cloud deployment --- .../01-streamlit-ui/.streamlit/config.toml | 15 ++++ test-apps/01-streamlit-ui/DEPLOYMENT.md | 85 +++++++++++++++++++ test-apps/01-streamlit-ui/requirements.txt | 1 + 3 files changed, 101 insertions(+) create mode 100644 test-apps/01-streamlit-ui/.streamlit/config.toml create mode 100644 test-apps/01-streamlit-ui/DEPLOYMENT.md diff --git a/test-apps/01-streamlit-ui/.streamlit/config.toml b/test-apps/01-streamlit-ui/.streamlit/config.toml new file mode 100644 index 0000000..5d52ef0 --- /dev/null +++ b/test-apps/01-streamlit-ui/.streamlit/config.toml @@ -0,0 +1,15 @@ +[theme] +primaryColor = "#1f77b4" +backgroundColor = "#ffffff" +secondaryBackgroundColor = "#f0f2f6" +textColor = "#262730" +font = "sans serif" + +[server] +headless = true +port = 8501 +enableCORS = false +enableXsrfProtection = true + +[browser] +gatherUsageStats = false diff --git a/test-apps/01-streamlit-ui/DEPLOYMENT.md b/test-apps/01-streamlit-ui/DEPLOYMENT.md new file mode 100644 index 0000000..b4363cc --- /dev/null +++ b/test-apps/01-streamlit-ui/DEPLOYMENT.md @@ -0,0 +1,85 @@ +# Streamlit UI Deployment Guide + +## 🚀 Deploy to Streamlit Community Cloud + +This interactive RBAC Algorithm validator is ready to deploy! + +### Quick Deploy Steps + +1. **Visit Streamlit Cloud** + - Go to https://share.streamlit.io + - Sign in with your GitHub account + +2. **Create New App** + - Click "New app" button + - Repository: `Maneesh-Relanto/RBAC-algorithm` + - Branch: `main` (or your preferred branch) + - Main file path: `test-apps/01-streamlit-ui/app.py` + - App URL: Choose your custom subdomain + +3. **Deploy** + - Click "Deploy" + - Wait 2-3 minutes for initial deployment + - Your app will be live at: `https://[your-app-name].streamlit.app` + +### Files for Deployment + +✅ `app.py` - Main Streamlit application (722 lines) +✅ `requirements.txt` - Dependencies (streamlit + rbac library) +✅ `.streamlit/config.toml` - Configuration and theming +✅ `README.md` - Documentation + +### What Users Can Do + +- 👥 Create and manage users +- 🔑 Create and assign roles +- 🛡️ Define permissions and test authorization +- 📊 View permissions matrix +- 🔍 Real-time RBAC validation +- 🎯 Interactive testing without any data persistence + +### Security Notes + +- ✅ **Safe**: In-memory storage only (resets on refresh) +- ✅ **No Authentication**: Public demo, no login required +- ✅ **No Data Storage**: All changes are temporary +- ✅ **Read-only Library**: Uses RBAC library in demo mode + +### Post-Deployment + +1. **Add to GitHub Pages** + ```html + + 🚀 Try Interactive Demo + + ``` + +2. **Add to README.md** + ```markdown + ## 🎮 Live Demo + + Try the interactive RBAC validator: [Launch Demo](https://your-app.streamlit.app) + ``` + +3. **Share URL** + - Update documentation with live demo link + - Add badge to README + - Include in PyPI package description + +### Monitoring + +- **Streamlit Cloud Dashboard**: Monitor app health and usage +- **Logs**: View real-time logs in Streamlit Cloud console +- **Analytics**: Track visitor count and usage patterns + +### Updating + +- Push changes to GitHub +- Streamlit Cloud auto-deploys from the branch +- Changes go live automatically after push + +--- + +**Need Help?** +- Streamlit Docs: https://docs.streamlit.io/streamlit-community-cloud +- Support: https://discuss.streamlit.io diff --git a/test-apps/01-streamlit-ui/requirements.txt b/test-apps/01-streamlit-ui/requirements.txt index 77e2882..fbf2dfd 100644 --- a/test-apps/01-streamlit-ui/requirements.txt +++ b/test-apps/01-streamlit-ui/requirements.txt @@ -1 +1,2 @@ streamlit>=1.28.0 +../.. # Install the RBAC library from the repository root