[Feature] Ability to add books via QR or Barcode
Some users may have already a lot of coding/programming books and to save time entering data may choose to use a reader, their phone or another device to save their books to the database instead of typing in the information.
I would recommend installing react-barcode-reader and using that library.
It appears we need to add:
react-barcode react-qr-code react-qr-reader
Libraries from npm for this function to work
Note: react-barcode-reader and react-qr-reader were added today.
hii @gbowne1
Some users may have already a lot of coding/programming books and to save time entering data may choose to use a reader, their phone or another device to save their books to the database instead of typing in the information.
Can you explain once again ..I am not clearly getting you
@LOGESH-B Perhaps I will re write the issue so it is easier.
I added the react-barcode-reader npm package.
I think this is partly necessary in order for users to use a barcode scanner to scan the barcode on most programming books in order to put them in the database easily.
Hii @gbowne1 I scanned couple of books but it only gives the ISBN number not the things that we are needed(i.e name,author,year....) These things user needs to enter in the form himself.Only for ISBN number it is not a mandetory thing having Barcode reader In my point of view
I scanned books with Online Aspose barcode reader
We would have to connect to an external data source (or another external API) in order for it to query the ISBN for more details. This is not something that needs to be implemented right away, but enough is working that it is indeed possible.
Barcodes on books are usually in the EAN format and yes, usually it is only the ISBN number.
I just saying for someone like me with over 300+ books on programming and coding it might be a bit difficult to enter in all the data for each book.
Before we can do all this we need the models, schemas, etc. for the books themselves so we don't have to rely on the json.
@LOGESH-B
this reminds me..
const mongoose = require('mongoose');
const bookSchema = new mongoose.Schema({
title: { type: String, required: true },
author: { type: String, required: true },
description: { type: String },
rating: { type: Number },
reviews: [{ type: mongoose.Schema.Types.ObjectId, ref: 'Review' }],
});
const Book = mongoose.model('Book', bookSchema);
module.exports = Book;
or...
const express = require('express');
const router = express.Router();
const Book = require('../models/book');
router.get('/books', async (req, res) => {
try {
const books = await Book.find();
res.json(books);
} catch (err) {
console.error(err);
res.status(500).json({ message: 'Server Error' });
}
});
router.post('/books', async (req, res) => {
const { title, author, description, rating } = req.body;
try {
const book = new Book({ title, author, description, rating });
await book.save();
res.json(book);
} catch (err) {
console.error(err);
res.status(500).json({ message: 'Server Error' });
}
});
module.exports = router;
@gbowne1 Assign to me i will work on that🙌
I mean I can totally make that a new [TODO] issue to make the models for books like above. @LOGESH-B give me a few moments.
@gbowne1 Ok
ok new issue added. Comment so I can assign.
@BlackBond06 This is the issue for adding books via barcode