Academyacademy / vibe-102 / local-storage
Save With localStorage
What this is
localStorage is browser memory.
It lets the app remember simple data after the page refreshes.
Why it matters
State remembers while the app is open.
localStorage remembers after refresh.
It is not a real database. It is not secure storage. It is only for small, non-sensitive browser-local data.
What to do
Use this prompt:
Copy prompt
CONTEXT:
I am building my Vibe 102 mini app.
CURRENT STATE:
I can add, update, and delete items.
TASK:
Add localStorage.
Requirements:
- load saved items when the app opens
- save items whenever they change
- use JSON.stringify when saving
- use JSON.parse when loading
- do not save sensitive data
Rules:
- explain localStorage simply
- explain JSON.stringify and JSON.parse simply
- keep the code beginner-friendly
- do not add a backend or databaseRefresh the browser after adding an item.
If the item is still there, the app is refresh proof.
Common mistakes
- Saving before the list behavior works.
- Forgetting that
localStoragestores strings. - Treating
localStoragelike a shared database. - Saving private or sensitive information.
Vibe 102 / Current checkpoint
Save With localStorage
Ready to stamp - Saved in this browser only.
0 of 11 checkpoints complete
0 of 11 checkpoints complete.