This repository contains a simple web application for converting .docx Word documents to PDF format. The project is split into two main parts:
- Backend โ an Express server handling file uploads and conversion using
docx-pdf. - Frontend โ a Vite-powered React application providing a user interface.
Located in the Backend/ directory.
- Accepts file uploads via a POST request to
/convertFile. - Saves uploaded
.docxfiles inuploads/. - Converts documents to PDF using the
docx-pdfpackage. - Returns the generated PDF as a download.
cd Backend
npm install
node index.jsAccess the server at http://localhost:3000 (default port).
The port and other settings are currently hard-coded; you can introduce environment variables later if needed.
- express
- multer
- cors
- docx-pdf
The React application is inside Frontend/vite-project.
cd Frontend/vite-project
npm install
npm run devThis will start the Vite development server (typically at http://localhost:5173).
The UI allows users to select a .docx file and submit it to the backend for conversion.
Backend/
index.js
package.json
files/
uploads/
Frontend/
vite-project/
src/
components/
App.jsx
main.jsx
package.json
vite.config.js
- No environment variables are currently used, everything is configured inline in
index.js. - Be sure to create the
files/anduploads/directories if they donโt already existโthey are used for storage.
Feel free to open issues or submit pull requests to add features such as:
- Environment variable support (e.g. configurable port/path).
- Authentication or rateโlimiting.
- Support for additional document formats.
Enjoy converting your documents!