Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rationalprabal/book-management-app
A Node.js and Express.js application for managing books, featuring role-based authentication and authorization with JWT, file uploads for book cover pages, robust data validation and documentation using swagger. The project includes user roles such as Admin, Author, and Reader, each with specific permissions.
https://github.com/rationalprabal/book-management-app
Last synced: about 14 hours ago
JSON representation
A Node.js and Express.js application for managing books, featuring role-based authentication and authorization with JWT, file uploads for book cover pages, robust data validation and documentation using swagger. The project includes user roles such as Admin, Author, and Reader, each with specific permissions.
- Host: GitHub
- URL: https://github.com/rationalprabal/book-management-app
- Owner: RationalPrabal
- Created: 2024-07-29T05:50:28.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-07-29T13:10:12.000Z (4 months ago)
- Last Synced: 2024-07-30T13:05:50.600Z (4 months ago)
- Language: JavaScript
- Homepage: https://book-management-app-production.up.railway.app/
- Size: 39.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Book Management System
A Node.js and Express.js application for managing books with role-based authentication (Admin, Author, Reader), JWT authorization, CRUD operations, Cloudinary file uploads, and data validation using `express-validator`. Features include request logging and error handling.
## Features
- **Role-based Authentication & Authorization**:
- **Admin**: Full access to all CRUD operations for books.
- **Author**: Can create, update, and view books.
- **Reader**: Can only view and read books.
- **Book Management**: Create, update, delete, and view books.
- **File Uploads**: Upload book cover pages to Cloudinary.
- **Validation**: Validate incoming request data with `express-validator`.
- **Request Logging**: Log incoming requests with method, URL, and timestamp.
- **Error Handling**: Handle errors gracefully with meaningful messages and status codes.## Setup
1. Clone the repository:
```sh
git clone https://github.com/your-username/book-management-system.git
cd book-management-system
2. Install dependencies:
```sh
npm install
3. Create a .env file and add your configuration:
```sh
PORT=3000
MONGODB_URI=your_mongodb_uri
JWT_SECRET=your_jwt_secret
CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret4. Start the server:
```sh
npm run devAPI Documentation
The API is documented using Swagger. You can view the API documentation at http://localhost:3000/api-docs once the server is running.