Skip to content

Commit 09163f1

Browse files
author
Chloe White
committed
implemented a simple finance dashboard setup
1 parent a4f27de commit 09163f1

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-1
lines changed

finance_dashboard/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Finance Dashboard
2+
3+
This is a beginner-friendly finance dashboard built with Flask.
4+
It allows users to track expenses and view total spending.
5+
6+
## Setup
7+
1. Install requirements:
8+
```bash
9+
pip install -r requirements.txt

finance_dashboard/app.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,24 @@
1-
##finance dashboard issue :]
1+
##finance dashboard issue :]
2+
from flask import Flask, render_template_string
3+
4+
app = Flask(__name__)
5+
6+
# Sample expense data
7+
expenses = [
8+
{"category": "Food", "amount": 120},
9+
{"category": "Rent", "amount": 800},
10+
{"category": "Transport", "amount": 60},
11+
]
12+
13+
@app.route("/")
14+
def dashboard():
15+
total = sum(e["amount"] for e in expenses)
16+
categories = ", ".join(e["category"] for e in expenses)
17+
return render_template_string("""
18+
<h1>Finance Dashboard</h1>
19+
<p><b>Total Spending:</b> ${{ total }}</p>
20+
<p><b>Categories:</b> {{ categories }}</p>
21+
""", total=total, categories=categories)
22+
23+
if __name__ == "__main__":
24+
app.run(debug=True)

finance_dashboard/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
flask
2+
matplotlib

0 commit comments

Comments
 (0)