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/register
Register a new user
/api/auth/login
Login
/api/auth/logout
Logout
/api/books/
List all books
/api/books/:bookId
Get book by ID
/api/books/
Create a new book (Admin only)
/api/books/:bookId
Update book (Admin only)
/api/books/:bookId
Delete book (Admin only)
/api/authors/
List all authors
/api/authors/:authorId
Get author by ID
/api/authors/
Create a new author (Admin only)
/api/authors/:authorId
Update author (Admin only)
/api/authors/:authorId
Delete author (Admin only)
/api/genres/
List all genres
/api/genres/:genreId
Get genre by ID
/api/genres/
Create a new genre (Admin only)
/api/genres/:genreId
Update genre (Admin only)
/api/genres/:genreId
Delete genre (Admin only)
/api/publishers/
List all publishers
/api/publishers/:publisherId
Get publisher by ID
/api/publishers/
Create a new publisher (Admin only)
/api/publishers/:publisherId
Update publisher (Admin only)
/api/publishers/:publisherId
Delete publisher (Admin only)
/api/favorites/
List favorite books
/api/favorites/
Add a book to favorites
/api/favorites/:bookId
Remove book from favorites
/api/reviews/
List all reviews
/api/reviews/book/:bookId
Get all reviews for a book
/api/reviews/:reviewId
Get review by ID
/api/reviews/
Create a new review
/api/reviews/:reviewId
Update review
/api/reviews/:reviewId
Delete review