DEV Community

Cover image for Build a Customer CRM Dashboard with Streamlit in 30 Minutes
Babatunde Alashe
Babatunde Alashe

Posted on

Build a Customer CRM Dashboard with Streamlit in 30 Minutes

Turn spreadsheet chaos into a slick, interactive dashboard your whole team can use.

Why You’re Here (and Why It Matters)

Let me guess — you’ve got a pile of customer data sitting in a CSV file (or worse, buried in emails),
and you’re thinking: “There has to be a better way to manage this.”

You're not alone.

Every startup or solo project have experienced that moment. You don’t need Salesforce.

And you probably don’t want to burn hours building a full-blown web app. You just want a simple dashboard where you can:

  • See your customers at a glance

  • Track interactions and lead stages

  • Filter, search, and update info without crying into your coffee

That’s where Streamlit comes in.

It’s fast. It's Pythonic. And in 30 minutes, you’ll build a clean, interactive CRM dashboard your team can actually use.

What We’re Building (In Plain English)

By the end of this tutorial, you'll have:

  • A working CRM dashboard UI

  • Live search, filtering, and sorting

  • Customer cards with contact and deal info

  • Stage tracking (Lead → Prospect → Customer)

  • A clean way to update and save data

Here’s a sneak peek of what it looks like:

+-------------------------------------+
|   CUSTOMER CRM DASHBOARD           |
+-------------------------------------+
| 🔍 Search: [_____]                 |
| [ Lead | Prospect | Customer ]     |
|                                     |
| 🧍 John Doe                         |
| 📧 john@example.com                |
| 💼 ACME Corp                        |
| Stage: Prospect                    |
| [🖊️ Edit] [➡ Move to Customer]     |
+-------------------------------------+
Enter fullscreen mode Exit fullscreen mode

Tools You’ll Need

  • Python 3.8+

  • Streamlit

  • A CSV file (we’ll generate mock data)

Install Streamlit if you haven’t already:

#Using Bash 

pip install streamlit
Enter fullscreen mode Exit fullscreen mode

Step 1: Set Up Your Data Source

Let’s create a simple CSV that represents your customer list:

#Using Csv

id,name,email,company,stage,last_contacted
1,John Doe,john@example.com,ACME Corp,Prospect,2024-06-15
2,Jane Smith,jane@startup.io,Startup.io,Lead,2024-06-10
3,Bob Lee,bob@blockchain.dev,ChainWorks,Customer,2024-05-01

Enter fullscreen mode Exit fullscreen mode

Save this as customers.csv.

You can also use Faker to generate larger datasets, but we’ll keep it lean for now.

Step 2: Spin Up Your Streamlit App

Create a file called crm_dashboard.py. This will be your main app.

Start with the basic imports and data load:

#Using Python

import streamlit as st
import pandas as pd

st.set_page_config(page_title="Customer CRM Dashboard", layout="wide")

@st.cache_data
def load_data():
    return pd.read_csv("customers.csv")

df = load_data()
Enter fullscreen mode Exit fullscreen mode

*Add a clean page title:
*

#Using python

st.title("👥 Customer CRM Dashboard")
st.markdown("Track your leads, prospects, and customers—all in one place.")
Step 3: Add Search and Stage Filters

Let’s make it interactive. First, add a search bar:

search_term = st.text_input("🔍 Search by name or company")

if search_term:
    df = df[df["name"].str.contains(search_term, case=False) | 
            df["company"].str.contains(search_term, case=False)]

Enter fullscreen mode Exit fullscreen mode

Now, add a stage filter:

#Using python

stages = ["All", "Lead", "Prospect", "Customer"]
selected_stage = st.radio("Filter by stage", stages, horizontal=True)

if selected_stage != "All":
    df = df[df["stage"] == selected_stage]

Enter fullscreen mode Exit fullscreen mode

Simple. Intuitive. Streamlit magic.

Step 4: Display Customer Cards

Here’s where the UI comes to life. Loop through the filtered dataframe and display each customer:

#Using python

for _, row in df.iterrows():
    with st.container():
        st.markdown(f"### {row['name']}")
        st.write(f"**Email:** {row['email']}")
        st.write(f"**Company:** {row['company']}")
        st.write(f"**Stage:** {row['stage']}")
        st.write(f"**Last Contacted:** {row['last_contacted']}")

Enter fullscreen mode Exit fullscreen mode

It’s minimal for now, but readable. Let’s take it further.

Step 5: Edit & Update Customers (Optional Enhancement)

Want to update customer stages directly from the dashboard?

Let’s add buttons:

#Using python

col1, col2 = st.columns([1, 2])
        with col1:
            if st.button(f"Move {row['name']} to Next Stage"):
                # Placeholder logic
                next_stage = {
                    "Lead": "Prospect",
                    "Prospect": "Customer",
                    "Customer": "Customer"
                }[row["stage"]]
                df.at[_, "stage"] = next_stage

Enter fullscreen mode Exit fullscreen mode

To make this persistent, you’d need to overwrite the CSV or connect to a database. That’s a bonus lesson if you’re up for it.

Step 6: Style It Up (Without Overdoing It)

Streamlit supports markdown and emojis natively. You can create visual separation using:

#Using python

st.divider()

Enter fullscreen mode Exit fullscreen mode

Or break up sections using:

#Using python

st.subheader("📋 Customer Overview")

Enter fullscreen mode Exit fullscreen mode

Step 7: Save Changes (Advanced Users)

To make edits persistent:

#Using python

df.to_csv("customers.csv", index=False)

Enter fullscreen mode Exit fullscreen mode

You can add a save button at the bottom:

if st.button("💾 Save Changes"):
    df.to_csv("customers.csv", index=False)
    st.success("Changes saved.")

Enter fullscreen mode Exit fullscreen mode

Streamlit doesn’t auto-refresh cached data after saving, so you might need to work with session states or rerun triggers to reflect updates cleanly.

Bonus: Connect to Google Sheets or Airtable

For real-world use, you’d likely want to store your CRM data somewhere more reliable than a local CSV.

You can:

  • Use gspread to connect to Google Sheets

  • Use pyairtable to update Airtable

  • Or plug into Supabase for a full-stack backend

You Did It

You just built a fully functional CRM dashboard in Streamlit — with filtering, search, and interaction — all in under 30 minutes of code.

It may not replace HubSpot (yet), but it’s yours. And it’s extendable.

Need to add analytics? Easy.
Want to assign owners? Go for it.
Thinking of email integration? Zapier + Gmail = done.

You now have the bones of a product.

Final Thoughts

What makes this tutorial different isn’t just that it works. It’s that it gives you ownership.

Tools like Streamlit are what let technical founders, indie hackers, and early startup teams move fast without cutting corners. You’ve turned a chaotic CSV into a structured app — and you didn’t even need React.

So go ahead. Add this to your portfolio. Use it in your startup. Or rebuild it for something bigger.

Your dashboard is just the beginning.

Quick Recap

✅ Load and filter customer data from CSV

✅ Create a dashboard layout with Streamlit

✅ Add search and stage filters

✅ Display interactive customer cards

✅ Enable in-app updates

✅ Optional: persist data and connect to cloud services

Top comments (0)