GithubHelp home page GithubHelp logo

bookstore's Introduction

bookstore

📎 setup

./Backend.README.md

🔩 stack used

📲 show user experience

bookstore1 bookstore2 bookstore4 booksotre7 bookstore6 bookstore8 bookstore9 bookstore10

🎯 Coding Challenge

Task: Book Management API with User Sessions

Objective: Create a RESTful API using Python for managing books in a library system. The API should allow users to perform CRUD (Create, Read, Update, Delete) operations on books. Additionally, implement user sessions to provide a personalized experience.

Requirements:

    • Use Python with a web framework such as Flask or Django or Fastapi.
    • Use a database to store the book information (e.g., MySQL, PostgreSQL, SQLite).

Implement the following endpoints:

    • GET /books: Retrieve a list of all books.
    • GET /books/{id}: Retrieve a specific book by its ID.
    • POST /books: Create a new book (requires user authentication).
    • PUT /books/{id}: Update an existing book by its ID (requires user authentication).
    • DELETE /books/{id}: Delete a book by its ID (requires user authentication).

Each book should have the following properties:

    • id: Unique identifier for the book (auto-generated).
    • title: Title of the book.
    • author: Author of the book.
    • isbn: ISBN (International Standard Book Number) of the book.
    • publicationYear: Year of publication.

Implement user registration and login functionality:

    • POST /register: Allow users to create a new account.
    • POST /login: Allow users to log in and receive a session token.
    • POST /logout: Allow users to log out and invalidate their session token.

Use user sessions to personalize the experience:

    • Implement a favorites feature that allows authenticated users to mark books as favorites.
    • GET /favorites: Retrieve the list of books marked as favorites by the authenticated user.
    • POST /favorites/{bookId}: Add a book to the authenticated user's favorites.
    • DELETE /favorites/{bookId}: Remove a book from the authenticated user's favorites.

Implement proper error handling for scenarios such as invalid requests, resource not found, unauthorized access, etc. Write unit tests to ensure the functionality of the API endpoints and user session management. Provide a clear README file with instructions on how to set up and run the application. Bonus Points:


    • Implement pagination for the GET /books endpoint.
    • Use JSON Web Tokens (JWT) for user authentication instead of session tokens.
    • Implement rate limiting to prevent abuse of the API.
    • Deploy the API to a cloud platform (e.g., AWS, Azure, Heroku).

Evaluation Criteria:

Code quality, readability, and adherence to best practices. Proper implementation of CRUD operations and user session management. Correct usage of Python, the chosen web framework, and database. Error handling and edge case considerations. Testing coverage and quality of unit tests. Clear and concise documentation. Submission:

Provide a link to a GitHub repository containing the source code. Include a README file with setup instructions and any necessary documentation. If deployed, provide a link to the live API. Time Limit:

The candidate should submit the completed task within 3 days. This updated task incorporates the requirement for using Python and adds user session management functionality. It assesses the candidate's ability to design and implement a RESTful API, work with databases, handle user authentication and sessions, and provide a personalized user experience. It also tests their proficiency in Python web development and their understanding of session management concepts.

Feel free to further customize the task based on your specific requirements and expectations.

bookstore's People

Contributors

lucaimbalzano 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.