OpenFiles is a modern, open-source, and user-friendly web application for converting various file types directly in your browser. Upload your file, choose the desired output format, and download the result!
- Intuitive Interface: Easily upload files via click or drag-and-drop.
- Multiple Conversion Types: Supports Images (JPG, PNG, WEBP, etc.), Audio (MP3, WAV, OGG, etc.), Video (MP4, WEBM, AVI, etc.), and Documents (Only DOCX to PDF (for now) via Gotenberg).
- Format-Specific Options: (Basic implementation) Potential to adjust parameters like image quality.
- Cloud-Based Processing: Conversions are efficiently handled using Firebase Cloud Functions and specialized backend services (like Gotenberg for documents).
- Real-time Status: Visualize the upload and conversion status (Uploading, Processing, Success, Error).
- Direct Download: Get the converted file with a single click.
(Icons courtesy of Devicon)
Prerequisites:
- Node.js (v22 recommended - see
backend/functions/package.json
- npm (comes with Node.js)
- Firebase CLI (
npm install -g firebase-tools
andfirebase login
) - Google Cloud SDK (
gcloud
) - For deploying Gotenberg locally/to Cloud Run. - Docker Desktop - To run Gotenberg locally.
- Java Development Kit (JDK) - Required by some Firebase Emulators.
Steps:
-
Clone the Repository:
git clone https://github.com/PipeZz/OpenFiles.git # Use your fork if contributing cd OpenFiles
-
Install Dependencies:
# Install frontend dependencies cd frontend npm install cd .. # Install backend dependencies cd backend/functions npm install cd ../..
-
Run Gotenberg Locally (Docker): For document conversion during local development, you need a running Gotenberg instance. Start the Docker container:
docker run --rm -p 3000:3000 gotenberg/gotenberg:7
(The
documentConverter
function expects it athttp://localhost:3000
by default) -
Start Firebase Emulators: In a separate terminal, from the project root:
firebase emulators:start --only functions,storage
(The Functions emulator will load the functions from
backend/functions/lib
- ensure they are built first withnpm run build --prefix backend/functions
if you make backend changes) -
Start Frontend (Vite): In another terminal, from the project root:
cd frontend npm run dev
The application should now be available (usually
http://localhost:5173
) and connect to the local emulators and your local Gotenberg instance.
- Open the application in your browser.
- Click the upload area or drag and drop a compatible file (Image, Audio, Video, Document).
- Select the desired conversion type and output format.
- Click the "Convert" button.
- Wait for the status indicator.
- Click the "Download" button upon success.
- Firebase Cloud Functions: Located in
backend/functions
, these areonCall
HTTPS functions triggered by the frontend. Each handles a specific conversion type (image, audio, video, document). - Firebase Storage: Used to temporarily store uploaded files (
uploads/
) and conversion results (converted/
). Requires CORS configuration (cors.json
) and security rules (backend/storage.rules
). - Gotenberg (Document Conversion):
- Local: Runs as a Docker container on port 3000.
- Production: Deployed as a separate service on Google Cloud Run. The
convertDocument
function finds its URL via theGOTENBERG_API_URL
environment variable (set infirebase.json
for deployment).
- Firebase Emulators: Used extensively for local development (
functions
,storage
).
Contributions are welcome! Please read the contribution guide in CONTRIBUTING.md
for details on setting up, reporting issues, and submitting pull requests. Specific instructions for adding new conversion types are in docs/adding-converters.md
.
This project is licensed under the MIT License. See the LICENSE
file for details.