A gratitude journal is a simple app with a real effect: every day you write down three things you are grateful for, and over time you build a habit of noticing good things. It is also a perfect beginner project, because it uses a form, a list, localStorage, and dates — and nothing else.
Start with the data model. Each entry has a date and a list of three grateful items:
const entry = {
date: "2026-11-23",
items: ["Morning walk", "A friend's call", "Finished the project"],
};
Build the UI in three parts: a form with three inputs and a save button, a list that shows past entries grouped by date, and a small counter that shows your current streak. Save entries to localStorage so they survive a refresh:
function saveEntry(entry) {
const entries = JSON.parse(localStorage.getItem("gratitude") || "[]");
entries.unshift(entry);
localStorage.setItem("gratitude", JSON.stringify(entries));
}
A streak is just consecutive dates, so compute it by walking backwards from today and counting days that have an entry. Show the streak prominently — it is the feature that brings people back tomorrow.
Add two small touches that make the app feel complete. First, a "random memory" button that picks a past entry and shows it, so old entries get revisited instead of forgotten. Second, an export button that downloads all entries as a text file, so users never feel locked in.
This project pairs naturally with reading about habits and mindset. If you want to go deeper into why small daily practices work, the best self-help books for beginners explain the science behind them in plain language — and building this app is a good way to practise what those books teach.
The limits are honest ones: localStorage only works on one device, so the app does not sync. Entries are plain text, so there is no rich formatting. And a journal only helps if you open it, so keep the form on one screen and make saving take under ten seconds.
Build it today: form, list, streak, and a random-memory button. Ship it, use it for a week, and then add the one feature you actually miss.
Top comments (0)