Flask Image Downloader is a simple web application built with Flask and Boto3 that allows users to search for and download images from an AWS S3 bucket.
Before you begin, ensure you have met the following requirements on your system:
- Python 3.8 or higher is installed.
- AWS account.
aws-cliinstalled and configured.- Public AWS S3 bucket
- EC2 with
tier:apptag. feel free to use myrun_instance.shto setup your EC2.
ChangeREGIONindeploy.shif needed.
-
Clone the repository:
git clone https://github.com/Raz-Dahan/image_downloader.git cd image_downloader -
Install the required Python packages:
pip install -r app/requirements.txt
-
Set up your AWS credentials and S3 bucket name by creating a
.envfile on your local machine and update theENV_Pathindeploy.sh. Example:AWS_ACCESS_KEY_ID=your_access_key_id AWS_SECRET_ACCESS_KEY=your_secret_access_key S3_BUCKET_NAME=your_bucket_name -
Place AWS RSA key file on your local machine and update the
RSA_Keyindeploy.sh.
-
Run the Flask application localy:
python3 app/app.py
Alternatively you can run the application as a Docker container on an AWS EC2:
chmod u+x deploy.sh ./deploy.sh
-
Access the application in your VM's IP at
http://IP:80. -
Enter a search term for the image you want to download and click the "Download" button.
-
If the image is found in the S3 bucket, it will be downloaded to your local machine.
-
app.py: This is the main Flask application script that handles routing, user interface, and interaction with the S3 bucket. Modify this file to customize the behavior of the application. -
templates/index.html: This HTML template defines the user interface for the application. You can modify the template's structure and styling to match your preferences.
Contributions are welcome! If you find any issues or have suggestions for improvement, feel free to submit a pull request or open an issue.
This project is licensed under the MIT License.