Git Product home page Git Product logo

google-image-downloader's Introduction

Google Image Downloader

Using this service, you can search for mixed words in Google and save the results of the found photos This service is written as full reactive programming (asynchronous) and works as no-blocking After receiving the number of photos desired by the user and receiving and displaying its information to the user asynchronously, it will start receiving resizing and saving the photos to postgres database.

More info

The stored photos are stored in the image table, and in the data field, the photo is stored as an oid of LOB type You can use the following sql command to get the photo binary

select lo_get(data) from image limit 1;

Requirements

  • Java >=17
  • Maven >=3.6
  • Postgres >=15
  • Docker Engine >=24

Setup and run

  1. Run bellow command for compile project
cd <PROJECT_DIR>
./mvnw clean package
  1. Setup application.yml
  2. Run bellow command for run project
cd <PROJECT_DIR>
java -jar target/<application_name>.jar

Run by docker

first set environment variable in docker compose file

SERVER_PORT: 8081
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/image_downloader
SPRING_DATASOURCE_USERNAME: postgres
SPRING_DATASOURCE_PASSWORD: postgres
GOOGLE_APIKEY: ""
GOOGLE_CX: ""
IMAGE_RESIZE_WIDTH: 100
IMAGE_RESIZE_HEIGHT: 100

next run docker compose by bellow command

cd <PROJECT_DIR>
docker compose up -d

Configuration

Database configuration

spring:
  datasource:
    url: "jdbc:postgresql://<HOST>:<PORT>/image_downloader"
    username: "<USERNAME>"
    password: "<PASSWORD>"

Google properties

Set bellow properties for Google search :

google:
  api-key: "<API_KEY>"
  cx: "<SEARCH_ENGINE_ID>"

You can refer to this link to get api-key
And refer to this link to get cx

Set bellow property for image resize :

image:
  resize:
    width: "<WIDTH_SIZE>"
    height: "<HEIGHT_SIZE>"

Using

The project includes Swagger documentation. To use it, you can open the following URL in your browser while the application is running:

http://localhost:8081/webjars/swagger-ui/index.html

google-image-downloader's People

Contributors

mohammad-mazraeshahi avatar

Watchers

 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.