The Book Management System is a MERN stack application that focuses on managing books with essential functionalities such as user authentication, book publishing, searching, and listing. This project aims to provide a robust backend RESTful API to support these features.
-
POST /api/auth/signup
- Register a new user.
-
POST /api/auth/login
- Log in an existing user.
-
POST /api/books/publish
- Publish a new book.
-
GET /api/books/search?title={searchQuery}
- Search for books by title.
-
PUT /api/books/unpublish/{bookId}
- Unpublish a book.
-
GET /api/books/user
- Get a list of books published by the current user.
-
GET /api/books/published
- Get a list of all published books.
- Utilize JSON Web Tokens (JWT) for token-based user authentication.
- Include the JWT token in the Authorization header for authenticated requests.
- Implement middleware for verifying JWT tokens and extracting user information.
- Clone the repository:
git clone <repository-url>
- Navigate to the project directory:
cd <project-directory>
- Install dependencies:
npm install
- Set up your environment variables for database connection and JWT secret.
- Run the server:
npm start