{"id":24497279,"url":"https://github.com/rioba-ian/urlshortener-restapi","last_synced_at":"2026-05-11T09:20:23.182Z","repository":{"id":214098541,"uuid":"735676094","full_name":"Rioba-Ian/urlshortener-restapi","owner":"Rioba-Ian","description":"rest api for shortening urls with mongodb and job queues","archived":false,"fork":false,"pushed_at":"2023-12-28T16:11:30.000Z","size":99,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-21T21:35:50.440Z","etag":null,"topics":["fastify","mongodb"],"latest_commit_sha":null,"homepage":"https://urlshortener-restapi.vercel.app","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/Rioba-Ian.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-12-25T19:28:49.000Z","updated_at":"2024-03-06T11:10:08.000Z","dependencies_parsed_at":"2023-12-25T21:09:14.811Z","dependency_job_id":"10d2aafb-ed57-4020-a06b-3c078762085c","html_url":"https://github.com/Rioba-Ian/urlshortener-restapi","commit_stats":null,"previous_names":["rioba-ian/urlshortener-restapi"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rioba-Ian%2Furlshortener-restapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rioba-Ian%2Furlshortener-restapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rioba-Ian%2Furlshortener-restapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rioba-Ian%2Furlshortener-restapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rioba-Ian","download_url":"https://codeload.github.com/Rioba-Ian/urlshortener-restapi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243693338,"owners_count":20332375,"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":["fastify","mongodb"],"created_at":"2025-01-21T21:33:23.753Z","updated_at":"2026-05-11T09:20:23.129Z","avatar_url":"https://github.com/Rioba-Ian.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# URL Shortener API\n\nThis project is a URL shortener API built with Fastify, TypeScript, and Prisma. It provides a service that takes long URLs and generates shorter, more manageable URLs.\n\n## Technologies Used\n\n- Fastify: A web framework for Node.js known for its high performance and low overhead.\n- TypeScript: A statically typed superset of JavaScript that adds types to the language.\n- Prisma: A database toolkit used for database operations.\n\n## Deployment\n\n- Vercel: Serverless vercel functions\n\n## API Endpoints\n\n- `POST /api/shorturl`: Creates a new short URL.\n\n  - Request body should be a JSON object with a `destination` property containing the URL to shorten.\n  - Returns a JSON object with the short URL.\n\n- `GET /api/shorturl/:shortId`: Redirects to the original URL associated with the given `shortId`.\n  - `shortId` should be replaced with the ID of the short URL.\n  - Increments the count in the analytics for the URL.\n\n## How to Consume the API\n\nYou can consume the API using any HTTP client like `fetch` in JavaScript, `requests` in Python, or tools like Postman. Here's an example using `fetch`:\n\n```js\n// Create a new short URL\nfetch(\"http://localhost:3000/api/shorturl\", {\n method: \"POST\",\n headers: {\"Content-Type\": \"application/json\"},\n body: JSON.stringify({destination: \"https://example.com\"}),\n})\n .then((response) =\u003e response.json())\n .then((data) =\u003e console.log(data));\n```\n\n### Acknowledgements\n\n- Author: Ian Rioba\n\n## How to Improve the API\n\nContributions are welcome! Feel free to fork the repository and submit pull requests. You can also open issues for any bugs or improvements you want to suggest.\n\nBefore contributing, please make sure to understand the project structure and technologies used. If you have any questions, don't hesitate to ask.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frioba-ian%2Furlshortener-restapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frioba-ian%2Furlshortener-restapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frioba-ian%2Furlshortener-restapi/lists"}