mona / app.py
mrradix's picture
Update app.py
acc0243 verified
raw
history blame
1.86 kB
import streamlit as st
import sys
import os
from pathlib import Path
# Add the app directory to Python path
app_dir = Path(__file__).parent
sys.path.insert(0, str(app_dir))
from pages.dashboard import create_dashboard_page
from pages.settings import create_settings_page
from utils.config import load_config
from utils.logging import setup_logging, get_logger
# Initialize logging
setup_logging()
logger = get_logger(__name__)
def main():
"""Main application entry point"""
try:
# Configure Streamlit page
st.set_page_config(
page_title="MONA - Monitoring & Analytics",
page_icon="πŸ“Š",
layout="wide",
initial_sidebar_state="expanded"
)
# Load configuration
config = load_config()
logger.info("Application started successfully")
# Create sidebar navigation
st.sidebar.title("MONA Dashboard")
page = st.sidebar.selectbox(
"Navigate to:",
["Dashboard", "Settings", "About"]
)
# Route to appropriate page
if page == "Dashboard":
create_dashboard_page()
elif page == "Settings":
create_settings_page()
elif page == "About":
create_about_page()
except Exception as e:
logger.error(f"Application error: {str(e)}")
st.error(f"An error occurred: {str(e)}")
def create_about_page():
"""Create the about page"""
st.title("About MONA")
st.write("""
MONA (Monitoring & Analytics) is a comprehensive dashboard application
for data visualization and monitoring.
**Features:**
- Real-time data monitoring
- Interactive dashboards
- Data analytics and reporting
- Customizable settings
""")
if __name__ == "__main__":
main()