{"id":19874723,"url":"https://github.com/dxphilo/mio","last_synced_at":"2026-05-14T03:35:46.480Z","repository":{"id":220739257,"uuid":"751573606","full_name":"dxphilo/mio","owner":"dxphilo","description":null,"archived":false,"fork":false,"pushed_at":"2024-02-06T12:43:13.000Z","size":36,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-11T16:52:25.252Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://mio-u5uy.onrender.com/links","language":"Rust","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/dxphilo.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":"2024-02-01T21:50:46.000Z","updated_at":"2024-02-05T20:01:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"415f4ac9-be57-4c30-b866-987aeb9b09e2","html_url":"https://github.com/dxphilo/mio","commit_stats":null,"previous_names":["dxphilo/mio"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxphilo%2Fmio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxphilo%2Fmio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxphilo%2Fmio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxphilo%2Fmio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dxphilo","download_url":"https://codeload.github.com/dxphilo/mio/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241302508,"owners_count":19940838,"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":"2024-11-12T16:25:11.003Z","updated_at":"2026-05-14T03:35:41.449Z","avatar_url":"https://github.com/dxphilo.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mio\n\nThis is a RESTFUl API powering `Bookmark Collection`, a web extension that lets you share your favorite URLs. You can check out the extension [here](https://github.com/dxphilo/bookmark-collector).\n\n## Prerequisites\n\n- Rust (https://www.rust-lang.org/tools/install)\n- MySQL database\n\n## Getting Started\n\n### Setting up the Database\n\n1. Create a MySQL database for your project:\n\n   ```sql\n   CREATE DATABASE your_database_name;\n\n\nCopy the `.env.sample` file to `.env` and update the database connection details:\n\n```\nDATABASE_URL=mysql://username:password@localhost/your_database_name\n```\nReplace `username`, `password`, and `your_database_name` with your MySQL credentials.\n\n\n### Generating Migration\nRun the following command to generate a migration for the links table:\n\n```\ncargo run --bin migration\n```\nThis will create a new migration file in the migrations directory.\n\n### Applying Migration\nApply the migration to create the links table:\n\n```\ncargo run --bin migration -- migrate\n```\n### Starting the Project\n\nInstalling crates\n```\ncargo build\n```\n\nRun the project with:\n\n```\ncargo run\n```\nThe project will start, and you can interact with the API.\n\nThe backend provides two endpoints:\n\n- GET `/links`: Retrieve a list of shared links.\n\n### Success Response:\n\n```\n[\n  {\n    \"id\": 1,\n    \"link\": \"https://www.julian.com/about\",\n    \"count\": 58,\n    \"created_at\": \"2024-02-03T23:05:37Z\",\n    \"updated_at\": \"2024-02-03T23:07:16Z\"\n  },\n  {\n    \"id\": 2,\n    \"link\": \"https://www.julian.com\",\n    \"count\": 18,\n    \"created_at\": \"2024-02-03T23:16:12Z\",\n    \"updated_at\": \"2024-02-03T23:16:22Z\"\n  },\n  {\n    \"id\": 3,\n    \"link\": \"https://www.julian.com/newsletter\",\n    \"count\": 36,\n    \"created_at\": \"2024-02-03T23:16:35Z\",\n    \"updated_at\": \"2024-02-03T23:55:07Z\"\n  }\n]\n```\n\n### error response\n\n```\n{\n\"error\": \"error that occured\"\n}\n\n```\n\n- POST `/links`: Add a new link to the collection.\n\nRequest Body Schema:\n\n```\n{\n  \"link\": \"https://awesome-link.com\"\n}\n```\n#### Success Response:\n\n```\n// Expected Success Response\n{\n  \"id\": 123,\n  \"link\": \"https://example.com\",\n  \"count\": 1,\n  \"created_at\": \"2024-02-03T12:34:56Z\",\n  \"updated_at\": \"2024-02-03T12:34:56Z\"\n}\n\n```\n#### Error Response:\n\n```\n// Expected Error Response\n{\n  \"error\": \"Failed to share the link. Please try again.\"\n}\n\n```\n\n\n\n### Project Structure\n`src/:` Source code directory.\n`migrations/:` Directory containing database migration files.\nDatabase Schema\nsql\n```\nCREATE TABLE links (\n    id INT AUTO_INCREMENT PRIMARY KEY,\n    link VARCHAR(255) NOT NULL,\n    count INT DEFAULT 1 NOT NULL,\n    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP\n);\n```\nAdjust the schema according to your requirements.\n\n### Contributing\nFeel free to contribute to the project by opening issues or submitting pull requests.\n\n### License\nThis project is licensed under the MIT License.\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdxphilo%2Fmio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdxphilo%2Fmio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdxphilo%2Fmio/lists"}