{"id":15138151,"url":"https://github.com/onfranciis/linkly-rs","last_synced_at":"2025-10-23T13:31:13.190Z","repository":{"id":231250778,"uuid":"781253711","full_name":"onfranciis/linkly-rs","owner":"onfranciis","description":"A url shortener server built with Rust, PostgreSQL and Redis on Rocket - Bitly alternative","archived":false,"fork":false,"pushed_at":"2024-09-14T15:16:43.000Z","size":99,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-30T18:51:58.174Z","etag":null,"topics":["bitly","learn","linkly-rs","postgresql","redis","rocket","rust","sql","student-vscode"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/onfranciis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING.txt","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":"2024-04-03T03:10:11.000Z","updated_at":"2024-09-14T15:16:47.000Z","dependencies_parsed_at":"2024-04-03T05:26:54.943Z","dependency_job_id":"8282b2d4-a2fa-4eef-ad4c-f33f1c378fb2","html_url":"https://github.com/onfranciis/linkly-rs","commit_stats":null,"previous_names":["onfranciis/linkly","onfranciis/linkly-rs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onfranciis%2Flinkly-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onfranciis%2Flinkly-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onfranciis%2Flinkly-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onfranciis%2Flinkly-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/onfranciis","download_url":"https://codeload.github.com/onfranciis/linkly-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237834740,"owners_count":19373784,"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":["bitly","learn","linkly-rs","postgresql","redis","rocket","rust","sql","student-vscode"],"created_at":"2024-09-26T07:20:56.183Z","updated_at":"2025-10-23T13:31:07.807Z","avatar_url":"https://github.com/onfranciis.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Linkly RS\n\n### Bitly, but on rust\n\nLinkly RS is a url shortner service built on Rust using the [Rocket](https://rocket.rs/) web server framework, Redis and PostgreSQL database. It's easy to host, just have the [rust tool chain](https://www.rust-lang.org/tools/install) installed on your system and an env file with the configuration below.\n\n```bash\nROCKET_PORT=1234\nREDIS_URL=redis://\u003curl\u003e\nDATABASE_URL=postgres://\u003cusername\u003e:\u003cpassword\u003e@\u003curl\u003e/linkly_rs\n\n# NOTE\n# - There must always be DATABASE_URL because that's what sqlx uses to query macros online\n# - You MIGHT run into docker issues if your env file has space and/or quotes\n\n\n```\n\n\u003cbr\u003e\n\nNow, in your directory, run\n\n```bash\n$ cargo run\n```\n\n## API\n\nThis service offers 4 end points\n\n- **GET** /\n  \u003cbr\u003e\n  This is a health check end point.\n\n  \u003cbr\u003e\n\n  **_Response_**\n\n  ```json\n  // OK - 200\n  {\n    \"connected\": true\n  }\n  ```\n\n  \u003cbr\u003e\n\n- **POST** /url\n  \u003cbr\u003e\n  Add new url\n\n  \u003cbr\u003e\n\n  **_Body_**\n\n  ```json\n  // x-www-form-urlencoded\n  {\n    \"url\": \"onfranciis.dev\"\n  }\n  ```\n\n  \u003cbr\u003e\n\n  **_Response_**\n\n  ```json\n  // OK - 200\n  {\n    \"result\": {\n      \"id\": 5,\n      \"long\": \"http://onfranciis.dev\",\n      \"short\": \"a4f8\",\n      \"date\": \"05 Jun-2024 06:58:00am +0100\"\n    },\n    \"err\": null\n  }\n  ```\n\n  ```json\n  // Conflict - 409\n  {\n    \"result\": null,\n    \"err\": \"Seems like this url has already been shortened! Is it 'a4f8' ?\"\n  }\n  ```\n\n  \u003cbr\u003e\n\n- **GET** /url/{id}\n  \u003cbr\u003e\n  Redirect if successful\n\n  \u003cbr\u003e\n\n  **_Response_**\n\n  ```json\n  // Not Found - 404\n  {\n    \"result\": null,\n    \"err\": \"This url is invalid! Kindly confirm\"\n  }\n  ```\n\n- **GET** /url\n  \u003cbr\u003e\n  Return all urls\n\n  \u003cbr\u003e\n\n  **_Response_**\n\n  ```json\n  // OK - 200\n  {\n    \"result\": [\n      {\n        \"id\": 3,\n        \"long\": \"http://google.com\",\n        \"short\": \"00a5\",\n        \"date\": \"02 Jun-2024 13:40:56pm +0100\"\n      },\n      {\n        \"id\": 5,\n        \"long\": \"http://onfranciis.dev\",\n        \"short\": \"a4f8\",\n        \"date\": \"05 Jun-2024 06:58:00am +0100\"\n      },\n      {\n        \"id\": 6,\n        \"long\": \"http://test.com\",\n        \"short\": \"e423\",\n        \"date\": \"05 Jun-2024 07:06:43am +0100\"\n      }\n    ],\n    \"err\": null\n  }\n  ```\n\n\u003cbr\u003e\n\n![Rust](https://img.shields.io/badge/rust-%23000000.svg?style=for-the-badge\u0026logo=rust\u0026logoColor=white) ![Postgres](https://img.shields.io/badge/postgres-%23316192.svg?style=for-the-badge\u0026logo=postgresql\u0026logoColor=white) ![Linux](https://img.shields.io/badge/Linux-FCC624?style=for-the-badge\u0026logo=linux\u0026logoColor=black) ![VS Code Insiders](https://img.shields.io/badge/VS%20Code%20Insiders-35b393.svg?style=for-the-badge\u0026logo=visual-studio-code\u0026logoColor=white) ![Redis](https://img.shields.io/badge/redis-%23DD0031.svg?style=for-the-badge\u0026logo=redis\u0026logoColor=white)\n\nFor support and enquiries, reach out via [hello@onfranciis.dev](mailto:hello@onfranciis.dev)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonfranciis%2Flinkly-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonfranciis%2Flinkly-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonfranciis%2Flinkly-rs/lists"}