DEV Community

Cover image for Building PDF Open Source Services with Angular & GCP - Architecture Overview
Dale Nguyen
Dale Nguyen

Posted on • Updated on

Building PDF Open Source Services with Angular & GCP - Architecture Overview

Welcome to the first part of the journey in building open source PDF service using Angular (Analogjs), Firestore, Cloud Storage, and CloudRun. This project serves as a platform for sharing my knowledge, continually learning best practices, and simultaneously contributing to the community.

Part 1: Architecture Overview
Part 2: Deploy services to Cloud Run

Demo: https://pdfun.xyz 
GitHub: https://github.com/dalenguyen/pdfun

The First Feature: Upload and Resize PDF Files (Unsecured - kind of)

Our first feature is all about simplicity and functionality. It allows you to upload and resize PDF files. This feature is designed with a user-friendly interface that makes it easy for anyone to use, regardless of their technical background.

Resize PDF file UI

There is no security in place if you don't log in the application. Anyone know how Firebase works, can access the file that you uploaded. The only security measure for publicly is that all files will be deleted in 1 day.

Technology Stack

The technology stack we've chosen for this project includes Angular (Analgojs), Firestore, Cloud Storage, and CloudRun. These technologies were chosen for their robustness, scalability, and ease of use. They work together seamlessly to provide a smooth user experience.

Here is the flow:

PDF processing event flow

  • First, you upload their PDF file
  • The UI will upload their file to Cloud Storage + a record in Firestore
  • Created event from Firestore will trigger a service from Cloud Run
  • Cloud Run retrieve data from Firestore & file from Cloud Storage
  • Cloud Run start to resize the PDF, then upload it back to Cloud Storage and Firestore
  • The updated record will reflect on the UI with link for users to download the resized file
  • All PDF files / records will be delete after 1 day based on the TTL policy

Try It Out

I encourage you to try out our service. You can support me by starring the GitHub repository or sponsoring the project. Your support helps the project continue to improve and add new features.

Questions?

If you have any questions or run into any issues, please don't hesitate to create an issue on our GitHub repository. Alternatively, you can chat with me. I'm here to help and would love to hear your feedback.

Stay tuned for Part 2 where I will show you how to secure your uploaded files. Until then, happy coding!

Top comments (0)