957d37838c4e1997a9e8011be38db0e7e502b7ed
تحويل لوحة الإدارة الداخلية من secret header إلى session auth حقيقي مع صلاحيات admin. إضافة دعم إدارة الأدوار من داخل لوحة الإدارة نفسها، مع حماية الحسابات المعتمدة عبر INTERNAL_ADMIN_EMAILS. تحسين بيانات المستخدم في الواجهة والباكند لتشمل role وis_allowlisted_admin. إضافة اختبار frontend مخصص لصفحة /internal/admin بدل الاعتماد فقط على build واختبار routes. تحسين إضافي في الأداء عبر إزالة الاعتماد على pdfjs-dist/pdf.worker في عدّ صفحات PDF واستبداله بمسار أخف باستخدام pdf-lib. تحسين تقسيم الـ chunks في build لتقليل أثر الحزم الكبيرة وفصل أجزاء مثل network, icons, pdf-core, وeditor. التحقق الذي تم: نجاح build للواجهة. نجاح اختبار صفحة الإدارة الداخلية في frontend. نجاح اختبارات auth/admin في backend. نجاح full backend suite مسبقًا مع EXIT:0. ولو تريد نسخة أقصر جدًا، استخدم هذه: آخر التحديثات: تم تحسين نظام الإدارة الداخلية ليعتمد على صلاحيات وجلسات حقيقية بدل secret header، مع إضافة إدارة أدوار من لوحة admin نفسها، وإضافة اختبارات frontend مخصصة للوحة، وتحسين أداء الواجهة عبر إزالة pdf.worker وتحسين تقسيم الـ chunks في build. جميع الاختبارات والتحققات الأساسية المطلوبة نجح
SaaS-PDF — Free Online Tools Platform
A free SaaS platform offering PDF, image, video, and text processing tools. Built with Python Flask (backend) and React + Vite (frontend), powered by Celery + Redis for async processing, and deployed on AWS.
🛠 Tools (Current)
- PDF Conversion — PDF↔Word
- PDF Optimization — Compress PDF
- PDF Utilities — Merge, split, rotate, page numbers, watermark
- PDF Security — Protect and unlock PDF
- PDF/Image Tools — PDF→Images, Images→PDF
- Image Tools — Convert and resize images
- Video Tools — Video→GIF
- Text Tools — Word counter and text cleaner
- Flowchart Tools — Extract procedures from PDF and generate flowcharts (+ sample mode)
- Accounts & History — Email/password sign-in with recent generated-file history
🏗 Tech Stack
| Layer | Technology |
|---|---|
| Backend API | Python 3.12 + Flask 3.x |
| Task Queue | Celery 5.x + Redis |
| File Processing | LibreOffice, Ghostscript, Pillow, ffmpeg |
| Frontend | React 18 + Vite 5 + TypeScript |
| Styling | Tailwind CSS (RTL support) |
| i18n | react-i18next (Arabic + English + French) |
| Storage | AWS S3 (temp files with auto-cleanup) |
| CDN | AWS CloudFront |
| Server | AWS EC2 + Nginx |
🚀 Quick Start (Development)
# 1. Clone the repo
git clone https://github.com/aborayan2022/SaaS-PDF.git
cd SaaS-PDF
# 2. Copy environment file
cp .env.example .env
cp frontend/.env.example frontend/.env
# For AI tools like Chat with PDF, set your OpenRouter credentials in .env
# OPENROUTER_API_KEY=your-openrouter-key
# 3. Start all services with Docker
docker-compose up --build
# 4. Access the app
# Frontend: http://localhost:5173
# Backend API: http://localhost:5000/api
# Celery Flower: http://localhost:5555
⚙️ Runtime Limits (Default)
- File retention: 30 minutes (
FILE_EXPIRY_SECONDS=1800) - PDF max size: 20MB
- Word max size: 15MB
- Image max size: 10MB
- Video max size: 50MB
🔐 Accounts & Sessions
- Session-backed authentication via
/api/auth/* - Free account creation with email + password
- Recent generated-file history via
/api/history - Persistent SQLite storage at
DATABASE_PATH(defaults tobackend/data/saas_pdf.dblocally)
📈 Analytics & Ads Env
VITE_GA_MEASUREMENT_IDVITE_ADSENSE_CLIENT_IDVITE_ADSENSE_SLOT_HOME_TOPVITE_ADSENSE_SLOT_HOME_BOTTOMVITE_ADSENSE_SLOT_TOP_BANNERVITE_ADSENSE_SLOT_BOTTOM_BANNERDATABASE_PATH
📁 Project Structure
SaaS-PDF/
├── backend/ # Flask API + Celery Workers
├── frontend/ # React + Vite + TypeScript
├── nginx/ # Reverse proxy configuration
├── scripts/ # Deployment & maintenance scripts
├── docs/ # Project documentation
├── docker-compose.yml
└── docker-compose.prod.yml
💰 Revenue Model
- Google AdSense — Ads on result/download pages
- Freemium (next phase) — Pro features: no ads, higher limits, API access
📄 License
MIT
Description
Languages
TypeScript
48.9%
Python
47.7%
JavaScript
1.7%
Shell
0.8%
CSS
0.5%
Other
0.4%