Overview
The Resume Builder automatically saves all resume data and template selection to the browser’s localStorage. This ensures users never lose their work, even if they close the browser or refresh the page.Storage Keys
Two localStorage keys are used to persist application state (src/hooks/useResume.tsx:4-5):
Stores the complete
ResumeData object as JSON, including personal info, experience, education, skills, projects, custom sections, and section ordering.Stores the selected template name:
'classic', 'modern', or 'minimal'.Auto-Save Strategy
Data is automatically saved to localStorage whenever it changes, using React’suseEffect hooks.
Resume Data Auto-Save
The resume data is saved wheneverresumeData changes (src/hooks/useResume.tsx:66-70):
The
typeof window !== 'undefined' check ensures the code doesn’t run during server-side rendering (SSR), preventing errors in frameworks like Next.js.Template Selection Auto-Save
Template selection is saved separately (src/hooks/useResume.tsx:72-76):
Data Restoration
When the application loads, data is restored from localStorage during state initialization.Resume Data Restoration
TheuseState initializer function loads saved data (src/hooks/useResume.tsx:37-54):
Template Restoration
Template selection is restored with validation (src/hooks/useResume.tsx:56-64):
Data Migration
The codebase includes migration logic to handle breaking changes in the data structure.Personal Info Migration
Older versions of the app didn’t include'personal-info' in the sectionOrder array. The migration ensures it’s always present (src/hooks/useResume.tsx:44-46):
- Checks if
sectionOrderexists and lacks'personal-info' - Prepends
'personal-info'to the beginning of the array - Ensures backward compatibility with older saved data
Error Handling
Parse Errors
If JSON parsing fails during restoration, the error is logged and the app falls back to default data:Missing Data
If no saved data exists in localStorage, the app initializes withinitialResumeData from src/types.ts:81-99:
Best Practices
Immediate Persistence
Every state change triggers an automatic save. You don’t need to implement manual save buttons.
SSR Compatibility
Always check for
window existence before accessing localStorage to support server-side rendering.Graceful Degradation
Parse errors and missing data are handled gracefully with fallbacks to initial state.
Data Validation
Template values are validated before use to prevent invalid states.
Clearing Stored Data
To clear all saved resume data (useful for testing or starting fresh):After clearing localStorage, refresh the page to load the default initial state.

