Production-ready Streamlit template for SaaS metrics visualization
A beautiful, fully-functional SaaS analytics dashboard that you can have running in under 10 minutes. Perfect for indie hackers, startup founders, and SaaS businesses who need professional metrics tracking without the complexity.
- Supabase email/password authentication
- Secure session management
- User registration with email verification
- Password reset functionality (optional)
- MRR (Monthly Recurring Revenue) with growth trends
- Customer Count with growth rates
- Churn Rate analysis and visualization
- Plan Tier Breakdown (Starter/Pro/Enterprise)
- Cohort Retention heatmaps
- New Customer acquisition tracking
- Executive summary generation via Claude API
- Natural language metric queries
- Trend analysis and recommendations
- "Ask your dashboard" functionality
- Beautiful dark theme
- Responsive design (works on mobile)
- Interactive Plotly charts
- Custom CSS styling
- Clean, modern interface
- Well-documented code
- Modular architecture
- Easy customization
- Production-ready structure
- Demo data generator included
- Python 3.11 or higher
- A Supabase account (free tier works!)
- An Anthropic API key (for AI features)
# Clone the repository
git clone https://github.com/yourusername/saas-dashboard-template.git
cd saas-dashboard-template
# Create and activate virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt- Go to supabase.com and create a new project
- Wait for the project to finish setting up (2-3 minutes)
- Go to SQL Editor in your Supabase dashboard
- Copy the contents of
schema.sqland paste it into the editor - Click Run to create all tables
Supabase:
- In your Supabase project, go to Settings β API
- Copy your Project URL
- Copy your anon/public key
Anthropic:
- Go to console.anthropic.com
- Sign up or log in
- Navigate to API Keys
- Create a new API key
# Copy the example environment file
cp .env.example .env
# Edit .env with your favorite editor
nano .env # or vim, code, etc.Add your credentials:
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_KEY=your_anon_key_here
ANTHROPIC_API_KEY=sk-ant-api03-...# Generate 12 months of realistic sample data
python seed_data.pyYou should see:
π± Starting database seeding...
β
Connected to Supabase
π Generating sample data...
β¨ Database seeded successfully!
streamlit run app.pyVisit http://localhost:8501 in your browser. You're live! π
- Click the "Sign Up" tab
- Enter your email and password (minimum 6 characters)
- Check your email for the verification link
- Click the verification link
- Return to the dashboard and log in
The dashboard has four main sections:
- High-level KPIs at a glance
- MRR and customer growth charts
- Quick performance summary
- Detailed MRR trend analysis
- Revenue breakdown by plan tier
- Plan distribution table
- Customer growth visualization
- Churn rate analysis
- Cohort retention heatmap
- Executive summary generation
- Natural language queries
- Ask questions like:
- "What's driving my revenue growth?"
- "Should I be worried about churn?"
- "Which plan tier is most profitable?"
saas-dashboard-template/
βββ app.py # Main Streamlit application
βββ requirements.txt # Python dependencies
βββ .env.example # Environment variables template
βββ .gitignore # Git ignore rules
βββ schema.sql # Database schema (run in Supabase)
βββ seed_data.py # Sample data generator
βββ README.md # This file
βββ CUSTOMIZATION.md # Customization guide
βββ LICENSE # MIT License
β
βββ utils/ # Utility modules
β βββ __init__.py
β βββ auth.py # Authentication logic
β βββ database.py # Database queries
β βββ charts.py # Plotly chart generation
β βββ ai_insights.py # Claude AI integration
β
βββ assets/ # Static assets
β βββ style.css # Custom CSS theme
β
βββ docs/ # Additional documentation
βββ DEPLOYMENT.md # Deployment guide (optional)
Edit assets/style.css:
/* Primary color (green) */
#00C853 β #YOUR_COLOR
/* Accent colors */
#2196F3 β #YOUR_BLUE
#FF9800 β #YOUR_ORANGEEdit seed_data.py:
PLAN_PRICES = {
'basic': 19, # Change names and prices
'premium': 79,
'ultimate': 199
}Update database queries in utils/database.py to match.
- Update database schema in
schema.sql - Add queries in
utils/database.py - Create chart functions in
utils/charts.py - Add new page in
app.py
See CUSTOMIZATION.md for detailed instructions.
- Push your code to GitHub
- Go to share.streamlit.io
- Connect your repository
- Add secrets in the app settings:
SUPABASE_URL = "your_url" SUPABASE_KEY = "your_key" ANTHROPIC_API_KEY = "your_key" - Deploy!
- Heroku: Use the included
Procfile - DigitalOcean: Deploy as a web service
- AWS/GCP: Run on EC2/Compute Engine
- Docker: Containerize with provided
Dockerfile
- Never commit
.envfile - Already in.gitignore - Enable Row Level Security (RLS) in Supabase for multi-tenancy
- Rotate API keys if accidentally exposed
- Use environment variables for all secrets
- Enable email verification in Supabase settings
- Set up SSL/HTTPS
- Enable Supabase RLS policies
- Use strong password requirements
- Implement rate limiting
- Set up monitoring and logging
- Configure backup strategy
- Review Supabase auth settings
| Metric | Description | Calculation |
|---|---|---|
| MRR | Monthly Recurring Revenue | Sum of all active subscriptions |
| Customer Count | Total active customers | Count of non-churned users |
| Churn Rate | % of customers lost | (Churned / Total) Γ 100 |
| Cohort Retention | % retained by signup month | (Active / Initial) Γ 100 per cohort |
| Plan Breakdown | Revenue by tier | Sum per plan (Starter/Pro/Enterprise) |
| New Customers | Monthly acquisitions | Count of new signups |
- Supabase: 500MB database, 2GB transfer/month (Free forever)
- Streamlit Cloud: 1 private app (Free)
- Anthropic Claude: $5 free credits (then pay-as-you-go)
- Supabase: $0-25 (upgrade if you exceed 500MB)
- Claude API: $1-5 (for AI insights, very affordable)
- Hosting: $0 (Streamlit Cloud free tier)
Total: $1-30/month depending on usage
Compare to alternatives:
- ChartMogul: $100/month
- Baremetrics: $108/month
- ProfitWell: $0 (but limited features)
| Technology | Purpose | Version |
|---|---|---|
| Streamlit | Web framework | 1.31+ |
| Supabase | Database & Auth | PostgreSQL |
| Anthropic Claude | AI insights | API v1 |
| Plotly | Interactive charts | 5.18+ |
| Pandas | Data processing | 2.1+ |
| Python | Backend | 3.11+ |
β Run python seed_data.py to generate sample data
β Check that .env file exists and has valid SUPABASE_URL and SUPABASE_KEY
β Check your email for the verification link from Supabase
β Ensure data exists in database and tables were created via schema.sql
β Verify ANTHROPIC_API_KEY is set in .env and has credits
β Activate virtual environment and run pip install -r requirements.txt
- Streamlit Documentation
- Supabase Documentation
- Anthropic Claude API Docs
- Plotly Python Documentation
This is a template product, but if you have suggestions:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
MIT License - See LICENSE file for details.
You have full rights to:
- β Use commercially
- β Modify and customize
- β Distribute
- β Private use
No attribution required (but appreciated!)
Questions? Issues?
- π§ Email: support@yourcompany.com
- π¬ GitHub Issues: Create an issue
- π Documentation: See
CUSTOMIZATION.mdfor advanced topics
Once you're comfortable with the template:
- Connect real data - Replace sample data with your actual SaaS metrics
- Add more metrics - LTV, CAC, runway, burn rate
- Customize styling - Match your brand colors
- Deploy to production - Use Streamlit Cloud or your preferred platform
- Add features - Email reports, Slack notifications, exports
Built for indie makers and startup founders who need beautiful analytics without the complexity.
Got questions? Want to share your customization? Open an issue or PR!
β If this saved you time, consider starring the repo!