npm run dev- Start development server with hot reloadnpm run build- TypeScript compile + Vite production buildnpm run lint- Run ESLint on TypeScript filesnpm run preview- Preview production build locally
Copy .env.example to .env and add your Anthropic API key for genre classification:
VITE_ANTHROPIC_API_KEY=sk-ant-...
ReadRewind is a React + TypeScript + Vite app that analyzes Goodreads reading data. Users upload their Goodreads CSV export and get interactive analytics dashboards.
- User uploads CSV via
ProfileInputcomponent csvParser.tsparses the CSV (filters for "read" shelf only)- Optional:
genreClassifier.tscalls Claude API to classify books by genre (batched in groups of 25, cached in localStorage) parser.tscalculates analytics (stats, distributions, top authors)Analyticscomponent renders charts (Recharts) with two views: "overall" and "yearly"
src/App.tsx- Root component, manages app state and data flowsrc/types.ts- TypeScript interfaces (Book, Analytics, FetchStatus)src/components/Analytics.tsx- Main dashboard with charts and book gridssrc/components/BookCover.tsx- Fetches covers from OpenLibrary APIsrc/utils/csvParser.ts- Goodreads CSV parsing with quote handlingsrc/utils/genreClassifier.ts- LLM genre classification with localStorage caching