{"id":15435420,"url":"https://github.com/neuodev/memorable","last_synced_at":"2025-03-28T06:14:10.069Z","repository":{"id":139101060,"uuid":"585170345","full_name":"neuodev/memorable","owner":"neuodev","description":"Rust based CRUD API for managing todos list. Intended as a testing API for people who just started working with JS fetch API","archived":false,"fork":false,"pushed_at":"2023-01-07T05:39:18.000Z","size":73,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-20T02:48:49.252Z","etag":null,"topics":["crud-api","fetch-api","rust"],"latest_commit_sha":null,"homepage":"https://memorable.ahmedibrahim.dev/api/v1/","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/neuodev.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-01-04T13:53:08.000Z","updated_at":"2023-01-07T06:54:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"1012e33a-2c82-4f58-9c73-0745e595ed1f","html_url":"https://github.com/neuodev/memorable","commit_stats":{"total_commits":13,"total_committers":1,"mean_commits":13.0,"dds":0.0,"last_synced_commit":"40746633572087921edc8eb7055e569e1a9dd043"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuodev%2Fmemorable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuodev%2Fmemorable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuodev%2Fmemorable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuodev%2Fmemorable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neuodev","download_url":"https://codeload.github.com/neuodev/memorable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245978277,"owners_count":20703678,"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":["crud-api","fetch-api","rust"],"created_at":"2024-10-01T18:44:15.349Z","updated_at":"2025-03-28T06:14:10.028Z","avatar_url":"https://github.com/neuodev.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Memorable\n\nThis API is inteneded for developers who are still learning the **[Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)** and the basic _CRUD_ operations (Create, Read, Update, Delete).\n\nIt can be used as teach/learning materials to grasp the basics of how the client (Web/Mobile) should interact with the server!\n\n# How it works\n\nThe project doesn't use any database to store the data. Instead, it stores data **in memory** and uses the **client's IP address** to map the client to its own data. to avoid the server running out of memory, the server clears the cache every certain period of time and will put a limit on how much you can store on the server.\n\n# API\n\n| Method   | Route                | Description                     |\n| -------- | -------------------- | ------------------------------- |\n| `POST`   | `/api/v1/todos`      | **Create** new todo             |\n| `GET`    | `/api/v1/todos`      | **Get** todos list              |\n| `GET`    | `/api/v1/todos/{id}` | **Get** todo item using `ID`    |\n| `PUT`    | `/api/v1/todos/{id}` | **Update** todo item using `ID` |\n| `DELETE` | `/api/v1/todos/{id}` | **Delete** todo item using `ID` |\n\n### Create TODO\n\n###### Route: `POST /api/v1/todos`\n\n###### Request body\n\nAll fileds are required, will get `401` status code if any field is missing or invalid.\n\n```rs\nstruct CreateTodo {\n    title: String,\n    desc: String,\n    is_done: bool,\n}\n```\n\n###### JS Example\n\n```js\nfetch(\"https://memorable.ahmedibrahim.dev/api/v1/todos\", {\n  method: \"POST\",\n  headers: {\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    title: \"Learn fetch api\",\n    desc: \"learning the basic CRUD operations\",\n    is_done: false,\n  }),\n})\n  .then((res) =\u003e res.text())\n  .then(console.log);\n// {\"message\":\"Todo created successfully\"}\n```\n\n### Get TODOs\n\n###### Route: `GET /api/v1/todos`\n\n###### Response:\n\nArray of all todos\n\n```rs\nstruct Todo {\n    id: usize,\n    title: String,\n    desc: String,\n    is_done: bool,\n}\n```\n\n###### JS Example\n\n```js\nfetch(\"https://memorable.ahmedibrahim.dev/api/v1/todos\")\n  .then((res) =\u003e res.json())\n  .then(console.log);\n\n// Response\n[\n  {\n    id: 1,\n    title: \"Learn fetch api\",\n    desc: \"learning the basic CRUD operations\",\n    is_done: false,\n  },\n];\n```\n\n### Get Todo Item\n\nGet todo item by **id**.\n\n###### Route: `GET /api/v1/todos/{id}`\n\n###### Response:\n\nWill respond with the todo item and status code **200 (success)** if it exists. Will return 404 (not found) status code.\n\n###### JS Example\n\n```js\nfetch('https://memorable.ahmedibrahim.dev/api/v1/todos/1').then(res =\u003e res.json()).then(console.log)\n\n\n// Response\n{\n    \"id\": 1,\n    \"title\": \"Learn fetch api\",\n    \"desc\": \"learning the basic CRUD operations\",\n    \"is_done\": false\n}\n```\n\n### Update todo by id\n\n###### Route: `PUT /api/v1/todos/{id}`\n\n###### Request:\n\nIn the request body can include any todo feild other than the ID (`title`, `desc`, `is_done`).\n\n###### Response:\n\nThe API will respond back with the new updated todo.\n\n###### JS Example\n\n```js\nfetch('https://memorable.ahmedibrahim.dev/api/v1/todos/1', {\n    method: \"PUT\",\n    headers: {\n        \"Content-Type\": \"application/json\",\n    },\n    body: JSON.stringify({\n        is_done: true,\n    })\n}).then(res =\u003e res.json()).then(console.log)\n\n// Response\n{\n    \"id\": 1,\n    \"title\": \"Learn fetch api\",\n    \"desc\": \"learning the basic CRUD operations\",\n    \"is_done\": true\n}\n```\n\n### Delete todo by id\n\n###### Route: `DELETE /api/v1/todos/{id}`\n\n###### Response:\n\nThe API will respond back with a status code 200.\n\n###### JS Example\n\n```js\nfetch(\"https://memorable.ahmedibrahim.dev/api/v1/todos/1\", {\n  method: \"DELETE\",\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneuodev%2Fmemorable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneuodev%2Fmemorable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneuodev%2Fmemorable/lists"}