{"id":13424446,"url":"https://github.com/blocknotes/kemal-rest-api","last_synced_at":"2025-03-15T18:35:02.882Z","repository":{"id":68600447,"uuid":"79039977","full_name":"blocknotes/kemal-rest-api","owner":"blocknotes","description":"Crystal library to create REST API with Kemal","archived":true,"fork":false,"pushed_at":"2023-06-19T08:34:59.000Z","size":56,"stargazers_count":55,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-26T23:55:14.149Z","etag":null,"topics":["api","crystal","kemal","rest"],"latest_commit_sha":null,"homepage":"","language":"Crystal","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/blocknotes.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-15T15:10:01.000Z","updated_at":"2024-05-31T11:55:14.000Z","dependencies_parsed_at":"2024-10-26T23:43:32.206Z","dependency_job_id":null,"html_url":"https://github.com/blocknotes/kemal-rest-api","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blocknotes%2Fkemal-rest-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blocknotes%2Fkemal-rest-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blocknotes%2Fkemal-rest-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blocknotes%2Fkemal-rest-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blocknotes","download_url":"https://codeload.github.com/blocknotes/kemal-rest-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243775845,"owners_count":20346275,"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","crystal","kemal","rest"],"created_at":"2024-07-31T00:00:54.431Z","updated_at":"2025-03-15T18:34:57.822Z","avatar_url":"https://github.com/blocknotes.png","language":"Crystal","funding_links":[],"categories":["Crystal","Api Builders"],"sub_categories":[],"readme":"# kemal-rest-api - PROJECT UNMAINTAINED\n\n\u003e *This project is not maintained anymore*\n\u003e\n\u003e *If you like it or continue to use it fork it please.*\n\n* * *\n* * *\n\nA Crystal library to create REST API with Kemal.\n\nSee [examples](https://github.com/blocknotes/kemal-rest-api/tree/master/examples) folder for **mysql**, **sqlite3** and **mongo** samples.\n\n**NOTE**: this is a *beta* version, a lot of features and security improvements need to be implemented actually\n\n## Installation\n\nAdd this to your application's `shard.yml`:\n\n```yaml\ndependencies:\n  kemal-rest-api:\n    github: blocknotes/kemal-rest-api\n```\n\n## Usage\n\n```ruby\nrequire \"db\"       # dependency required to use CrystalDbModel\nrequire \"sqlite3\"  # dependency required to use CrystalDbModel - alternatives: crystal-mysql, crystal-pg\nrequire \"kemal\"\nrequire \"kemal-rest-api\"\n\nclass MyModel \u003c KemalRestApi::Adapters::CrystalDbModel\n  def initialize\n    super \"sqlite3:./db.sqlite3\", \"my_table\"\n  end\nend\n\nmodule WebApp\n  res = KemalRestApi::Resource.new MyModel.new, KemalRestApi::ALL_ACTIONS, prefix: \"api\", singular: \"item\"\n  res.generate_routes!\n  Kemal.run\nend\n```\n\nGenerated routes:\n\n```\nGET    /api/items\nGET    /api/items/:id\nPOST   /api/items\nPUT    /api/items/:id\nDELETE /api/items/:id\n```\n\n## KemalRestApi::Resource options\n\n- **json** (*Bool*): form payload as JSON instead of formdata, default = true\n- **plural** (*String*): plural name of the model, used for routes, default = *singular* pluralized\n- **prefix** (*String*): prefix for all API routes, default = \"\"\n- **singular** (*String*): singular name of the model, default = class model name lowercase\n\n## More examples\n\nSee [examples](https://github.com/blocknotes/kemal-rest-api/tree/master/examples) folder.\n\n## Notes\n\n*crystal-db* shard is required only if `KemalRestApi::Adapters::CrystalDbModel` is used.\n\nThe proposed adapters are basic implementations, you can create easily a model adapter that responds better to your needs. *prepare_params* is used to adjust the create/update parameters.\n\n## Contributors\n\n- [Mattia Roccoberton](http://blocknot.es) - creator, maintainer, Crystal fan :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblocknotes%2Fkemal-rest-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblocknotes%2Fkemal-rest-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblocknotes%2Fkemal-rest-api/lists"}