How abhijeet597/session-1 works
Habit Tracker is a browser-only app for adding habits, checking them in, and organizing the list. The user interacts with the page; js/main.js handles form and sorting events, calls habit operations in js/habits.js, and asks js/render.js to update the table. Habit records and check-ins remain in memory, while sorting preferences are stored separately in browser localStorage. The README documents the browser-based UI and sorting preference; source excerpts show the event handling and module calls. The HTML-to-script wiring is not shown, so it is omitted.
Main entry points: main.js UI controller · render.js Habit table renderer · habits.js Habit operations · index.html Habit page
Components 9
Browser interface
- Habit page
index.html - Browser DOM
- Habit table renderer
js/render.js
Interaction coordination
- UI controller
js/main.js - Sort preferences
js/main.js
Habit management
- Habit operations
js/habits.js - In-memory habit list
js/habits.js
Other components
- User
- Browser localStorage
Connections 9
- User → Habit page: uses
README.md - UI controller → Browser DOM: handles events
js/main.js - UI controller → Habit operations: adds, checks in, sorts
js/main.js - UI controller → Habit table renderer: requests render
js/main.js - UI controller → Sort preferences: loads and saves
js/main.js - Sort preferences → Browser localStorage: reads and writes
js/main.js - Habit operations → In-memory habit list: updates and reads
js/habits.js - Habit table renderer → Browser DOM: renders rows
js/render.js - Habit table renderer → Habit operations: gets today date
js/render.js