Skip to content
anfaalresearchPublic

About

Privacy-first browser file tools. Convert, resize, compress, crop, and inspect files without uploading them.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

Β 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

⚑ FileForge

Private, browser-based file tools. No uploads. No accounts. No servers.

🌐 Live Demo

License: MIT HTML CSS JavaScript No Backend PRs Welcome


πŸ“– Table of Contents


πŸ” What is FileForge?

FileForge is a 100% client-side file processing toolkit that runs entirely in your browser. It converts, resizes, compresses, crops, and inspects files using modern Web APIs β€” your files never leave your device.

There is no backend, no cloud storage, no analytics, and no accounts. Open the page, use a tool, download your result.

🌐 Live Demo

Try FileForge directly in your browser:

https://anfaalresearch.github.io/FileForge/


🧰 Tools

Tool Description Formats
Image Converter Convert images between formats PNG Β· JPG Β· WEBP Β· GIF Β· BMP
Image Resizer Resize with custom dimensions or presets Any image
Image Compressor Reduce file size with a quality slider + before/after compare PNG Β· JPG Β· WEBP
Image Cropper Crop with free or locked aspect ratios, rotate & zoom Any image
Image to PDF Combine multiple images into a single PDF Any image β†’ PDF
File Size Reducer Compress with live size estimation PNG Β· JPG Β· WEBP
File Information Inspect metadata β€” name, MIME, size, dimensions Any file

πŸ”’ Privacy

FileForge was designed from the ground up with privacy as the first constraint, not an afterthought.

  • βœ… No server uploads β€” files are processed entirely in-browser using the Canvas API and FileReader API
  • βœ… No tracking β€” zero analytics, zero telemetry, zero cookies (except localStorage for theme preference)
  • βœ… No accounts β€” nothing to sign up for
  • βœ… Core processing runs locally β€” file operations happen directly in your browser
  • βœ… Object URLs revoked β€” all URL.createObjectURL blobs are revoked after use to free memory

Note: The only external resource loaded at runtime is jsPDF 2.5.1 from the Cloudflare CDN, used solely for PDF generation. All other functionality is self-contained.


πŸ›  Tech Stack

Layer Technology
Structure HTML5 (semantic, accessible markup)
Styling Vanilla CSS3 (custom properties, grid, glassmorphism)
Logic Vanilla JavaScript ES2020+ (IIFEs, async/await, Canvas API)
Font Inter via Google Fonts
PDF generation jsPDF 2.5.1 via CDN
Image processing HTML5 Canvas API
File reading FileReader API + File Drag & Drop API
Routing URL ?tool= query param + history.pushState
Persistence localStorage (theme + recently used tools only)

πŸ“ Project Structure

FileForge/
β”œβ”€β”€ index.html              # Landing page (hero, tool cards, privacy section)
β”œβ”€β”€ tools.html              # All tools shell (SPA-style panel switching)
β”œβ”€β”€ README.md
β”‚
β”œβ”€β”€ css/
β”‚   β”œβ”€β”€ style.css           # Full design system β€” tokens, components, layouts
β”‚   └── responsive.css      # Breakpoint overrides (1024px, 768px, 480px)
β”‚
└── js/
    β”œβ”€β”€ utils.js            # Shared FF namespace β€” helpers, toast, drop zones
    β”œβ”€β”€ app.js              # Theme toggle, sidebar nav, tool switching, routing
    β”œβ”€β”€ scene.js            # Hero background canvas ambient animation
    β”‚
    β”œβ”€β”€ image-converter.js  # Tool: format conversion
    β”œβ”€β”€ image-resizer.js    # Tool: resize + aspect ratio lock + presets
    β”œβ”€β”€ image-compressor.js # Tool: quality slider + before/after compare
    β”œβ”€β”€ image-cropper.js    # Tool: canvas crop box + rotate + zoom
    β”œβ”€β”€ image-pdf.js        # Tool: multi-image β†’ PDF (uses jsPDF)
    β”œβ”€β”€ file-reducer.js     # Tool: compression with live size estimate
    └── file-info.js        # Tool: file metadata inspector

πŸš€ Getting Started

FileForge requires no build step, no npm, no dependencies to install.

