{"id":16320284,"url":"https://github.com/tuupola/slim-api-skeleton","last_synced_at":"2025-04-04T14:05:23.846Z","repository":{"id":49973015,"uuid":"51230412","full_name":"tuupola/slim-api-skeleton","owner":"tuupola","description":"Slim 3 API skeleton project for Composer","archived":false,"fork":false,"pushed_at":"2021-06-07T10:15:14.000Z","size":239,"stargazers_count":312,"open_issues_count":6,"forks_count":62,"subscribers_count":24,"default_branch":"master","last_synced_at":"2024-10-11T22:43:55.022Z","etag":null,"topics":["api","php","rest","skeleton","slim3"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/tuupola.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}},"created_at":"2016-02-07T01:21:18.000Z","updated_at":"2024-02-06T01:17:23.000Z","dependencies_parsed_at":"2022-08-24T10:40:52.995Z","dependency_job_id":null,"html_url":"https://github.com/tuupola/slim-api-skeleton","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuupola%2Fslim-api-skeleton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuupola%2Fslim-api-skeleton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuupola%2Fslim-api-skeleton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuupola%2Fslim-api-skeleton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tuupola","download_url":"https://codeload.github.com/tuupola/slim-api-skeleton/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247187867,"owners_count":20898392,"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","php","rest","skeleton","slim3"],"created_at":"2024-10-10T22:43:49.914Z","updated_at":"2025-04-04T14:05:23.822Z","avatar_url":"https://github.com/tuupola.png","language":"PHP","readme":"# Slim 3 API skeleton\n\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)\n[![Build Status](https://img.shields.io/github/workflow/status/tuupola/slim-api-skeleton/Tests/master?style=flat-square)](https://github.com/tuupola/slim-api-skeleton/actions)\n[![Coverage](https://img.shields.io/codecov/c/github/tuupola/slim-api-skeleton.svg?style=flat-square)](https://codecov.io/github/tuupola/slim-api-skeleton)\n\nThis is Slim 3 API skeleton project for Composer. Project uses [Zend Table Gateway](https://docs.zendframework.com/zend-db/table-gateway/) and [Phinx](https://phinx.org/) for database operations,  [Monolog](https://github.com/Seldaek/monolog) for logging, and [Fractal](http://fractal.thephpleague.com/) as a serializer. [Vagrant](https://www.vagrantup.com/) virtualmachine config and [Paw](https://paw.cloud/) project files are included for easy development. The skeleton tries to follow DDD principles.\n\n## Install\n\nInstall the latest version using [composer](https://getcomposer.org/).\n\n``` bash\n$ composer create-project --no-interaction --stability=dev tuupola/slim-api-skeleton app\n```\n\n## Usage\n\nIf you have [Vagrant](https://www.vagrantup.com/) installed start the virtual machine.\n\n``` bash\n$ cd app\n$ vagrant up\n```\n\nNow you can access the api at [https://192.168.50.52/todos](https://192.168.50.52/todos)\n\n\n### Get a token\n\n```\n$ curl \"https://192.168.50.52/token\" \\\n    --request POST \\\n    --include \\\n    --insecure \\\n    --header \"Content-Type: application/json\" \\\n    --data '[\"todo.all\"]' \\\n    --user test:test\n\nHTTP/1.1 201 Created\nContent-Type: application/json\n\n{\n    \"token\": \"XXXXXXXXXX\",\n    \"expires\": 1491030210\n}\n```\n\n```\n$ export TOKEN=XXXXXXXXXX\n```\n\n### Create a new todo\n\n```\n$ curl \"https://192.168.50.52/todos\" \\\n    --request POST \\\n    --include \\\n    --insecure \\\n    --header \"Authorization: Bearer $TOKEN\" \\\n    --header \"Content-Type: application/json\" \\\n    --data '{ \"title\": \"Test the API\", \"order\": 10 }'\n\nHTTP/1.1 201 Created\nETag: \"c39de417d4d1f5fe22d19cad68d672d8\"\nLast-Modified: Sat, 16 Apr 2016 10:21:50 GMT\nLocation: /todos/12Cf2ZjVvyu3A\nContent-Type: application/json\n\n{\n    \"data\": {\n        \"uid\": \"12Cf2ZjVvyu3A\",\n        \"order\": 10,\n        \"title\": \"Test the API\",\n        \"completed\": false,\n        \"links\": {\n            \"self\": \"/todos/12Cf2ZjVvyu3A\"\n        }\n    }\n}\n```\n\n### Get an existing todo\n\n```\n$ curl \"https://192.168.50.52/todos/12Cf2ZjVvyu3A\" \\\n    --include \\\n    --insecure \\\n    --header \"Authorization: Bearer $TOKEN\"\n\nHTTP/1.1 200 OK\nETag: \"c39de417d4d1f5fe22d19cad68d672d8\"\nLast-Modified: Sat, 16 Apr 2016 10:21:50 GMT\nContent-Type: application/json\n\n{\n    \"data\": {\n        \"uid\": \"12Cf2ZjVvyu3A\",\n        \"order\": 10,\n        \"title\": \"Test the API\",\n        \"completed\": false,\n        \"links\": {\n            \"self\": \"/todos/12Cf2ZjVvyu3A\"\n        }\n    }\n}\n```\n\n### Update part of an existing todo\n\n```\n$ curl \"https://192.168.50.52/todos/12Cf2ZjVvyu3A\" \\\n    --request PATCH \\\n    --include \\\n    --insecure \\\n    --header \"Authorization: Bearer $TOKEN\" \\\n    --header \"Content-Type: application/json\" \\\n    --header 'If-Match: \"c39de417d4d1f5fe22d19cad68d672d8\"' \\\n    --data '{ \"order\": 27 }'\n\nHTTP/1.1 200 OK\nETag: \"ab6070930158fc8323aa4550aff438b7\"\nLast-Modified: Sat, 16 Apr 2016 10:27:16 GMT\nContent-Type: application/json\n\n{\n    \"data\": {\n        \"uid\": \"12Cf2ZjVvyu3A\",\n        \"order\": 27,\n        \"title\": \"Test the API\",\n        \"completed\": false,\n        \"links\": {\n            \"self\": \"/todos/12Cf2ZjVvyu3A\"\n        }\n    }\n}\n```\n\n### Fully update an existing todo\n\n```\n$ curl \"https://192.168.50.52/todos/12Cf2ZjVvyu3A\" \\\n    --request PUT \\\n    --include \\\n    --insecure \\\n    --header \"Authorization: Bearer $TOKEN\" \\\n    --header \"Content-Type: application/json\" \\\n    --header 'If-Match: \"ab6070930158fc8323aa4550aff438b7\"' \\\n    --data '{ \"title\": \"Full update\", \"order\": 66, \"completed\": true }'\n\nHTTP/1.1 200 OK\nETag: \"451665ea7769851880f411750bbd873c\"\nLast-Modified: Sat, 16 Apr 2016 10:28:45 GMT\nContent-Type: application/json\n\n{\n    \"data\": {\n        \"uid\": \"12Cf2ZjVvyu3A\",\n        \"order\": 66,\n        \"title\": \"Full update\",\n        \"completed\": true,\n        \"links\": {\n            \"self\": \"/todos/12Cf2ZjVvyu3A\"\n        }\n    }\n}\n```\n\n### Delete an existing todo\n\n```\n$ curl \"https://192.168.50.52/todos/12Cf2ZjVvyu3A\" \\\n    --request DELETE \\\n    --include \\\n    --insecure \\\n    --header \"Authorization: Bearer $TOKEN\"\n\nHTTP/1.1 204 No Content\n```\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuupola%2Fslim-api-skeleton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftuupola%2Fslim-api-skeleton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuupola%2Fslim-api-skeleton/lists"}