{"id":19776961,"url":"https://github.com/madeindra/url-shortener","last_synced_at":"2026-05-07T18:08:11.454Z","repository":{"id":213771307,"uuid":"734341438","full_name":"madeindra/url-shortener","owner":"madeindra","description":"URL Shortener built using Typescript with Fastify and SQLite","archived":false,"fork":false,"pushed_at":"2023-12-25T05:48:25.000Z","size":278,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-28T12:13:56.845Z","etag":null,"topics":["fastify","shortener","sqlite","typescript","url"],"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/madeindra.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-21T12:50:43.000Z","updated_at":"2023-12-23T06:04:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"b28e59ae-40ba-4387-818e-89c567b49116","html_url":"https://github.com/madeindra/url-shortener","commit_stats":null,"previous_names":["madeindra/url-shortener"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/madeindra/url-shortener","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madeindra%2Furl-shortener","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madeindra%2Furl-shortener/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madeindra%2Furl-shortener/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madeindra%2Furl-shortener/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/madeindra","download_url":"https://codeload.github.com/madeindra/url-shortener/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madeindra%2Furl-shortener/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260301992,"owners_count":22988721,"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","shortener","sqlite","typescript","url"],"created_at":"2024-11-12T05:22:38.596Z","updated_at":"2026-05-07T18:08:06.422Z","avatar_url":"https://github.com/madeindra.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# URL Shortener\n\nSimple URL shortener built using Typescript with Fastify and SQLite.\n\n![preview](https://raw.githubusercontent.com/madeindra/url-shortener/master/preview.png \"preview\")\n\n## Installation\n\n1. Clone the repository\n```\ngit clone https://github.com/madeindra/url-shortener.git\n```\n\n2. Install dependencies\n```\nnpm install\n```\n\n3. Build the project\n```\nnpm run build\n```\n\n4. Export environment variables:\n```\nexport PORT=3000\nexport HOST=localhost\nexport DB_PATH=database.db\nexport DB_TABLENAME=urls\n```\n\n5. Start the server \n```\nnpm start\n```\n\n## Docker\n\n1. Build the image\n\n```\ndocker build \\\n--build-arg PORT=3000 \\\n--build-arg HOST=0.0.0.0 \\\n--build-arg DB_PATH=database.db \\\n--build-arg DB_TABLENAME=urls \\\n--no-cache \\\n. -t yourusername/url-shortener:latest\n```\n\n2. Run the container\n\n```\ndocker run -d -p 3000:3000 yourusername/url-shortener:latest\n```\n\n## Usage\n\n1. Open your browser and visit `http://localhost:3000`\n\n2. Input your URL and custom slug (optional) to the form\n\n3. Click `Shorten` button\n\n4. Copy the shortened URL\n\n## API Documentation\n\n### Create Short URL\n\nPOST /shorten\n\n```\n{\n    \"originalUrl\": \"https://www.google.com\",\n    \"customSlug\": \"google\"\n}\n```\n\n### Get Original URL\n\nGET /:slug\n\n## TODOs\n- [X] Add homepage with form to shorten URL\n- [X] Add docker support\n- [ ] Add testings","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadeindra%2Furl-shortener","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmadeindra%2Furl-shortener","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadeindra%2Furl-shortener/lists"}