diff --git a/dashboard/dashboard.py b/dashboard/dashboard.py index d2e0229..339524d 100644 --- a/dashboard/dashboard.py +++ b/dashboard/dashboard.py @@ -141,6 +141,47 @@ def dreams(): return render_template("dreams.html", dreams=recent) +@app.route("/health") +def health(): + # Load vocab size + vocab_size = get_vocab_size() + + # Load brainmap size + brainmap_size = len(get_brainmap()) + + # Load dreams + dreams = load_dreams() + dream_count = len(dreams) + last_dream = dreams[-1]["sentence"] if dreams else "No dreams yet." + + # Load journal + try: + with open("data/memory/journal.json", "r", encoding="utf-8") as f: + journal_entries = json.load(f) + except Exception: + journal_entries = [] + + journal_count = len(journal_entries) + last_journal = journal_entries[-1] if journal_entries else "No journal entries yet." + + # Load books + books = get_books() + book_count = len(books) + progress = load_progress() + books_finished = sum(1 for b in books if progress.get(b, 0) > 0) + + return render_template("health.html", + vocab_size=vocab_size, + brainmap_size=brainmap_size, + book_count=book_count, + books_finished=books_finished, + dream_count=dream_count, + journal_count=journal_count, + last_dream=last_dream, + last_journal=last_journal) + + + def run_dashboard(): log = logging.getLogger('werkzeug') log.setLevel(logging.ERROR) diff --git a/dashboard/templates/brainmap.html b/dashboard/templates/brainmap.html index 381ef1d..1dd457b 100644 --- a/dashboard/templates/brainmap.html +++ b/dashboard/templates/brainmap.html @@ -41,6 +41,7 @@ πΈοΈ Brain Map π Growth π Dreams + β€οΈ Health
diff --git a/dashboard/templates/concepts.html b/dashboard/templates/concepts.html index 0698de5..63703b5 100644 --- a/dashboard/templates/concepts.html +++ b/dashboard/templates/concepts.html @@ -48,6 +48,7 @@ πΈοΈ Brain Map π Growth π Dreams + β€οΈ Health