dashboard / src /streamlit_app.py
AhmedUddin2002's picture
Update src/streamlit_app.py
ae23cc6 verified
import streamlit as st
import plotly.graph_objects as go
import pandas as pd
# --- Page Config ---
st.set_page_config(page_title="NSAKCET Dashboard", layout="wide")
# --- Sidebar ---
with st.sidebar:
st.markdown("### NSAKCET")
st.markdown("###")
st.button("🏠 Dashboard")
st.markdown("---")
st.markdown("### Branches")
branches = ["IT", "CSE", "CSE_DS", "CSE_AIML", "CSE_IOT", "CIVIL", "MECH"]
for b in branches:
st.button(f"πŸ’‘ {b}")
st.markdown("### Overview")
st.button("πŸ—“οΈ Daily")
st.button("πŸ“† Monthly")
st.button("πŸ“Š Breakdown")
st.markdown("### Management")
st.button("πŸ‘©β€πŸ« Faculty")
# --- Header ---
st.markdown("## πŸ“Š DASHBOARD")
st.markdown("Welcome to your dashboard")
# --- Top Stats ---
col1, col2, col3, col4 = st.columns(4)
with col1:
st.metric("Total Branches", "30", help="Number of branches")
with col2:
st.metric("Classes Today", "180", "Pending Today")
with col3:
st.metric("Total Students", "+5%", "Since Last Year")
with col4:
st.metric("Total Students", "1443", "NSAKCET Campus Students")
st.markdown("---")
# --- Main Content ---
col5, col6 = st.columns([2, 1])
# Line Chart (Monthly Classes)
with col5:
st.markdown("### πŸ“ˆ Monthly Class Count")
months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
values = [10000, 12000, 14000, 50000, 80000, 85000, 140000, 200000, 200000, 250000, 270000, 270000]
fig = go.Figure()
fig.add_trace(go.Scatter(x=months, y=values, mode='lines+markers', fill='tozeroy'))
fig.update_layout(margin=dict(l=10, r=10, t=20, b=20), height=300)
st.plotly_chart(fig, use_container_width=True)
# Doughnut Chart (Classes by Category)
with col6:
st.markdown("### 🍩 Classes By Category")
categories = ['Theory', 'Practicals', 'Seminars', 'Misc']
sizes = [22803, 19545, 16288, 6515]
fig2 = go.Figure(data=[go.Pie(labels=categories, values=sizes, hole=0.5)])
fig2.update_traces(marker=dict(colors=['#fce38a', '#f38181', '#a8d8ea', '#eaffd0']),
textinfo='value+label')
fig2.update_layout(margin=dict(l=0, r=0, t=0, b=0))
st.plotly_chart(fig2, use_container_width=True)
st.markdown("---")
# --- Faculty Table Placeholder ---
st.markdown("### πŸ‘©β€πŸ« Faculty Table")
df = pd.DataFrame(columns=["ID", "Faculty Name", "Branch", "#Subject"])
st.dataframe(df, use_container_width=True, height=200)
# --- Download Button ---
st.markdown("### πŸ“₯ Download Reports")
st.download_button("Download Reports", data="Report content here...", file_name="nsakcet_report.csv")