Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Ability to add books via QR or Barcode #38

Open
gbowne1 opened this issue May 27, 2023 · 13 comments
Open

[Feature] Ability to add books via QR or Barcode #38

gbowne1 opened this issue May 27, 2023 · 13 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Milestone

Comments

@gbowne1
Copy link
Owner

gbowne1 commented May 27, 2023

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.

@gbowne1 gbowne1 added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels May 27, 2023
@gbowne1 gbowne1 added this to the Backend milestone May 27, 2023
@gbowne1
Copy link
Owner Author

gbowne1 commented Jun 20, 2023

I would recommend installing react-barcode-reader and using that library.

@gbowne1 gbowne1 moved this to Todo in CodeBooker Jun 20, 2023
@gbowne1
Copy link
Owner Author

gbowne1 commented Jul 14, 2023

It appears we need to add:

react-barcode
react-qr-code
react-qr-reader

Libraries from npm for this function to work

@gbowne1
Copy link
Owner Author

gbowne1 commented Jul 17, 2023

Note: react-barcode-reader and react-qr-reader were added today.

@LOGESH-B
Copy link
Collaborator

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

@gbowne1
Copy link
Owner Author

gbowne1 commented Jul 21, 2023

@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.

@LOGESH-B
Copy link
Collaborator

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

@gbowne1
Copy link
Owner Author

gbowne1 commented Jul 22, 2023

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.

@gbowne1
Copy link
Owner Author

gbowne1 commented Jul 22, 2023

@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;

@LOGESH-B
Copy link
Collaborator

LOGESH-B commented Jul 22, 2023

@gbowne1 Assign to me i will work on that🙌

@gbowne1
Copy link
Owner Author

gbowne1 commented Jul 22, 2023

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.

@LOGESH-B
Copy link
Collaborator

@gbowne1 Ok

@gbowne1
Copy link
Owner Author

gbowne1 commented Jul 22, 2023

ok new issue added. Comment so I can assign.

@gbowne1
Copy link
Owner Author

gbowne1 commented Aug 24, 2023

@BlackBond06 This is the issue for adding books via barcode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
Status: Todo
Development

No branches or pull requests

2 participants