{"id":16078732,"url":"https://github.com/teekaytech/api-task","last_synced_at":"2025-08-11T05:16:16.868Z","repository":{"id":53188440,"uuid":"353739343","full_name":"teekaytech/API-Task","owner":"teekaytech","description":null,"archived":false,"fork":false,"pushed_at":"2021-04-01T23:44:33.000Z","size":92,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"development","last_synced_at":"2025-03-26T08:19:35.618Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/teekaytech.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}},"created_at":"2021-04-01T15:10:33.000Z","updated_at":"2021-04-01T23:44:35.000Z","dependencies_parsed_at":"2022-09-14T14:01:27.558Z","dependency_job_id":null,"html_url":"https://github.com/teekaytech/API-Task","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/teekaytech/API-Task","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teekaytech%2FAPI-Task","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teekaytech%2FAPI-Task/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teekaytech%2FAPI-Task/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teekaytech%2FAPI-Task/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/teekaytech","download_url":"https://codeload.github.com/teekaytech/API-Task/tar.gz/refs/heads/development","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teekaytech%2FAPI-Task/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269833249,"owners_count":24482413,"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","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-10-09T10:21:45.938Z","updated_at":"2025-08-11T05:16:16.838Z","avatar_url":"https://github.com/teekaytech.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## CRUD API Task\n\nThis repository contains an implementation of RESTful API task. The API provides endpoints through which users can register, login, \nadd book to a database, get all books from the database, get a single book and delete a book from the database.\n\n## Built With:\n- PHP 7.3\n- Laravel 8.12\n- Sanctum (Authentication System)\n- MySQL\n- Postman (Testing)\n- Heroku (JawsDB MySQL Addon)\n- Git/GitHub GitFlow\n- PHPStorm\n\n### Base (Live)  URL: https://pumpkin-cake-55723.herokuapp.com/\n\n## Getting Started\n### Setup\nTo setup this project on your development environment, follow the steps below:\n- On the project GitHub page, navigate to the main page of the repository ([this page](https://github.com/teekaytech/API-Task)).\n- Under the repository name, locate and click on a green button named `Code`.\n- Copy the project URL as displayed (`https://github.com/teekaytech/API-Task.git`).\n- If you're running Windows Operating System, open your command prompt. On Linux, Open your terminal.\n- Change the current working directory to the location where you want the cloned directory to be made. Leave as it is if the current location is where you want the project to be.\n- Type git clone, and then paste the URL you copied in Step 3.\n  `$ git clone https://github.com/teekaytech/API-Task.git`\n- Press the `Enter` button. Your local copy will be created.\n\n### Starting the app\n- To install the dependencies on your local machine, run `composer install` on your terminal.\n- Optionally, you can run `npm install` to setup other node dependencies as the need arises.\n- Create a copy of `.env.example`, rename the copy to `.env`\n- Run `php artisan key:generate` to generate the app key.\n- Create a database with a suitable name (In my case, I used api_task).\n- Configure the database credentials (db name, port, username, password, etc) in the `.env` file. \n- Run `php artisan migrate` to setup the application database\n- To create dummie data for testing purpose, run `php artisan db:seed`.\n- Finally, you can now start the app with `php artisan serve` command.\n\nNote: you must have `PHP \u003e= V7.3`, `Composer`, \u0026 `MySQL` installed on your PC to setup the app locally.\n\n## API Documentation\n\u003e The base URL for all endpoints is `https://pumpkin-cake-55723.herokuapp.com/`. Some endpoints requires authentication while some does not. \n\u003e The authentication process is implemented with [Laravel Sanctum](https://laravel.com/docs/8.x/sanctum).\n\n**Summary of Available API Endpoints**\n\n| Endpoint | Feature | Authentication |\n| -------- | -------- | -------------- |\n| POST /api/register | Registers a new user | No |\n| POST /api/login | Logs in a user | No |\n| POST /api/books | Store a new book to db | Yes |\n| GET /api/books | Fetch all available books | No |\n| DELETE /api/books/:id | Delete a book from db | Yes |\n| GET /api/books/:id | Fetch a book from db | No |\n\n**Sampling a request that DOES NOT require authentication**\n__GET /api/books__: Fetch all available books.\nEndpoint: `https://pumpkin-cake-55723.herokuapp.com/api/books`\n\nPHP CURL Request (Postman):\n```injectablephp\n\u003c?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, array(\n  CURLOPT_URL =\u003e 'https://pumpkin-cake-55723.herokuapp.com/api/books',\n  CURLOPT_RETURNTRANSFER =\u003e true,\n  CURLOPT_ENCODING =\u003e '',\n  CURLOPT_MAXREDIRS =\u003e 10,\n  CURLOPT_TIMEOUT =\u003e 0,\n  CURLOPT_FOLLOWLOCATION =\u003e true,\n  CURLOPT_HTTP_VERSION =\u003e CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST =\u003e 'GET',\n  CURLOPT_HTTPHEADER =\u003e array(\n    'Accept: application/json'\n  ),\n));\n\n$response = curl_exec($curl);\n\ncurl_close($curl);\necho $response;\n```\n\n**Sampling a request that DOES require authentication**\n__POST /api/books__: Create a new book.\nEndpoint: `https://pumpkin-cake-55723.herokuapp.com/api/books`\n\nPHP CURL Request (Postman):\n```injectablephp\n\u003c?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, array(\n  CURLOPT_URL =\u003e 'https://pumpkin-cake-55723.herokuapp.com/api/books',\n  CURLOPT_RETURNTRANSFER =\u003e true,\n  CURLOPT_ENCODING =\u003e '',\n  CURLOPT_MAXREDIRS =\u003e 10,\n  CURLOPT_TIMEOUT =\u003e 0,\n  CURLOPT_FOLLOWLOCATION =\u003e true,\n  CURLOPT_HTTP_VERSION =\u003e CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST =\u003e 'POST',\n  CURLOPT_POSTFIELDS =\u003e array('title' =\u003e 'Who the crown fits','author' =\u003e 'Keye Abiona','pages' =\u003e '120'),\n  CURLOPT_HTTPHEADER =\u003e array(\n    'Accept: application/json',\n    'Authorization: Bearer 2|Hl6nVpCVub70i28ROJYVQoLZdEyjiqkyyastHH3L'\n  ),\n));\n\n$response = curl_exec($curl);\n\ncurl_close($curl);\necho $response;\n```\n\n## Author\n**Taofeek OLALERE**\n- [Portfolio](https://taofeekolalere.me)\n- [Github](https://github.com/teekaytech/)\n- [Twitter](https://twitter.com/ola_lere)\n- [LinkedIn](https://www.linkedin.com/in/olaleretaofeek/)\n\n## Contributing\n\nContributions, issues and feature requests are welcome!\n\n1. Fork the Project: https://github.com/teekaytech/API-Task.git\n2. Make your changes\n2. Open a Pull Request\n\nFeel free to check the [issues page](https://github.com/teekaytech/API-Task/issues).\n\n## Show your support\n\nGive a :star: if you like this project!\n\n## Acknowledgements\n\n- [Heroku Documentation](https://devcenter.heroku.com/articles/getting-started-with-laravel)\n- [JOel Okoromi on Dev.to](https://dev.to/okmarq/deploying-a-laravel-application-to-heroku-with-a-mysql-database-1gi3)\n- [AFTj Digital Marketing and Solutions](https://dev.to/okmarq/deploying-a-laravel-application-to-heroku-with-a-mysql-database-1gi3)\n- [Adre Castelo on Total Blog](https://www.toptal.com/laravel/restful-laravel-api-tutorial)\n- [Laravel Sanctum Docs](https://laravel.com/docs/8.x/sanctum)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteekaytech%2Fapi-task","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteekaytech%2Fapi-task","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteekaytech%2Fapi-task/lists"}