A robust microservices-based document conversion platform that converts DOCX files to PDF with optional password protection. Built with React frontend and Flask backend services, containerized with Docker for easy deployment.
- DOCX to PDF conversion
- Optional PDF password protection
- Microservices architecture
- Docker containerization
- Cross-platform compatibility
- Responsive web interface
- Fast and efficient processing
Before running this project, make sure you have the following installed on your system:
-
Docker Desktop
- Download and install from Docker Official Website
- Make sure Docker Desktop is running before starting the project
- Minimum requirements:
- Windows 10/11 Pro or Enterprise (for Windows users)
- macOS 10.15 or newer (for Mac users)
- 4GB RAM minimum
- Enable virtualization in BIOS (for Windows users)
-
Git
- Download and install from Git Official Website
- Required for cloning the repository
-
Web Browser
- Any modern web browser (Chrome, Firefox, Edge, etc.)
- Required for accessing the web interface
-
Clone the Repository
git clone https://github.com/Kshitij-2412/word-to-pdf-converter.git cd word-to-pdf-converter -
Start Docker Desktop
- Make sure Docker Desktop is running on your system
- You should see the Docker icon in your system tray (Windows) or menu bar (Mac)
-
Run the Application You have two options to run the application:
Option 1 - Using run.sh script (recommended):
# Start all services in background sh run.sh start # Start with visible logs sh run.sh start-with-logs # Check service status sh run.sh status # Stop all services sh run.sh stop # Run tests sh run.sh test
Option 2 - Using Docker Compose directly:
# Start all services with logs docker-compose up --build # Start in detached mode docker-compose up --build -d # Stop services docker-compose down
-
Access the Application
- Open your web browser and go to:
- Frontend UI: http://localhost:3000
- The API services will be running at:
- API Gateway: http://localhost:5000
- Upload Service: http://localhost:5001
- Conversion Service: http://localhost:5002
- Open your web browser and go to:
-
Using the Application
- Upload a DOCX file using the web interface
- Optionally set a password for PDF protection
- Click Convert to start the conversion process
- Download your converted PDF file
The fastest way to run the application is to pull the images directly from Docker Hub. No need to clone the repository!
-
Prerequisites
- Docker Desktop installed and running
- 4GB RAM minimum
- Ports 3000, 5000, 5001, and 5002 available
-
Create Docker Network
docker network create rapidfort-net
-
Create Volumes for Document Storage
docker volume create doc_uploads docker volume create doc_output
-
Pull and Run the Services
a. Start Conversion Service:
docker run -d --name conversion_service \ --network rapidfort-net \ -p 5002:5002 \ -v doc_uploads:/app/uploads \ -v doc_output:/app/output \ -e FLASK_ENV=development \ -e OUTPUT_FOLDER=/app/output \ kshitijagarwal24/rapidfort-backend:conversion-service
b. Start Upload Service:
docker run -d --name upload_service \ --network rapidfort-net \ -p 5001:5001 \ -v doc_uploads:/app/uploads \ -e FLASK_ENV=development \ -e UPLOAD_FOLDER=/app/uploads \ kshitijagarwal24/rapidfort-backend:upload-service
c. Start API Gateway:
docker run -d --name api_gateway \ --network rapidfort-net \ -p 5000:5000 \ -v doc_uploads:/app/uploads \ -v doc_output:/app/output \ -e FLASK_ENV=development \ -e UPLOAD_SERVICE_URL=http://upload_service:5001 \ -e CONVERSION_SERVICE_URL=http://conversion_service:5002 \ kshitijagarwal24/rapidfort-backend:api-gateway
d. Start Frontend:
docker run -d --name frontend \ --network rapidfort-net \ -p 3000:3000 \ -e REACT_APP_API_URL=http://localhost:5000/api \ kshitijagarwal24/rapidfort-frontend:latest
-
Access the Application
- Open your browser and go to: http://localhost:3000
- You can now upload DOCX files and convert them to PDF
-
Stop and Cleanup
# Stop all containers docker stop frontend api_gateway upload_service conversion_service # Remove containers docker rm frontend api_gateway upload_service conversion_service # Remove network docker network rm rapidfort-net # Remove volumes (optional - this will delete all uploaded and converted files) docker volume rm doc_uploads doc_output
- Kubernetes cluster (minikube/kind/etc.)
- Ingress controller enabled
- kubectl installed and configured
-
Start your Kubernetes cluster If using minikube:
minikube start
-
Enable Ingress Controller For minikube:
minikube addons enable ingress -
Deploy the Application
# Create namespace kubectl apply -f k8s/namespace.yaml # Create persistent volumes kubectl apply -f k8s/persistent-volumes.yaml # Deploy services kubectl apply -f k8s/api-gateway-deployment.yaml kubectl apply -f k8s/upload-service-deployment.yaml kubectl apply -f k8s/conversion-service-deployment.yaml kubectl apply -f k8s/frontend-deployment.yaml # Apply ingress configuration kubectl apply -f k8s/ingress.yaml
-
Access the Application If using minikube:
# Start minikube tunnel in a separate terminal minikube tunnelThe application will be available at:
- Frontend: http://localhost/
- API: http://localhost/api
Check the status of your pods:
kubectl get pods -n rapidfortCheck the services:
kubectl get services -n rapidfortCheck the ingress:
kubectl get ingress -n rapidfort-
Pod Issues
# Check pod status kubectl get pods -n rapidfort # Check pod logs kubectl logs -n rapidfort <pod-name> # Describe pod for more details kubectl describe pod -n rapidfort <pod-name>
-
Service Issues
# Check service status kubectl get services -n rapidfort # Describe service kubectl describe service -n rapidfort <service-name>
-
Ingress Issues
# Check ingress status kubectl get ingress -n rapidfort # Describe ingress kubectl describe ingress -n rapidfort
-
Common Issues
- If pods are in "Pending" state, check if PersistentVolumes are properly configured
- If pods are in "ImagePullBackOff", verify internet connection and image names
- If services are not accessible, ensure minikube tunnel is running
- If ingress is not working, verify that the ingress controller is enabled
The application uses the following Docker Hub images:
- Frontend:
kshitijagarwal24/rapidfort-frontend:latest - Backend Services:
- API Gateway:
kshitijagarwal24/rapidfort-backend:api-gateway - Upload Service:
kshitijagarwal24/rapidfort-backend:upload-service - Conversion Service:
kshitijagarwal24/rapidfort-backend:conversion-service
- API Gateway:
You can pull these images directly:
# Pull frontend
docker pull kshitijagarwal24/rapidfort-frontend:latest
# Pull backend services
docker pull kshitijagarwal24/rapidfort-backend:api-gateway
docker pull kshitijagarwal24/rapidfort-backend:upload-service
docker pull kshitijagarwal24/rapidfort-backend:conversion-serviceIf you encounter any issues:
-
Docker Issues
- Make sure Docker Desktop is running
- Try restarting Docker Desktop
- Run
docker-compose downfollowed bydocker-compose up --build
-
Port Conflicts
- Ensure ports 3000, 5000, 5001, and 5002 are not being used by other applications
- To check ports in use:
- Windows:
netstat -ano | findstr PORT_NUMBER - Mac/Linux:
lsof -i :PORT_NUMBER
- Windows:
-
Common Fixes
- Clear Docker cache:
docker system prune -a - Rebuild containers:
docker-compose build --no-cache - Remove all containers and volumes:
docker-compose down -v docker-compose up --build
- Clear Docker cache:
POST /api/upload- Upload DOCX filePOST /api/convert- Convert DOCX to PDFGET /api/download/{filename}- Download converted PDF
POST /upload- Handle file upload
POST /convert- Convert documentsPOST /protect- Add password protection to PDF
.
├── frontend/ # React frontend application
├── backend/ # Backend services
│ ├── api_gateway/ # API Gateway service
│ ├── upload_service/ # Upload handling service
│ └── conversion_service/ # Document conversion service
├── docker-compose.yml # Docker composition config
└── run.sh # Application management script