Sistema MRP uses two configuration mechanisms: Streamlit secrets (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ElthonJohan/Sistema-MRP/llms.txt
Use this file to discover all available pages before exploring further.
.streamlit/secrets.toml) for deployed environments, and a .env file for local development. Both set the same DATABASE_URL variable — the application checks Streamlit secrets first and falls back to the environment variable loaded from .env.
Database URL
database.py resolves the database connection string using the following priority order:
st.secrets["DATABASE_URL"]— checked first; available in Streamlit Cloud and any deployment that provides Streamlit secrets.- The
DATABASE_URLenvironment variable loaded from a.envfile viapython-dotenv.
ValueError at startup and will not run.
Streamlit secrets always take priority over
.env. If you set DATABASE_URL in both places, the value in .streamlit/secrets.toml wins.Setting DATABASE_URL in a .env file
Create a .env file in the project root (next to app.py):
- SQLite (local development)
- PostgreSQL (production)
.env
mrp.db) is created in the project root the first time init_db.py runs. No server or additional software is required.Setting DATABASE_URL in Streamlit secrets
For Streamlit Cloud deployments, add the variable in your app’s Secrets settings, or create.streamlit/secrets.toml locally:
.streamlit/secrets.toml
PostgreSQL connection pool
When theDATABASE_URL starts with postgresql, database.py creates the SQLAlchemy engine with the following settings:
database.py
sslmode=require is enforced for all PostgreSQL connections. The psycopg2-binary package (included in requirements.txt) must be installed for PostgreSQL support.
Streamlit configuration
The.streamlit/config.toml file controls the visual appearance and runtime behavior of the Streamlit application. The full file as shipped:
.streamlit/config.toml
Settings reference
| Setting | Value | Notes |
|---|---|---|
client.toolbarMode | "minimal" | Reduces the Streamlit toolbar to its minimum state |
ui.hideTopBar | true | Hides the top bar in the Streamlit UI |
logger.level | "error" | Suppresses info and warning logs from the Streamlit logger |
theme.primaryColor | #2563eb | Blue accent used for buttons and interactive elements |
theme.base | "dark" | Dark theme base; all color overrides build on this |
theme.backgroundColor | #0f172a | Main page background |
theme.secondaryBackgroundColor | #1e293b | Sidebar and widget background |
theme.textColor | #e2e8f0 | Primary text color |
Settings you should not change
Thetheme block is safe to customize for branding purposes. The primaryColor (#2563eb) is the primary brand color used throughout the interface — if you change it, update any hardcoded hex values in utils/theme.py as well.