An open-source file conversion webapp built with ReactJs, Python
and AWS for the HTTP API, Lambda functions and S3 object storage.
Converts .docx files to .pdf
-
Website
- ReactJs App Router
- Amazon Web Services for backend functionality
- Support for
HTTP API
,S3
File Storage, andLambda
functions - Edge runtime-ready
-
AWS Infrastructure
- Amazon S3 Allows for object storage and static site hosting
- API Gateway hosts the HTTP API
- AWS Lambda for processing JSON and filtering required data
- Amazon EC2 for provisioning VM instances
A static site is hosted on S3
with a document upload form. We use API Gateway
to create an API which makes a GET
request to a Lambda
function after the user clicks Upload File on the form.
The API sends a presigned bucket URL
for the uploads-bucket
. The site then automatically conducts a PUT
request to the same bucket with the .docx
file data.
Another Lambda
function is configured to listen for PUT Object events
in the S3 uploads-bucket
. It parses the event record for file name and sends a POST
request to the Python Flask App
performing the document conversion.
An EC2
instance is deployed with an Ubuntu OS image. A python script is setup to run as a background process.
The python microservice
converts documents using pandoc
package and is exposed as an API using Flask
listening for POST
requests on a specified port. It downloads and saves the specified file with its ID, uploads the converted file to the output-bucket
on S3
and performs cleanup for files saved during runtime.
The static site returns the download link for the converted file from the output-bucket
.