{"id":20856838,"url":"https://github.com/techlism/imagesage-backend","last_synced_at":"2026-04-29T05:35:45.533Z","repository":{"id":184295143,"uuid":"671621448","full_name":"techlism/imagesage-backend","owner":"techlism","description":null,"archived":false,"fork":false,"pushed_at":"2023-09-13T20:10:55.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-12T13:43:33.428Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/techlism.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":"2023-07-27T18:38:24.000Z","updated_at":"2023-07-27T18:39:00.000Z","dependencies_parsed_at":"2024-11-18T04:35:27.022Z","dependency_job_id":"d9224943-353c-4038-9e8e-2b52fe27b658","html_url":"https://github.com/techlism/imagesage-backend","commit_stats":null,"previous_names":["techlism/imagesage-backend"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/techlism/imagesage-backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techlism%2Fimagesage-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techlism%2Fimagesage-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techlism%2Fimagesage-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techlism%2Fimagesage-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/techlism","download_url":"https://codeload.github.com/techlism/imagesage-backend/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techlism%2Fimagesage-backend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32412890,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T05:20:56.964Z","status":"ssl_error","status_checked_at":"2026-04-29T05:19:54.749Z","response_time":110,"last_error":"SSL_read: 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":[],"created_at":"2024-11-18T04:34:50.276Z","updated_at":"2026-04-29T05:35:45.504Z","avatar_url":"https://github.com/techlism.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ImageSage API\n\nThe ImageSage API is a service designed to allow users to search for images, mark images as favorites, and keep track of downloaded images. \u003cbr\u003e It is built using Node.js with Express for handling HTTP requests, MongoDB for data storage, and integrates with Pixabay API for image search functionality.\n\nAPI is deployed at : https://imagesage.onrender.com (root route)\n\n## Routes\n### 1. `POST /favorites`\n\nAllows users to add images to their list of favorites.\n\n- **Request Body**:\n  - `email` (string): User's email address.\n  - `imageId` (string): ID of the image being favorited.\n\n- **Response**:\n  - `message` (string): Confirmation message.\n\n### 2. `POST /downloads`\n\nAllows users to mark images as downloaded.\n\n- **Request Body**:\n  - `email` (string): User's email address.\n  - `imageId` (string): ID of the downloaded image.\n\n- **Response**:\n  - `message` (string): Confirmation message.\n\n### 3. `POST /checkfav`\n\nChecks if an image is in a user's list of favorites.\n\n- **Request Body**:\n  - `email` (string): User's email address.\n  - `imageId` (string): ID of the image being checked.\n\n- **Response**:\n  - Status Codes:\n    - `200 OK`: Image is in favorites.\n    - `404 Not Found`: User not found.\n\n### 4. `GET /`\n\nEndpoint to retrieve images from Pixabay based on a search query.\n\n- **Query Parameters**:\n  - `query` (string): Search query.\n  - `page` (number): Page number for pagination.\n\n- **Response**:\n  - JSON object containing Pixabay API response.\n  - Refer to Pixabay's API details for the format.\n  - Can be directly accessed at : https://imagesage.onrender.com/ \n\n### 5. `GET /favorites`\n\nRetrieves a user's list of favorite images.\n\n- **Request Headers**:\n  - `email` (string): User's email address.\n\n- **Response**:\n  - JSON object with an array of favorite image IDs.\n\n### 6. `GET /downloads`\n\nRetrieves a user's list of downloaded images.\n\n- **Request Headers**:\n  - `email` (string): User's email address.\n\n- **Response**:\n  - JSON object with an array of downloaded image IDs.\n\n### 7. `GET /images/:id`\n\nRetrieve details of a specific image by its ID.\n\n- **URL Parameter**:\n  - `id` (string): ID of the image.\n\n- **Response**:\n  - JSON object with image details.\n\n## Setting Up\n\n1. Install dependencies using `npm install`.\n2. Create a `.env` file and define the following variables:\n   - `JWKS_URI`: URL to JWKS (JSON Web Key Set) for JWT validation.\n   - `AUDIENCE`: Audience for JWT validation.\n   - `DB_CONNECTION`: MongoDB connection URI.\n   - `PIXABAY_KEY`: API key for Pixabay API.\n   - `PORT`: Port for the server to listen on.\n\n3. Start the server using `npm start`.\n\n## Dependencies\n\n- `express`: Web application framework for Node.js.\n- `cors`: Middleware for enabling Cross-Origin Resource Sharing.\n- `express-jwt`: Middleware for validating JWT tokens.\n- `jwks-rsa`: Library for retrieving RSA JSON Web Keys.\n- `axios`: Promise-based HTTP client for making requests.\n- `dotenv`: Loads environment variables from a `.env` file.\n- `body-parser`: Middleware for parsing JSON request bodies.\n- `mongoose`: ODM library for MongoDB.\n\n## Database\n\nThis API uses MongoDB to store user data, including favorites and downloads.\n\n## Usage\nSince it was for a personal project only the root route is free to use.\n\u003cbr\u003e You can deploy the full project using the ImageSage frontend : https://github.com/techlism/imagesage-frontend\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechlism%2Fimagesage-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechlism%2Fimagesage-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechlism%2Fimagesage-backend/lists"}