A dynamic Next.js application that fetches New York Times bestseller books and lets users create and customize book cover images with draggable title and author text, preview, and download.
- Fetch top hardcover fiction books from the New York Times API.
- Select a book (title and author).
- Upload a custom image for the cover.
- Add and position title and author text on the image.
- Customize text style: font size, color, and letter spacing.
- Save the customized cover and preview it.
- Download the final cover as a PNG file.
- Next.js 13 (App Router)
- React & TypeScript
- Tailwind CSS
- html2canvas-pro
- react-draggable
- New York Times Books API
- Next.js Server Actions for form handling
- Node.js (>=14)
- Yarn or npm
- Clone the repository:
git clone https://github.com/yourusername/dev-challenge-growth-frontend.git
cd dev-challenge-growth-frontend- Install dependencies:
yarn install
# or
npm install- Create a
.env.localfile in the project root and add your New York Times API key:
API_KEY=YOUR_NYT_API_KEY
yarn dev
# or
npm run devOpen http://localhost:3000 in your browser.
- Choose a book from the fetched NYT bestseller list.
- Upload a base image for the cover.
- Click on the title or author text to activate style controls.
- Drag the title and author text to position them on the cover.
- Adjust font size, color, and letter spacing.
- Save and proceed to preview.
- Download the final cover as a PNG.
.
├── app
│ ├── page.tsx # Home page (book selection)
│ ├── edit-cover/page.tsx # Cover editing page
│ └── preview/page.tsx # Preview and download page
├── components # Reusable React components
├── models # TypeScript models and interfaces
├── actions # Next.js server actions
└── lib # Utility functions
This project is private.