PROJECT 003 · 2026 · JS · LOCALSTORAGE
Astra
A focus timer: create activities, set daily goals, start, pause and watch live progress.
- lines of JavaScript
- ~420
- commits
- 11
- built
- May – Jun 2026
- libraries
- 0
00 · Summary
- WHAT
- Minimal time tracker focused on where your time really goes
- MY ROLE
- Solo: planning, design, code, deployment
- STACK
- Vanilla JavaScript, localStorage, HTML, CSS
- STATUS
- Live. Finished as a portfolio project.
01 · Why I built it
After Journalist I wanted a project with more complex state. Each activity in Astra has its own identity, timer, goal, progress and reset logic. The goal was not more features. It was to understand state: what you store, what you calculate and what you show.
02 · What it does
- Create and delete activities
- Daily goal per activity
- Start, pause, resume
- Live timer on the card and in the detail view
- Live progress and progress bar
- "Goal achieved" modal, once a day
- Reset with confirmation
- Automatic daily reset
- Saved in localStorage
03 · Architecture
progress = round( todaySeconds / (goalHours × 3600) × 100 )
04 · Hard parts
- P-01
Timestamps instead of
seconds++.Counting seconds would have been easier, but browsers slow down timers in background tabs. Astra saves the start moment and calculates elapsed time from timestamps. It took several sessions to understand, and it was worth it.
- P-02
Stored vs calculated.
The timer doesn't save every second. It calculates what to display and updates stored time only on pause. Understanding this split was the main goal of the project.
- P-03
Two views, one truth.
Cards and the detail view update every second from the same state. Each card carries a
data-id, so the app updates one element without re-rendering the whole view. - P-04
Buttons from state.
startBtn.disabled = isRunningandpauseBtn.disabled = !isRunning, so double clicks on Start can't break the timer.
05 · Known issue
Known issue
lastResetDate comes from toISOString(), which is UTC time. In Poland the daily reset happens at 1:00 at night (2:00 in summer), not at midnight. The fix is to build the date from local time.
06 · What I learned
- Design the state before the UI. The shape of the data decides how hard the rest will be.
- Separate stored data from calculated values.
- Understand before building. Some days I wrote almost no code and only mapped the flow. Those days saved the most time.