Skip to main content
In this capstone project, you will build a complete, interactive Student Performance Analytics Dashboard in Streamlit. You will combine file handling, state management, layout controls, and data visualization.

❓ The Goal (Question)

Build a multi-functional analytics dashboard that enables teachers to:
  1. Upload a student grades CSV file (students.csv).
  2. Track dashboard opens/visits in the sidebar using Session State.
  3. Dynamically filter the dataset by Department, Subject, and Search Name using a sidebar form.
  4. Organize content cleanly into three tabs: Dataset, Reports (KPI metrics), and Charts (visualizations using Matplotlib).
  5. Download the filtered report as a new CSV file.

📋 Implementation Plan

  1. Setup: Initialize the project directory and install dependencies using uv (streamlit, pandas, matplotlib).
  2. State & Sidebar: Initialize session state to track page visits and build the filters sidebar.
  3. Data Loading: Implement a CSV file uploader to load the grades dataset.
  4. Data Filtering: Filter the dataframe based on the user’s form inputs.
  5. Layout & Tabs: Organize the dashboard main panel into three switchable tabs:
    • Dataset Tab: Shows the raw filtered data table.
    • Reports Tab: Displays key performance indicators (KPIs) like student count, highest/lowest/average marks.
    • Charts Tab: Renders average marks by department and grade distribution charts.
  6. Actions & Feedback: Add a download button to export the filtered dataset and include progress spinners.

đŸ› ī¸ Step-by-Step Implementation

Step 1: Project Setup

Create a new directory for your project and add the following structure:
Install the required libraries using uv:

Step 2: Initialize App & Session State

Open app.py and set up the page config, title, and session state page-visit counter:

Step 3: Handle CSV File Upload

Below the visit counter, implement the file uploader and load the data:

Step 4: Construct the Filter Form

Create input widgets inside a form inside the sidebar to gather filtering options:

Step 5: Apply Filters & Display Row Metrics

Filter the dataframe according to the selected parameters and display basic metadata:

Step 6: Create the Tabbed Layout

Organize your content by adding three tabs to the main panel:

Step 7: Build the Reports Tab (KPIs)

Implement detailed KPI calculations inside the second tab:

Step 8: Build the Charts Tab (Visualizations)

Generate and render the Matplotlib graphs in the third tab:

Step 9: Add Download Button & Status Feedback

Provide a download option at the bottom of the page and trigger a loading spinner:

📄 Sample Dataset (students.csv)

Save this data as students.csv in your project folder to test the dashboard:

🚀 Complete Combined Code (app.py)

Here is the complete combined code for easy copying: