A full-stack application for converting images between PNG and JPG formats, built with Go backend and React frontend.
- Image Conversion: Convert images between PNG and JPG/JPEG formats
- Drag & Drop: Easy file upload with drag and drop support
- Live Preview: See your image before conversion
- Health Check: Real-time backend connection status
- Responsive Design: Beautiful UI that works on all devices
- Download: Instantly download converted files
- Go - High-performance API server
- Standard Library - No external dependencies for core functionality
- React 19 with TypeScript
- Vite - Lightning-fast build tool
- Axios - HTTP client
- Lucide React - Beautiful icons
- Go 1.21 or higher
- Node.js 18 or higher
- npm or yarn
cd golang_Backend
go run cmd/api/main.goThe backend will start on http://localhost:8080
In a new terminal:
cd React_Frontend
npm install # if not already done
npm run devThe frontend will start on http://localhost:3000
GET /health
Returns: 200 OK
POST /transform?to={format}
- Query Parameters:
to: Target format (pngorjpg)
- Body:
multipart/form-datawith file field namedfile - Returns: Converted image file
- File Upload: Drag & drop or click to browse
- Format Selection: Toggle between PNG and JPG
- Image Preview: View original image before conversion
- File Info: Display filename, size, and type
- Status Indicators: Visual feedback for conversion status
- Backend Health: Real-time connection indicator
- Format Detection: Automatic input format detection
- Quality Control: 90% JPEG quality for optimal results
- File Size Limit: 20MB maximum upload size
- CORS Enabled: Cross-origin requests supported
golang_Backend/
├── cmd/api/main.go # Entry point with CORS
├── internal/
│ ├── handlers/
│ │ ├── handlers.go # Transform endpoint
│ │ └── health.go # Health check
│ └── transform/
│ ├── convert.go # Image conversion logic
│ └── detect.go # File type detection
React_Frontend/
├── src/
│ ├── api/fileApi.ts # Backend API integration
│ ├── App.tsx # Main component
│ ├── App.css # Styling
│ └── main.tsx # Entry point
- Ensure Go backend is running on port 8080
- Check if port 8080 is not already in use
- Run
npm installto ensure dependencies are installed - Clear browser cache and restart dev server
- The backend includes CORS middleware for cross-origin requests
- Ensure the backend is restarted after any changes
Input: PNG, JPG, JPEG Output: PNG, JPG
- Add more image formats (GIF, WebP, BMP)
- Image compression options
- Batch conversion
- Image editing (resize, crop, rotate)
- User authentication
- Conversion history
- Dark mode
i guess u can use it LOL!
I mean i still just started u can contribute after i guess !