Skip to content

rayan2014/imagine_book_store_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

Project: Imagine Bookstore API

Objective: Build a backend API for an online bookstore. The API should allow users to browse and search for books, manage their shopping carts, and place orders. Each book should have attributes such as title, author, genre, price, and stock quantity. The API should handle user authentication, manage user sessions, and provide endpoints for various bookstore functionalities.

Requirements:

  • Implement proper data validation and error handling.

  • Implement token-based authentication for user access. The API should allow users to register, login, and obtain a token to access protected endpoints.

  • Implement endpoints that allows the user to do the following actions:

    • Retrieve a list of all books available in the store.
    • Retrieve details of a specific book by its ID.
    • Allow users to search for books by title, author, or genre.
    • Retrieve the user's shopping cart with a list of added books.
    • Add a book to the user's shopping cart.
    • Remove a book from the user's shopping cart.
    • Retrieve a list of the user's previous orders.
    • Place a new order with the books currently in the user's shopping cart.
  • Ensure that the API endpoints are secure and can only be accessed by authenticated users.

  • Handle stock management: When a user places an order, make sure to update the book stock accordingly.

  • Bonus: Implement pagination for the /api/books and /api/orders endpoints to limit the number of results returned per request.

  • Bonus: Create an admin role with special privileges to manage books (add, update, delete) and view all user orders.

Tools:

  • Use any backend programming language and framework of your choice (e.g., Python with Flask, Node.js with Express, Ruby on Rails, etc.).
  • Use a database of your choice (e.g., SQLite, PostgreSQL, MySQL) to store books, user information, shopping carts, and orders.

Evaluation Criteria:

  • Functionality: Does the API meet the specified requirements? Does it operate correctly without significant bugs?
  • Code Quality: Is the code well-structured, readable, and maintainable? Does it adhere to best practices?
  • Error Handling: Does the API gracefully handle errors and provide informative feedback to the user?

Note: Please don't hesitate to reach out if you have any questions or require clarification regarding any aspect of the assignment. Good luck!

About

The API should allow users to browse and search for books, manage their shopping carts, and place orders

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors