{"id":26671647,"url":"https://github.com/sh20raj/imgsharp","last_synced_at":"2025-03-25T23:52:31.369Z","repository":{"id":283783877,"uuid":"915343707","full_name":"SH20RAJ/imgsharp","owner":"SH20RAJ","description":"ImgSharp is a scalable image processing service that allows you to upload, transform, and serve images through a CDN, similar to Cloudinary.","archived":false,"fork":false,"pushed_at":"2025-01-11T15:52:13.000Z","size":1127,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-22T06:32:24.456Z","etag":null,"topics":["image","image-processing","imgsharp","sharp"],"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/SH20RAJ.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-01-11T15:52:10.000Z","updated_at":"2025-01-12T02:37:01.000Z","dependencies_parsed_at":"2025-03-22T06:32:27.027Z","dependency_job_id":"ab25cf5a-6850-4ba0-a1d5-12198040d88d","html_url":"https://github.com/SH20RAJ/imgsharp","commit_stats":null,"previous_names":["sh20raj/imgsharp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SH20RAJ%2Fimgsharp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SH20RAJ%2Fimgsharp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SH20RAJ%2Fimgsharp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SH20RAJ%2Fimgsharp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SH20RAJ","download_url":"https://codeload.github.com/SH20RAJ/imgsharp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245562961,"owners_count":20635907,"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":["image","image-processing","imgsharp","sharp"],"created_at":"2025-03-25T23:52:30.813Z","updated_at":"2025-03-25T23:52:31.362Z","avatar_url":"https://github.com/SH20RAJ.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ImgSharp - Image Processing Service\n\nImgSharp is a scalable image processing service that allows you to upload, transform, and serve images through a CDN, similar to Cloudinary.\n\n## Architecture\n\nThe service follows a serverless architecture using:\n- AWS S3 for storage (original and transformed images)\n- AWS Lambda for image transformations\n- CloudFront as CDN\n- FastAPI for the backend API\n\n## Features\n\n- Image upload to S3\n- On-demand image transformations\n- CDN delivery\n- Caching of transformed images\n- Support for various image operations (resize, format conversion)\n\n## Setup\n\n1. Clone the repository\n2. Install dependencies:\n```bash\npip install -r requirements.txt\n```\n\n3. Copy `.env.example` to `.env` and fill in your AWS credentials and other settings:\n```bash\ncp .env.example .env\n```\n\n4. Create two S3 buckets:\n   - One for original images\n   - One for transformed images\n\n5. Set up CloudFront distribution pointing to both S3 buckets\n\n## Running the Service\n\nStart the FastAPI server:\n```bash\nuvicorn app.main:app --reload\n```\n\n## API Endpoints\n\n### Upload Image\n```\nPOST /upload\n```\nUpload an image file. Returns the URL of the uploaded image.\n\n### Transform Image\n```\nGET /transform/{key}?width=400\u0026height=400\n```\nTransform an image with specified parameters. Returns the URL of the transformed image.\n\n## AWS Setup Requirements\n\n1. S3 Buckets:\n   - Create two buckets: one for original images and one for transformed images\n   - Enable CORS on both buckets\n   - Set up proper bucket policies\n\n2. CloudFront:\n   - Create a distribution pointing to both S3 buckets\n   - Configure cache behaviors\n   - Set up CORS headers\n\n3. IAM:\n   - Create an IAM user with appropriate S3 permissions\n   - Generate access keys for the user\n\n## Environment Variables\n\n- `AWS_ACCESS_KEY_ID`: Your AWS access key\n- `AWS_SECRET_ACCESS_KEY`: Your AWS secret key\n- `AWS_REGION`: AWS region (e.g., us-east-1)\n- `S3_BUCKET_ORIGINAL`: Bucket name for original images\n- `S3_BUCKET_TRANSFORMED`: Bucket name for transformed images\n- `CLOUDFRONT_DOMAIN`: Your CloudFront distribution domain\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsh20raj%2Fimgsharp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsh20raj%2Fimgsharp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsh20raj%2Fimgsharp/lists"}