Skip to content

๐Ÿ“ธ My Image Uploader A powerful image uploader built with TypeScript and Go, featuring a responsive frontend, robust backend, and effortless deployment with Docker. ๐Ÿš€

Notifications You must be signed in to change notification settings

MHF0/my-image-uploader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

22 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ–ผ๏ธ Modern Image Uploader


โœจ Features

  • ๐Ÿ“ค Instant Upload - Drag & drop or click to upload images effortlessly
  • ๐Ÿ”— Quick Sharing - Get shareable links instantly with one-click copying
  • ๐Ÿ‘๏ธ Image Preview - Preview images before finalizing uploads
  • ๐Ÿ“ฑ Responsive Design - Works perfectly on desktop, tablet, and mobile devices
  • ๐Ÿ“Š Progress Tracking - Real-time progress indicators for each upload
  • ๐Ÿ“ฅ Multiple File Support - Upload multiple images simultaneously
  • ๐Ÿ”’ Secure Storage - Images are stored securely on Cloudinary
  • ๐Ÿ’พ Local Gallery - View and manage your uploaded images even after page refresh

๐Ÿš€ Tech Stack

React
React
TypeScript
TypeScript
Tailwind CSS
Tailwind CSS
Go
Go
Cloudinary
Cloudinary
Docker
Docker

๐Ÿ“ท Screenshots

Home ย ย  Upload

Gallery

๐Ÿ—๏ธ Architecture

The application follows a clean, simple architecture:

my-image-uploader/
โ”œโ”€โ”€ frontend/             # React/TypeScript frontend
โ”‚   โ”œโ”€โ”€ src/              # Source code
โ”‚   โ”œโ”€โ”€ public/           # Static assets
โ”‚   โ””โ”€โ”€ ...               # Configuration files
โ”œโ”€โ”€ server/               # Go backend API
โ”‚   โ”œโ”€โ”€ main.go           # Entry point
โ”‚   โ””โ”€โ”€ ...               # Additional modules
โ””โ”€โ”€ ...                   # Project files

๐Ÿ› ๏ธ Installation & Setup

Prerequisites

  • Node.js (v22+)
  • Go (v1.24+)
  • Cloudinary account (for image storage)
  • Docker (optional, for containerized deployment)

Frontend Setup

# Navigate to frontend directory
cd frontend

# Install dependencies
npm install

# Start development server
npm run dev

Backend Setup

The backend uses Go with Gin framework and Cloudinary for image storage.

# Navigate to server directory
cd server

# Install dependencies
go mod tidy

# Set up environment variables
# On Windows
set CLOUDINARY_CLOUD_NAME=your_cloud_name
set CLOUDINARY_API_KEY=your_api_key
set CLOUDINARY_API_SECRET=your_api_secret

# On Linux/Mac
export CLOUDINARY_CLOUD_NAME=your_cloud_name
export CLOUDINARY_API_KEY=your_api_key
export CLOUDINARY_API_SECRET=your_api_secret

# Run the Go server
go run main.go

Docker Deployment

You can easily deploy the application using Docker:

# Build the Docker image
docker build -t image-uploader .

# Run the container
docker run -p 8080:8080 \
  -e CLOUDINARY_CLOUD_NAME=your_cloud_name \
  -e CLOUDINARY_API_KEY=your_api_key \
  -e CLOUDINARY_API_SECRET=your_api_secret \
  image-uploader

Or use Docker Compose:

# Create a .env file with your Cloudinary credentials first
# Then run:
docker-compose up -d

CORS Configuration

The server includes CORS configuration to allow cross-origin requests. If you're experiencing CORS issues:

  1. Ensure the frontend URL is added to the allowed origins in main.go:
router.Use(cors.New(cors.Config{
    AllowOrigins:     []string{"http://localhost:3000", "http://localhost:5173", "https://your-frontend-domain.com"},
    AllowMethods:     []string{"GET", "POST", "OPTIONS"},
    AllowHeaders:     []string{"Origin", "Content-Type", "Accept", "Authorization"},
    ExposeHeaders:    []string{"Content-Length"},
    AllowCredentials: true,
    MaxAge:           12 * 60 * 60,
}))
  1. Restart the server after making changes.

๐Ÿงฉ How It Works

  1. Upload - Drag and drop or select images from your device
  2. Process - Images are processed and uploaded to Cloudinary via the Go backend
  3. Share - Copy the generated links to share your images instantly
  4. Manage - View your uploaded images in the gallery (persisted in localStorage)

๐Ÿ”ฎ Future Enhancements

  • User accounts for persistent image management
  • Image editing capabilities
  • Custom link customization
  • Album creation and organization
  • Enhanced security features
  • Support for additional file types

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ‘จโ€๐Ÿ’ป Author

Mohammed Farhan - GitHub Profile


Made with โค๏ธ for the love of simple, effective solutions

About

๐Ÿ“ธ My Image Uploader A powerful image uploader built with TypeScript and Go, featuring a responsive frontend, robust backend, and effortless deployment with Docker. ๐Ÿš€

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published