A full-stack document conversion application with a Next.js frontend and Python FastAPI backend.
- PDF to Word: Convert PDF documents to Word (.docx) format
- Word to PDF: Convert Word documents to PDF format
- PDF to Text: Extract text content from PDF files
- PDF Unlocker: Remove password protection from PDF files
word-to-pdf/
├── backend/ # Python FastAPI backend
│ ├── main.py # API endpoints
│ └── requirements.txt
├── frontend/ # Next.js frontend
│ ├── app/ # Next.js app directory
│ ├── components/ # React components
│ └── lib/ # API utilities
└── README.md
- Navigate to the backend directory:
cd backend- Create a virtual environment (recommended):
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Run the server:
python main.pyOr with uvicorn:
uvicorn main:app --reload --port 8000The API will be available at http://localhost:8000
- Navigate to the frontend directory:
cd frontend- Install dependencies:
npm install- Create a
.env.localfile:
cp .env.local.example .env.local- Update
.env.localif your backend is running on a different port:
NEXT_PUBLIC_API_URL=http://localhost:8000
- Run the development server:
npm run devThe frontend will be available at http://localhost:3000
The easiest way to run both services:
# Build and start all services
docker-compose up --build
# Or run in detached mode
docker-compose up -d --build
# View logs
docker-compose logs -f
# Stop services
docker-compose downOr use the Makefile:
make start # Build and start services
make logs # View logs
make down # Stop servicesServices will be available at:
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/docs
- Start the backend server (port 8000)
- Start the frontend development server (port 3000)
- Open your browser and navigate to
http://localhost:3000 - Select a file and click "Convert" to use any of the conversion tools
POST /api/pdf-to-word- Convert PDF to Word documentPOST /api/word-to-pdf- Convert Word document to PDFPOST /api/pdf-to-txt- Convert PDF to text filePOST /api/pdf-unlock- Remove password protection from PDF (optional password parameter)
- FastAPI
- PyPDF2 / pypdf
- python-docx
- pdf2docx
- PyMuPDF (fitz)
- Next.js 16
- React 19
- TypeScript
- Tailwind CSS v4
- Files are processed temporarily and not stored on the server
- For Word to PDF conversion, formatting may be simplified
- PDF unlocker requires the password if the PDF is encrypted