{"id":23107136,"url":"https://github.com/ahmedsomaa/sharpixi","last_synced_at":"2026-04-07T18:32:01.800Z","repository":{"id":136932803,"uuid":"535358214","full_name":"ahmedsomaa/sharpixi","owner":"ahmedsomaa","description":"An awesome image processing api built with Node.js, TypeScript \u0026 Sharp.","archived":false,"fork":false,"pushed_at":"2025-06-03T11:51:51.000Z","size":40416,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-03T13:18:38.732Z","etag":null,"topics":["eslint","expressjs","jasmine","nodejs","prettier","sharp","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/ahmedsomaa.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":"2022-09-11T16:31:27.000Z","updated_at":"2025-06-03T11:51:52.000Z","dependencies_parsed_at":"2023-11-17T12:49:25.692Z","dependency_job_id":null,"html_url":"https://github.com/ahmedsomaa/sharpixi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ahmedsomaa/sharpixi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedsomaa%2Fsharpixi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedsomaa%2Fsharpixi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedsomaa%2Fsharpixi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedsomaa%2Fsharpixi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahmedsomaa","download_url":"https://codeload.github.com/ahmedsomaa/sharpixi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedsomaa%2Fsharpixi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31524525,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["eslint","expressjs","jasmine","nodejs","prettier","sharp","typescript"],"created_at":"2024-12-17T01:12:38.643Z","updated_at":"2026-04-07T18:32:01.774Z","avatar_url":"https://github.com/ahmedsomaa.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sharpixi\n\nAn awesome image processing api built with Node.js, TypeScript \u0026 [Sharp](https://sharp.pixelplumbing.com/).\n\n---\n\n## Tech Stack\n\n- Node.js \u0026 Express for building the API server.\n- [Handlebars](https://handlebarsjs.com/) as the default view engine.\n- [Sharp](https://sharp.pixelplumbing.com/) for image processing.\n- [Bootstrap](https://getbootstrap.com/) for styling.\n\n## Architecture\n\n![diagram](https://user-images.githubusercontent.com/29373629/190209541-58dbb03b-955a-457e-99e5-983fbe288120.jpg)\n\n## Run locally\n\n- Install dependencies `npm install`.\n\n- Run `npm run build` to create a production build.\n\n- Rename `.env.example` to `.env` file and provide a value for `PORT`.\n\n- Run `npm run start` to start the server.\n\n- Open you browser and navigate to `http://localhost:\u003cPORT\u003e/` to see the resizer page.\n\n## Unit tests\n\nThe tests are written in jasmine. To run the tests: `npm run build \u0026\u0026 npm run test`.\n\n### Coverage\n\n- Express App Tests Suit\n  - Serve Favicon\n  - Serve Static Files\n  - Use Handlebars as view engine\n- Main Router Tests Suit\n  - Return 200\n  - Return html document\n- Image Router Tests Suit\n  - `GET /api/{resize | convert}` Requests\n    - Return 400 for empty query string\n    - Return 422 for invalid query string\n    - Return 404 if image does not exist\n    - Return 200 with resized image for valid query string\n    - Return 200 with resized image for the same query string\n- Image Helper Tests Suit\n  - `imageExists` method\n    - Return file name with extension if file exists in directory\n    - Return \"File does not exist\" if file does not exist in directory\n  - `getAllImages` method\n    - Return a list of 5 images\n  - `resolveImageDirectoryPath` method\n    - Return directory full path as string\n  - `resolveToSourceAndTarget` method\n    - Return an object with source \u0026 target keys\n- Sharp Service Tests Suit\n  - `resize` service\n    - Should delete the resized file if exists \u0026 create a new fresh one\n    - Return \"File does not exist\" if file does not exist in directory\n  - `convert` service\n    - Should delete the resized file if exists \u0026 create a new fresh one\n\n## Available Scripts\n\n- `dev`: to start the development server\n- `start`: to start the production server\n- `test`: to run jasmine tests on production build\n- `lint`: to run eslint on the project's typescript files\n- `clean`: to remove old builds before building a new one\n- `lint:fix`: to fix issues identified by eslint\n- `postbuild`: to copy views folder to the production build folder.\n- `format`: to run prettier on the project's typescript files\n\n## Available APIs\n\n- `/api/resize` to resize an image with a given query string for example `?filename=fjord\u0026width=200\u0026height=600`.\n\n- `/api/convert` to convert an image with a given query string to the given format for example\n  `?filename=fjord\u0026format=png`. Supported conversion types are `[jpg, png, avif, jpeg, webp]`.\n\n- `/{full | thumbs}/{image_name}` to serve static image files for example `/full/fjord.jpg`.\n\n## Demo\n\nhttps://user-images.githubusercontent.com/29373629/190127515-60a97f3f-fc40-4225-9c01-584974aa8743.mp4\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmedsomaa%2Fsharpixi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahmedsomaa%2Fsharpixi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmedsomaa%2Fsharpixi/lists"}