{"id":18710781,"url":"https://github.com/feryardiant/apify","last_synced_at":"2025-04-12T11:34:14.126Z","repository":{"id":38789309,"uuid":"173519692","full_name":"feryardiant/apify","owner":"feryardiant","description":"Zero-config fake REST API server 🔥","archived":false,"fork":false,"pushed_at":"2024-09-30T21:21:27.000Z","size":1223,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-29T07:23:42.103Z","etag":null,"topics":["api-service","json","json-server","mock-data","mock-server"],"latest_commit_sha":null,"homepage":"https://apify.vercel.app/","language":"TypeScript","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/feryardiant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2019-03-03T01:55:34.000Z","updated_at":"2024-09-30T21:21:31.000Z","dependencies_parsed_at":"2024-06-29T08:42:42.204Z","dependency_job_id":"8b0799cc-1ffa-4b81-9050-f92437af9773","html_url":"https://github.com/feryardiant/apify","commit_stats":{"total_commits":121,"total_committers":3,"mean_commits":"40.333333333333336","dds":"0.22314049586776863","last_synced_commit":"3e76876977218a0c0877e9702429ae980e50e3f0"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feryardiant%2Fapify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feryardiant%2Fapify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feryardiant%2Fapify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feryardiant%2Fapify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/feryardiant","download_url":"https://codeload.github.com/feryardiant/apify/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223515440,"owners_count":17158368,"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-service","json","json-server","mock-data","mock-server"],"created_at":"2024-11-07T12:35:38.054Z","updated_at":"2024-11-07T12:35:38.727Z","avatar_url":"https://github.com/feryardiant.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zero-config fake REST API server.\n\nYet another fake REST API server-based on my own needs. No config, no option, less foot-print, less dependencies and of course less functionalities, LOL. If you wish more robust fake REST API server, please check [json-server](https://github.com/typicode/json-server) by @typicode they've done great job on that project though.\n\nWhy don't I use that json-server project instead of create my own, if you ask? Because, why not. Obviously. :grin:\n\nThis project is aims to offer similar [response](https://laravel.com/docs/eloquent-resources) and [end-points structures](https://laravel.com/docs/controllers#resource-controllers) provided by laravel\n\n## Limitations\n\n- This project is hosted on [vercel](http://vercel.com)' free plan at the moment. So, all the limitations of free plan are applied, including 1k invocation / day. So, if you find the project is down, that's probably has exceeded max invocation.\n- Only supports GitHub repositories\n\n## Getting Started\n\nAll you need to do is creating file called `.apify.json` in your root project. Example:\n\n```json\n{\n  \"posts\": [\n    {\n      \"id\": 1,\n      \"users\": {\n        \"username\": \"john.doe\",\n        \"email\": \"john.doe@example.com\",\n      },\n      \"title\": \"Foo Bar\",\n      \"contents\": \"Lorem Ipsum ...\"\n    }\n  ],\n  \"albums\": [\n    {\n      \"id\": 1,\n      \"title\": \"Some Pictures\",\n      \"images\": [\n        {\n          \"name\": \"http://lorempixel.com/640/480\"\n        },\n        {\n          \"name\": \"http://lorempixel.com/640/480\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nDon't forget to commit and push to your github repository, done? now you can access your _fake_ api through URL below:\n\n```\nhttp://apify.vercel.com/:username/:reponame/:table\n```\n\nThe `:table` is either `posts`, `albums` or `users` from your `.apify.json` file.\n\nThat's it 🍻\n\n## Response\n\nAs I've already mentioned above this project will have similar response object like Laravel does, which is it will wrapped as `data` and `meta`. No `links` for now. So, if you have example data above and you access `/:username/:reponame/albums` for instance, it will returns like this:\n\n```json\n{\n  \"data\": [\n    {\n      \"id\": 1,\n      \"title\": \"Some Pictures\"\n    },\n    {\n      \"id\": 2,\n      \"title\": \"Another Pictures\"\n    }\n  ],\n  \"meta\": {\n    \"current_page\": 1,\n    \"per_page\": 15,\n    \"total\": 2,\n    \"primary\": \"id\",\n    \"soft_deletes\": true,\n    \"timestamps\": true,\n    \"attributes\": {\n      \"id\": {\n        \"key\": \"id\",\n        \"label\": \"ID\",\n        \"visible\": true,\n        \"sortable\": true,\n        \"type\": \"number\"\n      },\n      \"title\": {\n        \"key\": \"title\",\n        \"label\": \"Title\",\n        \"visible\": true,\n        \"sortable\": true,\n        \"type\": \"text\"\n      }\n    }\n  },\n}\n```\n\nThe extra properties on `meta` object are simply because my recent front-end projects are using either [bootstrap-vue](https://bootstrap-vue.js.org/docs/components/table/#fields-column-definitions) or [buefy](https://buefy.org/documentation/table) so I think it would be useful if it has clear meta definition from response, so I don't have to re-parse them in client side.\n\n**NOTE** Might be changed on future releases\n\n## Request\n\nWe only support `application/json` and `application/x-www-form-urlencoded` request `Content-Type`, so make suser you've set one of them on your request header.\n\n## Routing\n\nExample above will generate 4 end-points\n\n- `/:username/:reponame/posts`\n- `/:username/:reponame/albums` _based on `albums.images` array_\n- `/:username/:reponame/users` _based on `posts.users` object_\n- `/:username/:reponame/images`\n\nYes, we'll got extra end-points from  any `Array` or `Object` values, that means our example above will become something like this.\n\n```json\n{\n  \"posts\": [\n    {\n      \"id\": 1,\n      \"users_id\": 1,\n      \"title\": \"Foo Bar\",\n      \"contents\": \"Lorem Ipsum ...\"\n    }\n  ],\n  \"users\": [\n    {\n      \"id\": 1,\n      \"username\": \"john.doe\",\n      \"email\": \"john.doe@example.com\",\n    }\n  ],\n  \"images\": [\n    {\n      \"id\": 1,\n      \"albums_id\": 1,\n      \"name\": \"http://lorempixel.com/640/480\"\n    },\n    {\n      \"id\": 2,\n      \"albums_id\": 1,\n      \"name\": \"http://lorempixel.com/640/480\"\n    }\n  ],\n  \"albums\": [\n    {\n      \"id\": 1,\n      \"title\": \"Some Pictures\"\n    }\n  ]\n}\n```\n\n**NOTE:** Unfortunately the relationship functionality is not fully implemented (yet). :sweat_smile:\n\nAll end-points supports `GET`, `POST`, `PUT` and `DELETE`, which is have (almost) the same structure as [laravel resouce controller](https://laravel.com/docs/controllers#resource-controllers). Excepts for `create` and `edit` actions, also no `PATCH`, `HEAD` or `OPTIONS` support yet. Because I don't personally need it, if you ask. :grin:\n\nAlso, you might noticed that we convert relation name as is, no plural and singular conversion (yet). So if you have data like this:\n\n```json\n{\n  \"people\": {\n    \"id\": 1,\n    \"name\": \"John Doe\",\n    \"company\": {\n      \"name\": \"Acme Inc.\"\n    }\n  }\n}\n```\n\nWill become something like this:\n\n```json\n{\n  \"people\": {\n    \"data\": [\n      {\n        \"id\": 1,\n        \"name\": \"John Doe\",\n        \"company_id\": 1\n      }\n    ],\n    \"meta\": {}\n  },\n  \"company\": {\n    \"data\": [\n      {\n        \"id\": 1,\n        \"name\": \"Acme Inc.\"\n      }\n    ],\n    \"meta\": {}\n  }\n}\n```\n\nI'll implement this later on, _if needed_\n\n### Pagination\n\nBy default all returned data are paginated 15 rows per page and we use `page` and `per_page` query string to do so. Example:\n\n```\n/albums?page=2\n/albums?page=2\u0026per_page=15\n```\n\n**NOTE** Might be changed on future releases\n\n### Ordering\n\nThe default ordering is `id, descending`. You're free to change data ordering whatever you like using `sort` key, like this:\n\n```\n/api/table?sort=id\n// =\u003e sort: { id: 'desc' }\n/api/table?sort.id\n// =\u003e sort: { id: 'desc' }\n/api/table?sort.id=asc\u0026sort.created_at=asc\n// =\u003e sort: { id: 'asc', created_at: 'asc' }\n/api/table?sort[]=id\u0026sort[]=created_at\n// =\u003e sort: { id: 'desc', created_at: 'desc' }\n/api/table?sort[]=id\u0026sort.created_at=asc\n// =\u003e sort: { id: 'desc', created_at: 'desc' }\n```\n\n### Filtering\n\n**NOT IMPLEMENTED YET**\n\n## Credits\n\n- [json-server](https://github.com/typicode/json-server) by @typicode\n\n## License\n\nMIT - [Fery Wardiyanto](https://github.com/feryardiant)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fferyardiant%2Fapify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fferyardiant%2Fapify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fferyardiant%2Fapify/lists"}