
Backend - API Project













This is a RESTful API for a book management system built with Express.js and Prisma ORM. It allows users to register, log in, browse books, and leave reviews. Admin users can manage books, authors, genres, and publishers. The API also includes features like favorites, request validation with Zod, and secure session-based authentication.
/api/auth/Get the authenticated user
/api/auth/registerRegister a new user
/api/auth/loginLogin
/api/auth/logoutLogout
/api/books/List all books
/api/books/:bookIdGet book by ID
/api/books/Create a new book (Admin only)
/api/books/:bookIdUpdate book (Admin only)
/api/books/:bookIdDelete book (Admin only)
/api/authors/List all authors
/api/authors/:authorIdGet author by ID
/api/authors/Create a new author (Admin only)
/api/authors/:authorIdUpdate author (Admin only)
/api/authors/:authorIdDelete author (Admin only)
/api/genres/List all genres
/api/genres/:genreIdGet genre by ID
/api/genres/Create a new genre (Admin only)
/api/genres/:genreIdUpdate genre (Admin only)
/api/genres/:genreIdDelete genre (Admin only)
/api/publishers/List all publishers
/api/publishers/:publisherIdGet publisher by ID
/api/publishers/Create a new publisher (Admin only)
/api/publishers/:publisherIdUpdate publisher (Admin only)
/api/publishers/:publisherIdDelete publisher (Admin only)
/api/favorites/List favorite books
/api/favorites/Add a book to favorites
/api/favorites/:bookIdRemove book from favorites
/api/reviews/List all reviews
/api/reviews/book/:bookIdGet all reviews for a book
/api/reviews/:reviewIdGet review by ID
/api/reviews/Create a new review
/api/reviews/:reviewIdUpdate review
/api/reviews/:reviewIdDelete review