Option 1 β€” Open directly

git clone https://github.com/anfaalresearch/FileForge.git
cd FileForge

# macOS
open index.html

# Linux
xdg-open index.html

# Windows
start index.html

Option 2 β€” Serve locally (recommended)

Some browsers restrict file:// protocol for certain APIs. Use any static server:

# Python 3
python3 -m http.server 3000

# Node.js
npx serve .

# PHP
php -S localhost:3000

Then open http://localhost:3000.


πŸ— Architecture

Global Namespace β€” FF

All shared utilities live on the window.FF object, defined in utils.js and available to every tool script:

FF.formatFileSize(bytes)          β†’ "1.4 MB"
FF.getFileExtension(filename)     β†’ "png"
FF.mimeToExt(mime)                β†’ "jpg"
FF.mimeToFriendly(mime)          β†’ "JPEG"
FF.changeExt(filename, ext)       β†’ "photo.webp"
FF.loadImage(file)                β†’ Promise<HTMLImageElement>
FF.downloadBlob(blob, filename)   β†’ triggers browser download + auto-revoke
FF.setupDropZone(zone, input, cb) β†’ wires drag & drop + file input
FF.show(el) / FF.hide(el)        β†’ add/remove .hidden class
FF.toast(message, type)           β†’ type: 'success' | 'error' | 'warning' | 'info'

Tool Script Pattern

Every tool follows the same IIFE structure:

(function () {
  'use strict';

  // 1. Query all DOM elements needed by this tool
  const upload = document.querySelector('#myToolUpload');

  // 2. Wire up drag & drop and file input via FF.setupDropZone
  FF.setupDropZone(upload, fileInput, handleFile);

  // 3. handleFile β€” validate, update file card, show controls
  function handleFile(file) { /* ... */ }

  // 4. Core processing β€” async, uses Canvas API or jsPDF
  async function processFile() { /* ... */ }

  // 5. resetTool β€” revoke object URLs, clear state, restore upload zone
  function resetTool() { /* ... */ }

})();

Routing (tools.html)

tools.html is a single-page shell. Panels are toggled via the .hidden CSS class.

Trigger Behaviour
Page load with ?tool=resizer Opens Image Resizer directly
Sidebar link click Switches panel + pushes URL via history.pushState
Browser back/forward popstate listener re-reads URL and switches panel
Sidebar search Filters sidebar links by name in real time

πŸ›‘ Security Audit

Finding Severity Status
File contents never sent to any server β€” βœ… By design
URL.createObjectURL blobs revoked after use β€” βœ… Implemented
Filename sanitized before innerHTML injection Low βœ… Fixed
No eval() or document.write anywhere β€” βœ… Clean
localStorage stores only theme + tool IDs, never file data β€” βœ… Clean
All async processing wrapped in try/catch with user feedback β€” βœ… Handled
File size limits enforced before processing β€” βœ… 100MB images Β· 500MB info
CORS canvas taint impossible β€” all sources are local File objects β€” βœ… N/A

🌐 Browser Support

Browser Support
Chrome / Edge 90+ βœ… Full
Firefox 90+ βœ… Full
Safari 15+ βœ… Full
Safari iOS 15+ βœ… Full
Chrome Android βœ… Full

Requires: Canvas API Β· FileReader API Β· File Drag & Drop Β· CSS Custom Properties Β· URL.createObjectURL Β· history.pushState


🀝 Contributing

  1. Fork the repo
  2. Create a branch: git checkout -b feat/my-new-tool
  3. Follow the tool pattern above
  4. Test in Chrome and Firefox
  5. Open a pull request

Adding a New Tool (checklist)

  • Create js/my-tool.js following the IIFE tool pattern
  • Add <div id="panel-mytool" class="tool-panel"> in tools.html
  • Add <a class="sidebar-link" data-tool="mytool"> in tools.html
  • Register the name in toolNames in app.js
  • Add a card in index.html
  • Add <script src="js/my-tool.js"></script> in tools.html

πŸ“„ License

MIT Β© 2026 Anfaal

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files, to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software.


Made with ⚑ for the open web.

⬆ Back to top

About

Privacy-first browser file tools. Convert, resize, compress, crop, and inspect files without uploading them.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages