Skip to content

ronypermadi/transpify

Repository files navigation

Transpify - Image Manipulation Suite

Transpify React Vite Tailwind CSS

Aplikasi web full-stack untuk manipulasi gambar dengan berbagai fitur profesional. Transpify menyediakan tool untuk menghapus background, kompres gambar, konversi format, dan crop gambar dengan antarmuka yang modern dan mudah digunakan.

✨ Fitur Utama

🎨 Background Remover

  • Hapus latar belakang gambar secara otomatis menggunakan AI (Remove.bg)
  • Preview before/after dengan transparency grid
  • Export sebagai PNG dengan transparansi

πŸ“¦ Image Compressor & Resizer

  • Kompres gambar dengan kontrol kualitas (10-100%)
  • Resize berdasarkan dimensi spesifik (width/height)
  • Resize berdasarkan persentase (10-200%)
  • Tampilkan perbandingan ukuran file dan compression ratio

πŸ”„ Format Converter

  • Konversi ke PNG, JPEG, WebP, atau AVIF
  • Optimasi otomatis untuk setiap format
  • Kualitas output terbaik dengan ukuran file efisien

βœ‚οΈ Image Cropper

  • Crop dengan presisi menggunakan react-image-crop
  • Aspect ratio presets (Free, 1:1, 16:9, 4:3, 3:2)
  • Live preview hasil crop
  • Export dalam format original

πŸš€ Tech Stack

Frontend:

  • React 18 dengan Vite
  • Tailwind CSS untuk styling
  • React Router untuk navigasi
  • React Dropzone untuk upload file
  • React Image Crop untuk cropping
  • Lucide React untuk icons
  • Axios untuk HTTP requests

Backend:

  • Vercel Serverless Functions (Node.js)
  • Sharp untuk image processing
  • Remove.bg API untuk background removal

πŸ“‹ Prerequisites

  • Node.js >= 18.0.0
  • npm atau yarn
  • Remove.bg API key (gratis untuk 50 requests/bulan)

πŸ› οΈ Installation & Setup

1. Clone atau Download Project

cd /home/developer/js_dev/rionapp/transpify

2. Install Dependencies

# Install frontend dependencies
npm install

# Install API dependencies
cd api
npm install
cd ..

3. Setup Environment Variables

Buat file .env di root project:

cp .env.example .env

Edit file .env dan tambahkan API key Anda:

VITE_REMOVE_BG_API_KEY=your_actual_api_key_here

Cara mendapatkan Remove.bg API Key:

  1. Kunjungi https://www.remove.bg/api
  2. Daftar/login ke akun Anda
  3. Copy API key dari dashboard
  4. Free tier: 50 requests/bulan

4. Run Development Server

npm run dev

Aplikasi akan berjalan di http://localhost:3000

πŸ“¦ Build untuk Production

npm run build

Output akan berada di folder dist/

🌐 Deployment ke Vercel

Cara 1: Deploy via Vercel CLI

# Install Vercel CLI (jika belum)
npm i -g vercel

# Deploy
vercel

Cara 2: Deploy via Vercel Dashboard

  1. Push code ke GitHub repository
  2. Login ke vercel.com
  3. Klik "New Project"
  4. Import repository Anda
  5. Configure project settings:
    • Framework Preset: Vite
    • Build Command: npm run build
    • Output Directory: dist
  6. Tambahkan Environment Variable:
    • Key: VITE_REMOVE_BG_API_KEY
    • Value: your_api_key_here
  7. Klik "Deploy"

Environment Variables di Vercel

Pastikan menambahkan environment variable berikut di Vercel Dashboard:

  • VITE_REMOVE_BG_API_KEY - API key untuk Remove.bg

Langkah:

  1. Buka project di Vercel Dashboard
  2. Settings β†’ Environment Variables
  3. Tambahkan variable
  4. Redeploy project

πŸ“ Struktur Project

transpify/
β”œβ”€β”€ api/                          # Vercel Serverless Functions
β”‚   β”œβ”€β”€ package.json             # API dependencies
β”‚   β”œβ”€β”€ remove-background.js     # Background removal endpoint
β”‚   β”œβ”€β”€ compress-resize.js       # Compression & resize endpoint
β”‚   β”œβ”€β”€ convert-format.js        # Format conversion endpoint
β”‚   └── crop-image.js            # Image cropping endpoint
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/              # React components
β”‚   β”‚   β”œβ”€β”€ Navbar.jsx
β”‚   β”‚   β”œβ”€β”€ LandingPage.jsx
β”‚   β”‚   β”œβ”€β”€ BackgroundRemover.jsx
β”‚   β”‚   β”œβ”€β”€ ImageCompressor.jsx
β”‚   β”‚   β”œβ”€β”€ ImageConverter.jsx
β”‚   β”‚   β”œβ”€β”€ ImageCropper.jsx
β”‚   β”‚   └── LoadingSpinner.jsx
β”‚   β”œβ”€β”€ App.jsx                  # Main app component
β”‚   β”œβ”€β”€ main.jsx                 # Entry point
β”‚   └── index.css                # Global styles
β”œβ”€β”€ public/                      # Static assets
β”œβ”€β”€ index.html                   # HTML template
β”œβ”€β”€ package.json                 # Frontend dependencies
β”œβ”€β”€ vite.config.js              # Vite configuration
β”œβ”€β”€ tailwind.config.js          # Tailwind configuration
β”œβ”€β”€ postcss.config.js           # PostCSS configuration
β”œβ”€β”€ vercel.json                 # Vercel deployment config
β”œβ”€β”€ .env.example                # Environment variables template
└── README.md                   # Dokumentasi ini

🎯 Cara Penggunaan

Background Remover

  1. Klik menu "Background Remover"
  2. Upload atau drag & drop gambar
  3. Klik "Hapus Background"
  4. Download hasil PNG dengan transparansi

Image Compressor

  1. Klik menu "Compressor"
  2. Upload gambar
  3. Atur kualitas dengan slider (10-100%)
  4. Pilih resize option:
    • Gunakan persentase, atau
    • Masukkan width/height manual
  5. Klik "Kompres Gambar"
  6. Lihat perbandingan ukuran file
  7. Download hasil

Format Converter

  1. Klik menu "Converter"
  2. Upload gambar
  3. Pilih format output (PNG/JPEG/WebP/AVIF)
  4. Klik "Konversi"
  5. Download hasil

Image Cropper

  1. Klik menu "Cropper"
  2. Upload gambar
  3. Pilih aspect ratio preset atau gunakan free crop
  4. Drag area crop pada gambar
  5. Klik "Generate Preview"
  6. Download hasil crop

βš™οΈ API Endpoints

POST /api/remove-background

Remove background dari gambar

Request Body:

{
  "image": "data:image/png;base64,..."
}

Response:

{
  "success": true,
  "image": "data:image/png;base64,..."
}

POST /api/compress-resize

Kompres dan resize gambar

Request Body:

{
  "image": "data:image/png;base64,...",
  "quality": 80,
  "width": 800,
  "height": null,
  "percentage": null
}

Response:

{
  "success": true,
  "image": "data:image/jpeg;base64,...",
  "size": 123456,
  "dimensions": {
    "width": 800,
    "height": 600
  }
}

POST /api/convert-format

Konversi format gambar

Request Body:

{
  "image": "data:image/png;base64,...",
  "format": "webp"
}

Response:

{
  "success": true,
  "image": "data:image/webp;base64,...",
  "format": "webp",
  "size": 98765
}

POST /api/crop-image

Crop gambar

Request Body:

{
  "image": "data:image/png;base64,...",
  "crop": {
    "x": 100,
    "y": 100,
    "width": 400,
    "height": 300,
    "unit": "px"
  }
}

Response:

{
  "success": true,
  "image": "data:image/png;base64,...",
  "dimensions": {
    "width": 400,
    "height": 300
  }
}

πŸ”’ Batasan & Perhatian

Vercel Serverless Functions (Free Tier)

  • Timeout: 10 detik max
  • Response Size: 50MB max
  • Memory: 1024MB

Tips untuk Menghindari Timeout

  • Kompres gambar di client-side sebelum upload jika ukuran > 5MB
  • Gunakan gambar dengan resolusi wajar (max 4000x4000px)
  • Remove.bg memiliki limit ukuran file sendiri

Remove.bg API Limits

  • Free Tier: 50 requests/bulan
  • File Size: Max 12MB
  • Resolution: Max 25 megapixels

πŸ› Troubleshooting

Error: "Remove.bg API key belum dikonfigurasi"

Solusi: Pastikan file .env ada dan berisi VITE_REMOVE_BG_API_KEY yang valid

Error: "Request timeout"

Solusi:

  • Gunakan gambar dengan ukuran lebih kecil
  • Kompres gambar sebelum upload
  • Pastikan koneksi internet stabil

Gambar tidak muncul setelah di-upload

Solusi:

  • Check console browser untuk error
  • Pastikan format file didukung
  • Coba clear cache browser

Build error saat deployment

Solusi:

  • Pastikan semua dependencies ter-install
  • Check Node.js version (>= 18.0.0)
  • Periksa log build di Vercel dashboard

πŸ“„ License

MIT License - Feel free to use for personal or commercial projects

πŸ‘¨β€πŸ’» Developer

Dikembangkan dengan ❀️ menggunakan React, Vite, dan Tailwind CSS

πŸ™ Credits


Happy Image Editing! 🎨✨

πŸ”„ Auto-Deploy Configuration

Project is now connected to GitHub for automatic deployments. Every push to main branch will trigger a new production deployment.

Last Updated: Tue Dec 2 12:23:22 PM WIB 2025

About

Suite lengkap image manipulation tools profesional. Gratis, cepat, dan mudah.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages