{"id":26678116,"url":"https://github.com/telexintegrations/telin-profile-icon-agent","last_synced_at":"2025-03-26T05:14:57.608Z","repository":{"id":282414346,"uuid":"948495836","full_name":"telexintegrations/telin-profile-icon-agent","owner":"telexintegrations","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-21T15:52:35.000Z","size":148,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-21T16:55:44.511Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/telexintegrations.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-14T12:46:35.000Z","updated_at":"2025-03-21T15:52:39.000Z","dependencies_parsed_at":"2025-03-14T14:38:29.467Z","dependency_job_id":null,"html_url":"https://github.com/telexintegrations/telin-profile-icon-agent","commit_stats":null,"previous_names":["telexintegrations/telin-profile-icon-agent"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telexintegrations%2Ftelin-profile-icon-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telexintegrations%2Ftelin-profile-icon-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telexintegrations%2Ftelin-profile-icon-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telexintegrations%2Ftelin-profile-icon-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/telexintegrations","download_url":"https://codeload.github.com/telexintegrations/telin-profile-icon-agent/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245591534,"owners_count":20640692,"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":[],"created_at":"2025-03-26T05:14:56.876Z","updated_at":"2025-03-26T05:14:57.577Z","avatar_url":"https://github.com/telexintegrations.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Profile Icon Agent\n\n## Overview\nProfile Icon Agent is an AI-powered service that automatically detects faces in images, crops and resizes them with proper padding, and returns a processed image URL. The service integrates with Telex to send processed image notifications.\n\n## Features\n- Uses AI for face detection via Imagga API.\n- Crops and resizes images with padding for optimal profile photos.\n- Uploads processed images to Cloudinary.\n- Returns a shareable URL for the cropped image.\n- Integrates with Telex for notifications.\n\n## Technologies Used\n- **Node.js** (Express.js)\n- **TypeScript**\n- **Cloudinary** (Image Storage)\n- **Imagga API** (Face Detection)\n- **Telex** (Messaging \u0026 Notification Service)\n- **Sharp** (Image Processing)\n- **Axios** (HTTP Requests)\n- **Dotenv** (Environment Variables)\n\n## Installation\n### Prerequisites\n- Node.js installed\n- Cloudinary account (for image storage)\n- Imagga API credentials (for face detection)\n- Ngrok (if testing locally with Telex webhook)\n\n### Steps\n1. Clone the repository:\n   ```sh\n   git clone https://github.com/telexintegrations/telin-profile-icon-agent.git\n   cd profile-icon-agent\n   ```\n2. Install dependencies:\n   ```sh\n   npm install\n   ```\n3. Create a `.env` file and add the following:\n   ```env\n   PORT=3000\n   CLOUDINARY_CLOUD_NAME=your_cloud_name\n   CLOUDINARY_API_KEY=your_api_key\n   CLOUDINARY_API_SECRET=your_api_secret\n   IMAGGA_API_KEY=your_imagga_api_key\n   IMAGGA_API_SECRET=your_imagga_api_secret\n   ```\n4. Start the server:\n   ```sh\n   npm run dev\n   ```\n\n## API Endpoints\n### 1. Get Integration Config\n**Endpoint:** `GET /api/v1/integration-config`\n\n**Response:**\n```json\n{\n  \"app_name\": \"Profile Icon Agent\",\n  \"app_description\": \"A service that crops and resizes user profile photos using face detection and returns the processed image URL.\"\n}\n```\n\n### 2. Process Image (Webhook)\n**Endpoint:** `POST /api/v1/target-url`\n\n**Request Body:**\n```json\n{\n  \"message\": \"/image https://example.com/sample.jpg\"\n}\n```\n\n**Response:**\n```json\n{\n  \"message\": \"Success\"\n}\n```\n\n## How It Works\n1. A user sends an image URL with the `/image` command.\n2. The service extracts the image URL.\n3. Imagga API detects faces in the image.\n4. The image is cropped and resized with padding.\n5. The processed image is uploaded to Cloudinary.\n6. A response with the processed image URL is sent to Telex.\n\n## Error Handling\n- Invalid or missing image URLs return `400 Bad Request`.\n- If no face is detected, the response includes an error message.\n- Failed Cloudinary uploads return `500 Internal Server Error`.\n\n## Contribution\n1. Fork the repository.\n2. Create a feature branch (`git checkout -b feature-branch`).\n3. Commit changes (`git commit -m \"Add new feature\"`).\n4. Push to branch (`git push origin feature-branch`).\n5. Open a Pull Request.\n\n## License\nThis project is licensed under the MIT License.\n\n## Contact\nFor any questions or contributions, reach out to [mailto:jjoshuadomfa@gmail.com](mailto:jjoshuadomfa@gmail.com) or [mailto:estheradexdainty@gmail.com](mailto:estheradexdainty@gmail.com).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftelexintegrations%2Ftelin-profile-icon-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftelexintegrations%2Ftelin-profile-icon-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftelexintegrations%2Ftelin-profile-icon-agent/lists"}