Hello @raghavendra.philkana and welcome! Adaloites? Is it an official thing? I like the sound of that but I think Adalolites is easier on the tongue
Anyway, just to help you out a bit:
In your users collection, you can have a true/false property if you want to restrict a user from being both a borrower and owner, although I think a user should be able to borrow and lend books.
How I would do it is to set up relations first:
- Books and reviews (one to many)
- Users and reviews (one to many)
- Users and books (one to many) — lender
- Users and books (one to many) — borrower
Books collection properties
- Standard details such as name, author
- True/False for borrow status
Two screens — one for submitting books to the club, one for borrowing books from the club
Submit books — just a plain form that creates a record in the books collection
Borrowing books — a list of books submitted, with the condition that it’s not borrowed already OR if the book is borrowed, hide the “request book” button
If you want reviews for the books, make sure you have a button on the book details page that leads to a page of reviews, and a form to submit a review.
I think that should give you a rough idea and direction of how to implement it.
Hope it makes sense!