Imported from Durgeshwar-AI/pdfToPng (
AGENTS.md). Install upstream withnpx skills add Durgeshwar-AI/pdfToPng. Copyright stays with the author.
AGENTS.md
Architecture
Full-stack app: Flask backend (backend/) + React/Vite frontend (frontend/). Not a monorepo — no workspace tooling. Each side has its own package.json / requirements.txt and runs independently.
- Backend entry:
backend/main.py→app/__init__.pycreates Flask app, registers blueprints - Frontend entry:
frontend/src/main.jsx→App.jsx(React Router v7) - API base URL:
http://localhost:5000(set viaVITE_API_URLenv var)
Hard Rules (from CONTRIBUTING.md)
- No persistent storage — server processes files in-memory only, never writes to disk/DB
- No external APIs — all processing is local via installed libraries
- Only file-manipulation features — format conversion, compression, resize, merge, split, etc.
Violations will not be merged.
Dev Commands
Backend
cd backend
python -m venv venv
venv\Scripts\activate # Windows
pip install -r requirements.txt
python main.py # Runs on :5000
Frontend
cd frontend
npm install
npm run dev # Runs on :5173
Docker (recommended for first setup)
docker-compose up --build # Frontend :5173, Backend :5000
Lint (frontend only)
cd frontend && npm run lint
There are no test suites, typecheck, or formatter commands configured in this repo.
Code Conventions
- Python: 4-space indent (PEP 8). Blueprints in
backend/blueprints/, registered inapp/__init__.py. Each blueprint = one file = one feature area. - JS/JSX: 2-space indent. Functional components + hooks only. React 19, Vite 7, Tailwind CSS v4.
- Line endings: LF (enforced by
.editorconfig) - Unused vars: ESLint ignores vars matching
^[A-Z_](component names, constants)
Backend Patterns
- Blueprints use a shared
validate_uploaded_file()+validate_image_file()flow fromutils/validators.py - The
@process_image_requestdecorator inutils/decorators.pyhandles upload validation, image loading, and cleanup for image endpoints - All responses use
utils.helpers.error()for error responses andsend_file_and_cleanup()for file downloads - Force
gc.collect()after processing large files
Frontend Patterns
- Tool pages live in
frontend/src/pages/— one page per feature - Shared
FileUploadAreacomponent anduseFileUploadhook for upload flows ToolPageTemplateprovides consistent layout for tool pages- Tailwind CSS v4 via
@tailwindcss/viteplugin (notailwind.config.js— uses CSS-first config) - PDF.js (
pdfjs-dist) used client-side for PDF rendering; backend/convertPngexists but UI defaults to client-side
Adding a New Feature
- Create blueprint in
backend/blueprints/, register it inapp/__init__.py - Create page in
frontend/src/pages/, add route inApp.jsx - Add tool metadata in
frontend/src/data/toolsData.jsx - Update
Readme.md(required for PR acceptance per CONTRIBUTING.md)
Available Skills (.agents/skills/)
| Skill | What it does in this repo |
|---|---|
docker-expert |
Optimize docker-compose.yml and Dockerfiles — multi-stage builds, image size, non-root user, health checks, dev vs prod separation |
python-design-patterns |
Keep Flask blueprint code clean — single responsibility per blueprint, composition over inheritance, avoid God functions in processing logic |
python-observability |
Add structured JSON logging and request correlation IDs to Flask endpoints; debug production file-processing failures |
wcag-audit-patterns |
Audit the React frontend for WCAG 2.2 violations — missing alt text, keyboard access, color contrast, form labels on upload components |
Deployment
- Render:
render.yamlat root — backend only (gunicorn, 1 worker, 120s timeout) - Vercel:
frontend/vercel.json— frontend static build - No CI/CD workflows configured (
.github/is empty)