A small Streamlit application that combines two mock spreadsheet data sources in one interface and applies role-based access control (RBAC).
data/equipment.csv— mock Spreadsheet A: AV Equipment Inventorydata/shifts.csv— mock Spreadsheet B: Staff Shift Schedulesapp.py— Streamlit UI, login, RBAC, and JSON device-command simulationtest_app.py— small tests for login roles and JSON payload generation
From this directory:
python -m venv .venvActivate the environment on macOS/Linux:
source .venv/bin/activateOr on Windows PowerShell:
.venv\Scripts\Activate.ps1Then install and run:
python -m pip install -r requirements.txt
python -m streamlit run app.pyOpen the local URL printed by Streamlit, usually http://localhost:8501.
| Role | Username | Password | Access |
|---|---|---|---|
| Technician | tech |
tech123 |
View both spreadsheets only |
| Manager | manager |
manager123 |
View both spreadsheets and trigger commands |
These credentials are intentionally hard-coded for a prototype. A production app should use an identity provider and store secrets outside source control.
- Sign in as
manager/manager123. - In Device Control, select a device and command.
- Click Trigger Device Command.
- The valid JSON payload appears directly below the button. For example:
{"command": "power_on", "device": "projector_1"}The demo only displays the payload; it does not contact a real AV device. When signed in as the technician, the entire command form is hidden and only a view-only notice is shown.
python -m pytest -q