Code Monkey home page Code Monkey logo

book_manager_test's Introduction

This is the book management system as the laravel developer application test. after setting the application in your local computer and having created and connected the database, run the below comands to create tables and generate sample data php artisan migrate php artisan db:seed --class=UsersTableSeeder php artisan db:seed --class=AuthorSeeder
php artisan db:seed --class=BookSeeder

make sure you run them in the sequence after that you can go to this pathe \Sample Laravel projects\books_manager_test\tests\Feature and run the test in BookControllerTest.php and AuthorControllerTest.php If you wish to use Postman or other thirdparty software for api testing, here is the list of apis you can put to test and thier expected outcomes

Authentication

Login Endpoint: POST /api/login Description: Authenticate a user and generate a token. Status Codes: 200 (OK) - Successful login 401 (Unauthorized) - Invalid credentials

Authenticated Routes that you'll to use the login tokens are: User Profile

Endpoint: GET /api/profile Description: Retrieve the user's profile information. Status Code: 200 (OK) - Successful retrieval Logout

Endpoint: POST /api/logout Description: Invalidate the user's token and log them out. Status Code: 200 (OK) - Successful logout Books

Get List of Books

Endpoint: GET /api/books Description: Retrieve a list of all books in the database. Status Code: 200 (OK) - Successful retrieval Get Book Details

Endpoint: GET /api/book/{id} Description: Retrieve details of the specified book by ID. Nest author details. Status Codes: 200 (OK) - Successful retrieval 404 (Not Found) - Book not found Create Book

Endpoint: POST /api/book Description: Create a new book. Status Code: 200 (OK) - Successful book creation 422 (Unprocessable Entity) - Validation error Update Book

Endpoint: PUT /api/book/{id} Description: Update details of the specified book by ID. Status Codes: 200 (OK) - Successful update 404 (Not Found) - Book not found 422 (Unprocessable Entity) - Validation error Authors

Get List of Authors

Endpoint: GET /api/authors Description: Retrieve a list of all authors in the database. Status Code: 200 (OK) - Successful retrieval Get Author Details

Endpoint: GET /api/author/{id} Description: Retrieve details of the specified author by ID. Status Codes: 200 (OK) - Successful retrieval 404 (Not Found) - Author not found Create Author

Endpoint: POST /api/author Description: Create a new author. Status Code: 200 (OK) - Successful author creation 422 (Unprocessable Entity) - Validation error

book_manager_test's People

Contributors

steven-maina avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.