{"id":24567481,"url":"https://github.com/youneslaaroussi/bikes-api","last_synced_at":"2026-01-02T23:47:18.166Z","repository":{"id":61836656,"uuid":"542755890","full_name":"youneslaaroussi/bikes-api","owner":"youneslaaroussi","description":"RESTful Bikes Shop API, powered by Cyclic.","archived":false,"fork":false,"pushed_at":"2022-10-08T20:02:31.000Z","size":3340,"stargazers_count":5,"open_issues_count":0,"forks_count":21,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-23T13:18:34.630Z","etag":null,"topics":["api","api-rest","first-contributions","hacktoberfest","rest","serverless","template"],"latest_commit_sha":null,"homepage":"https://bikes.cyclic.app/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/youneslaaroussi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-09-28T19:19:20.000Z","updated_at":"2024-09-23T06:35:14.000Z","dependencies_parsed_at":"2022-10-22T03:45:15.449Z","dependency_job_id":null,"html_url":"https://github.com/youneslaaroussi/bikes-api","commit_stats":null,"previous_names":["youneslaaroussi/bikes-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youneslaaroussi%2Fbikes-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youneslaaroussi%2Fbikes-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youneslaaroussi%2Fbikes-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youneslaaroussi%2Fbikes-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/youneslaaroussi","download_url":"https://codeload.github.com/youneslaaroussi/bikes-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243971157,"owners_count":20376785,"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":["api","api-rest","first-contributions","hacktoberfest","rest","serverless","template"],"created_at":"2025-01-23T13:18:45.619Z","updated_at":"2026-01-02T23:47:18.138Z","avatar_url":"https://github.com/youneslaaroussi.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bikes API, with Cyclic 🚲️\n\n## Deploy on Cyclic 🚀\n\n[![Deploy to Cyclic](https://deploy.cyclic.sh/button.svg)](https://deploy.cyclic.sh/eludadev/bikes-api)\n\n## Fill Database with Mock Data\n\n```bash\nnpm run fill-db # fills database with 25 mock bike items\n```\n\n## Fetching Bikes\n![GET routes](./assets/GET%20Routes.png)\n\n### List all bikes\n\n```bash\ncurl http://localhost:3000/bikes/all | jq .\n```\n\n### Get bike by ID\n\n```bash\ncurl http://localhost:3000/bikes/\u003cID\u003e | jq . # replace \u003cID\u003e with an ID from the response to /all\n```\n\n### Get bike by Handle\n\n```bash\ncurl http://localhost:3000/bikes/by-handle/\u003cHANDLE\u003e | jq . # replace \u003cHANDLE\u003e with a handle from the response to /all\n```\n\n### Search bikes by Title\n\n```bash\ncurl http://localhost:3000/bikes/search/by-title\\?query\\=Bicycle | jq .\n```\n\n\n## Creating and Replacing Bikes [\u003cmark\u003e(Authentication required!)\u003c/mark\u003e](#authentication)\n![POST \u0026 PUT routes](./assets/POST%20%26%20PUT%20Routes.png)\n\n### Create new bike\n\n```json\n// request.json (remove this line from the actual file!)\n{\n  \"productType\": \"Hybrid Bicycle\",\n  \"createdAt\": \"Fri Jan 28 2022 03:13:24 GMT+0100 (GMT+02:00)\",\n  \"vendor\": \"Audi\",\n  \"totalInventory\": 2,\n  \"availableForSale\": false,\n  \"priceRange\": {\n    \"minPrice\": {\n      \"currencyCode\": \"USD\",\n      \"amount\": 1160\n    },\n    \"maxPrice\": {\n      \"currencyCode\": \"USD\",\n      \"amount\": 1624\n    }\n  },\n  \"description\": \"Autem ipsam quasi omnis ut. Et officiis quia. Sed quaerat pariatur nihil nobis est quos earum quidem.\",\n  \"title\": \"Hybrid Bicycle Sentra\"\n}\n```\n\n```bash\nexport TOKEN=\u003cTOKEN\u003e # replace \u003cTOKEN\u003e with the token from /api/user\ncurl -H \"Authorization: Bearer $TOKEN\" -H \"Content-Type: application/json\" http://localhost:3000/bikes/ -d @request.json | jq .\n```\n\n### Replace existing bike\n\n```json\n// request.json (remove this line from the actual file!)\n{\n  \"productType\": \"Hybrid Bicycle\",\n  \"createdAt\": \"Fri Jan 28 2022 03:13:24 GMT+0100 (GMT+02:00)\",\n  \"vendor\": \"Audi\",\n  \"totalInventory\": 2,\n  \"availableForSale\": false,\n  \"priceRange\": {\n    \"minPrice\": {\n      \"currencyCode\": \"USD\",\n      \"amount\": 1160\n    },\n    \"maxPrice\": {\n      \"currencyCode\": \"USD\",\n      \"amount\": 1624\n    }\n  },\n  \"description\": \"Autem ipsam quasi omnis ut. Et officiis quia. Sed quaerat pariatur nihil nobis est quos earum quidem.\",\n  \"title\": \"Hybrid Bicycle Sentra\",\n  \"id\": \"4139c5ae-b83d-4a0c-9b75-12d182aaed7c\",\n  \"handle\": \"hybrid-bicycle-sentra\"\n}\n```\n\n```bash\nexport TOKEN=\u003cTOKEN\u003e # replace \u003cTOKEN\u003e with the token from /api/user\ncurl -X PUT -H \"Authorization: Bearer $TOKEN\" -H \"Content-Type: application/json\" http://localhost:3000/bikes/\u003cID\u003e -d @request.json | jq . # replace \u003cID\u003e with an ID from the response to /all\n```\n\n\n## Updating and Deleting [\u003cmark\u003e(Authentication required!)\u003c/mark\u003e](#authentication)\n![PATCH \u0026 DELETE routes](./assets/PATCH%20%26%20DELETE%20Routes.png)\n\n### Update parts of existing bike\n\n```json\n// request.json (remove this line from the actual file!)\n{\n  \"totalInventory\": 4,\n  \"availableForSale\": true\n}\n```\n\n```bash\nexport TOKEN=\u003cTOKEN\u003e # replace \u003cTOKEN\u003e with the token from /api/user\ncurl -X PATCH -H \"Authorization: Bearer $TOKEN\" -H \"Content-Type: application/json\" http://localhost:3000/bikes/\u003cID\u003e -d @request.json | jq . # replace \u003cID\u003e with an ID from the response to /all\n```\n\n### Delete existing bike\n\n```bash\nexport TOKEN=\u003cTOKEN\u003e # replace \u003cTOKEN\u003e with the token from /api/user\ncurl -X DELETE -H \"Authorization: Bearer $TOKEN\" http://localhost:3000/bikes/\u003cID\u003e | jq . # replace \u003cID\u003e with an ID from the response to /all\n```\n\n## Authentication\n\n\u003cmark\u003eGet bearer authentication token:\u003c/mark\u003e\n\n```bash\ncurl -H 'Content-Type: application/json' http://localhost:3000/api/user -d '{\"username\": \"cyclic\"}' | jq .token -r\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyouneslaaroussi%2Fbikes-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyouneslaaroussi%2Fbikes-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyouneslaaroussi%2Fbikes-api/lists"}