🔗 Live demo: https://pdf-converter-app-azure.vercel.app
A simple PDF converter application built with Next.js 15, React 19, TypeScript, and Tailwind CSS.
Users can enter text, convert it into a PDF via external API, preview the result inline, and access a local history of past conversions.
- ✏️ Convert custom text into PDF via HTTP API
- 🔍 Preview PDF directly in browser using
react-pdf - 💾 Store last 10 conversions in
localStorage - 📥 Download converted PDF
- ⚡ Responsive UI with Tailwind
- ✅ Includes unit test for form logic using Jest + RTL
- Clone the repo:
git clone https://github.com/romul3003/pdf-converter-app.git
cd pdf-converter-app- Install dependencies:
npm install- Run locally:
npm run devsrc/ ├── app/ │ ├── layout.tsx # Root layout (fonts, global styles) │ └── page.tsx # Home page ├── components/ │ ├── ConvertToPdfForm.tsx # Text input + submit │ ├── PdfPreview.tsx # PDF preview via react-pdf │ └── HistoryList.tsx # Clickable history of conversions ├── hooks/ │ └── usePdfHistory.ts # LocalStorage logic ├── actions/ │ └── convert-to-pdf.ts # Server action that calls PDF API ├── tests/ │ └── ConvertToPdfForm.test.tsx # Unit test for form
POST http://95.217.134.12:4010/create-pdf?apiKey=78684310-850d-427a-8432-4a6487f6dbc4
Body:
{
"text": "Hello, Universe!"
}- API returns PDF as a
blob, which is converted tobase64and rendered inline.
Includes unit test for the main conversion form (ConvertToPdfForm):
npm run testTest coverage:
- ✔ Input interaction
- ✔ Form submission
- ✔ Mocked API response
- ✔ Error handling (e.g. validation message)
- Only 10 last converted PDFs are saved in browser history
- Preview works client-side using
react-pdfandbase64data