{"id":26915801,"url":"https://github.com/gervaiscodes/serverless-python-thumbnail","last_synced_at":"2025-07-25T01:15:49.262Z","repository":{"id":282768527,"uuid":"949512421","full_name":"gervaiscodes/serverless-python-thumbnail","owner":"gervaiscodes","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-16T16:19:14.000Z","size":106,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-16T20:38:19.880Z","etag":null,"topics":["serverless"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gervaiscodes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-16T16:18:55.000Z","updated_at":"2025-03-16T19:46:25.000Z","dependencies_parsed_at":"2025-03-16T20:38:24.453Z","dependency_job_id":"7f7f0b3f-1923-4265-a445-d29ac299c891","html_url":"https://github.com/gervaiscodes/serverless-python-thumbnail","commit_stats":null,"previous_names":["gervaiscodes/serverless-python-thumbnail"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gervaiscodes%2Fserverless-python-thumbnail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gervaiscodes%2Fserverless-python-thumbnail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gervaiscodes%2Fserverless-python-thumbnail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gervaiscodes%2Fserverless-python-thumbnail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gervaiscodes","download_url":"https://codeload.github.com/gervaiscodes/serverless-python-thumbnail/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246692629,"owners_count":20818719,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["serverless"],"created_at":"2025-04-01T18:39:45.527Z","updated_at":"2025-04-01T18:39:46.149Z","avatar_url":"https://github.com/gervaiscodes.png","language":"Python","readme":"# Serverless Python Thumbnail Generator\n\n## Overview\n\nThis project is a serverless application deployed on AWS using the Serverless Framework. It automatically generates thumbnail images when new images are uploaded to an S3 bucket and stores the URLs in a DynamoDB table.\n\n## Features\n\n- **AWS Lambda-based Thumbnail Generation**: Processes images uploaded to an S3 bucket and generates thumbnails.\n- **DynamoDB Storage**: Stores generated thumbnail URLs and metadata in a DynamoDB table.\n- **API Endpoints**:\n  - List all stored thumbnail URLs.\n  - Retrieve a specific thumbnail by ID.\n  - Delete a thumbnail entry.\n- **Uses AWS Services**:\n  - **S3**: To store original images and thumbnails.\n  - **DynamoDB**: To store metadata.\n  - **Lambda**: For processing images.\n  - **API Gateway**: For exposing RESTful endpoints.\n\n## Project Structure\n\n- `serverless.yml` - Configuration file for the Serverless Framework.\n- `handler.py` - Contains AWS Lambda functions for:\n  - Image processing.\n  - Storing metadata.\n  - Fetching and deleting stored images.\n- `package.json` - Manages dependencies and serverless plugins.\n- `package-lock.json` - Lock file for Node.js dependencies.\n\n## Requirements\n\n- AWS account with appropriate IAM permissions.\n- Node.js and NPM installed.\n- Serverless Framework installed (`npm install -g serverless`).\n- Python 3.8 environment.\n\n## Setup \u0026 Deployment\n\n### Install Dependencies\n\n```sh\nnpm install\n```\n\n### Deploy to AWS\n\n```sh\nserverless deploy\n```\n\n### Environment Variables\n\nConfigured in `serverless.yml`:\n- `THUMBNAIL_SIZE`: The size of the generated thumbnail (default: 128x128).\n- `REGION_NAME`: AWS region (`eu-west-3`).\n- `DYNAMODB_TABLE`: Name of the DynamoDB table (`img-url-table`).\n- `S3_BUCKET`: Name of the S3 bucket (`serverless-thumbnails-24f98d7e`).\n\n## API Endpoints\n\n| Method | Endpoint                 | Description                         |\n|--------|--------------------------|-------------------------------------|\n| GET    | `/images/all`            | Retrieve all stored thumbnails     |\n| GET    | `/images/get/{id}`       | Retrieve a specific thumbnail by ID |\n| DELETE | `/images/delete/{id}`    | Delete a thumbnail entry           |\n\n## How It Works\n\n1. Upload a `.png` image to the S3 bucket.\n2. The Lambda function is triggered and generates a thumbnail.\n3. The thumbnail is stored in the same S3 bucket.\n4. The image metadata (including URL) is stored in DynamoDB.\n5. API endpoints allow fetching and deleting stored images.\n\n## Plugins Used\n\n- `serverless-python-requirements` - Ensures dependencies are packaged properly.\n\n## Contributing\n\nFeel free to submit pull requests or report issues.\n\n## License\n\nMIT License\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgervaiscodes%2Fserverless-python-thumbnail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgervaiscodes%2Fserverless-python-thumbnail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgervaiscodes%2Fserverless-python-thumbnail/lists"}