Backend service high-performance untuk aplikasi konversi PDF (Zentridox). Dibangun menggunakan FastAPI, Python, dan Docker, dioptimalkan untuk deployment VPS (DigitalOcean) dengan manajemen memori yang efisien.
API ini menyediakan endpoint konversi dokumen dengan fitur canggih:
- PDF ke Word (.docx): Menggunakan
pdf2docxuntuk hasil yang presisi. - PDF ke Excel (.xlsx): Dilengkapi dengan Smart Header Detection untuk mendeteksi tabel dan header secara otomatis, bahkan jika tabel terpotong halaman.
- PDF ke PowerPoint (.pptx): High Speed In-Memory processing. Mengonversi teks menjadi editable text box dan gambar dirender langsung ke RAM untuk kecepatan maksimal.
- Optimasi Server:
- Auto-cleanup temporary files setelah request selesai.
- Validasi ukuran file (Max 25MB).
- CORS enabled untuk integrasi frontend.
- Core: FastAPI, Uvicorn
- PDF Processing: PyMuPDF (Fitz), pdfplumber, pdf2docx
- Office Generation: python-pptx, openpyxl, pandas
- Infrastructure: Docker, GitHub Actions (CI/CD)
-
Clone Repository
git clone https://github.com/rezaldwntr/pdf-backend-api.git cd pdf-backend-api -
Setup Virtual Environment
python -m venv venv source venv/bin/activate # Windows: venv\Scripts\activate
-
Install Dependencies
pip install -r requirements.txt
-
Jalankan Server
uvicorn main:app --reload
Akses dokumentasi API (Swagger UI) di:
http://localhost:8000/docs
Aplikasi ini sudah dilengkapi Dockerfile yang dioptimalkan (slim version).
# Build Image
docker build -t pdf-backend .
# Run Container
docker run -d -p 8000:8000 --name zentridox-api pdf-backendProject ini menggunakan GitHub Actions untuk CD otomatis. Setiap push ke branch main akan memicu deployment otomatis ke server (VPS DigitalOcean) via SSH.
© 2025 Rezal Dewantara. Created for Zentridox Project.