Git Product home page Git Product logo

imageresizerx's Introduction

ImageResizerX

ImageResizerX is an image resizing and management application developed in Golang. It simplifies the process of resizing images and saving them. The application's design follows the repository pattern for file storage. This means that if you need to change where the resized images are saved (e.g., from the local hard disk to cloud storage or a database), you can do so with relative ease by implementing an alternative repository, currently it is designed to save resized image files on the local hard disk. This project aims to provide a versatile image processing solution for various applications, all while being efficient and performant.

Table of Contents

Features

ImageResizerX offers the following key features:

  • Image Upload: Users can upload images via the /api/v1/upload endpoint. The application automatically resizes the image and saves it to the database, freeing users from the burden of manual resizing.

  • Image Download: Resized images can be easily downloaded using the /api/v1/download/<filename> endpoint. Users can access their resized images whenever needed.

  • Real-Time Updates: ImageResizerX uses WebSocket (WS) to broadcast messages when an image has been resized. Clients can connect to the WebSocket server at /ws/ to receive real-time updates with download links for resized images.

  • User-Friendly-Simple Interface: The project provides a static home page accessible via /. This interface allows users to upload images and connect to the WebSocket for real-time image resizing updates.

Endpoints

  • /api/v1/upload: POST endpoint for image upload. It does not wait for the resized image and immediately returns a response.

  • /api/v1/download/<filename>: GET endpoint to download resized images by providing their unique image_id.

  • /ws/: WebSocket endpoint for real-time updates. It broadcasts messages about the resized images, providing download links.

  • /: The static home page where users can upload images and connect to the WebSocket for real-time image resizing updates.

Getting Started

Prerequisites

Before running ImageResizerX, make sure you have the following prerequisites:

  • Golang installed on your system
  • Docker and Docker Compose (optional for Docker support)

Installation

  1. Clone this repository to your local machine:

    git clone [email protected]:guiflemes/ImageResizerX.git
  2. Install project dependencies:

    # Navigate to the project directory
    cd imageResizerX
    
    # Install Golang dependencies
    go get -d ./...

Usage

  1. Build and run the application:

    # Build the project
    go build
    
    # Run the application
    ./imageResizerX

    The application will be available at http://localhost:8080.

  2. Access the home page (/) to upload images and connect to the WebSocket for real-time updates.

  3. Use the /api/v1/upload endpoint to upload images and the /api/v1/download/<filename> endpoint to download resized images by providing their unique image_id.

Docker Support

ImageResizerX can also be run within a Docker container. To do this, make sure you have Docker and Docker Compose installed, and then run:

docker-compose up

The application will be accessible at http://localhost:8080 just like the local installation.

imageresizerx's People

Watchers

Guilherme Silva avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.