Library management system project
with issue, return, fines and an ER diagram

Books and their copies, members, issue and return with due dates, fines and reservations. Generate a working version from one prompt, then read it, change it and defend it.

What the project does

Generated from the prompt below, so yours can differ: read it before you present it.

Catalogue and copies

A book is a title; a copy is the physical item with its accession number. Two copies of one book can be on loan to two people at once.

Issue with a limit

Issuing checks the copy is available and the member is under their limit, then sets the due date from the member type.

Return and fines

Returning closes the loan, works out days late and the fine, and puts the copy back on the shelf or holds it for a reservation.

Reservations

When every copy is out, a member joins a queue. The first returned copy is held for the first person in it.

Search

By title, author, ISBN or category, showing how many copies are on the shelf right now.

Reports

Overdue books with the member and days late, fines collected, and the most borrowed titles this term.

Who uses it

Librarian
Adds books and copies, registers members, issues and returns, collects fines, sees every report.
Member
Searches the catalogue, reserves a book, sees only their own loans, due dates and fines.

ER diagram

Six entities. The key design choice is splitting book from copy: the catalogue describes titles, loans happen on copies. Check that the app you generate makes the same split.

category

iduuidPK
nametext

book

iduuidPK
category_iduuidFK
titletext
authortext
isbntextUK
publishertext
shelftext

copy

iduuidPK
book_iduuidFK
accession_notextUK
statustext

member

iduuidPK
nametext
member_typetext
borrow_limitint
phonetext

loan

iduuidPK
copy_iduuidFK
member_iduuidFK
issued_ondate
due_ondate
returned_ondate
finenumeric

reservation

iduuidPK
book_iduuidFK
member_iduuidFK
reserved_attimestamp
statustext

Relationships

  • category groups book (one to many)
  • book has copy (one to many)
  • copy is lent in loan (one to many)
  • member borrows in loan (one to many)
  • book is reserved in reservation (one to many)
  • member places reservation (one to many)

Mermaid source

Paste it into mermaid.live, draw.io (Arrange, Insert, Advanced, Mermaid) or any Markdown editor that draws Mermaid to get the diagram for your report.

erDiagram
  CATEGORY ||--o{ BOOK : "groups"
  BOOK ||--o{ COPY : "has"
  COPY ||--o{ LOAN : "is lent in"
  MEMBER ||--o{ LOAN : "borrows in"
  BOOK ||--o{ RESERVATION : "is reserved in"
  MEMBER ||--o{ RESERVATION : "places"
  CATEGORY {
    uuid id PK
    text name
  }
  BOOK {
    uuid id PK
    uuid category_id FK
    text title
    text author
    text isbn UK
    text publisher
    text shelf
  }
  COPY {
    uuid id PK
    uuid book_id FK
    text accession_no UK
    text status
  }
  MEMBER {
    uuid id PK
    text name
    text member_type
    int borrow_limit
    text phone
  }
  LOAN {
    uuid id PK
    uuid copy_id FK
    uuid member_id FK
    date issued_on
    date due_on
    date returned_on
    numeric fine
  }
  RESERVATION {
    uuid id PK
    uuid book_id FK
    uuid member_id FK
    timestamp reserved_at
    text status
  }

Generate yours and get the code

This builds on Refinar's school starting point, which already has students, staff and roles. The catalogue, the loans and the fines come from the prompt. Running a real school library? See the library management system page instead.

The button opens Refinar with the project described in the first message, ready to edit. About a minute later there is a running app with sign-in, the pages above and a PostgreSQL database, in a live preview you can click through and change by asking.

It is real code: Next.js and React in TypeScript, PostgreSQL with the Drizzle ORM, and Better Auth for sign-in. When you press Go live, the GitHub repository moves to your own GitHub account and the database to your own Neon account, so you can read it, run it and present it. Building uses credits and going live needs a Refinar plan; the details are on the pricing page.

If your syllabus asks for PHP and MySQL, Java or Python, ask your guide before you start: the generated code will not be in those languages. The ER diagram and the checklist on this page work for any stack.

The prompt it starts with

A library management system for a final-year project, in English: books with title, author, ISBN, publisher, category and shelf; copies with accession numbers and a status; members who are students or staff with a borrowing limit (3 for students, 5 for staff); issue a copy with a due date 14 days later; return with a fine of 2 rupees per day late; reservations for books with no copy available; search by title, author or ISBN; reports of overdue books and most borrowed titles. Roles: librarian, who does everything, and member, who searches and sees only their own loans and fines.

Report and viva checklist

Report checklist

  • Abstract: the problem, who uses the system and what it does, in one paragraph.
  • Existing system and its problems, then the proposed system.
  • Objectives and scope, including what is out of scope.
  • Requirements: functional and non-functional, per role.
  • Technology used and why: Next.js, TypeScript, PostgreSQL, Drizzle ORM.
  • ER diagram and table design, normalised to third normal form.
  • DFD level 0 and level 1, and a use case diagram.
  • Module description with a screenshot of each screen.
  • Testing: test cases with input, expected result and actual result.
  • Conclusion, limitations and future scope.
  • References, and a statement of the tools you used, AI included.

Make the report about this project

  • Explain why book and copy are two tables, with an example of what goes wrong with one.
  • Write the fine rule as a formula and show it on two returns, one on time and one late.
  • Draw the copy status flow: available, issued, reserved, lost, withdrawn.
  • Test cases: issuing beyond the limit, issuing a copy already out, returning a book twice.

Viva questions to prepare

  • How do you stop two librarians issuing the same copy at the same moment?
  • How would you find every member with an overdue book? Write the query.
  • Should the fine be stored on the loan or calculated each time? Defend your choice.
  • What changes if the library adds e-books?
  • What is a primary key and a foreign key? Point to one of each in your tables.
  • Which normal form are your tables in, and what would break if they were not?
  • How does sign-in work, and how are passwords stored?
  • How does the app stop one user from seeing another user's data?
  • Why PostgreSQL, and not MySQL or MongoDB?
  • What did you change or add yourself, and why?

Build it, understand it, then submit it

Many universities allow tools, AI included, as long as you say so and can explain every part of what you submit. Read your university's rules and ask your guide before you start, and name Refinar in the tools section of your report.

Treat the generated app as a starting point, not a submission. Read every table and every page, change something yourself, add one feature that is your own, and write the test cases by hand. If you cannot say why a table has a foreign key, an examiner will find out in a minute.

Submitting work you did not do and do not understand as your own is academic misconduct, whoever or whatever wrote it. These pages are here to help you build a project you can defend.

Take it further

  • Barcode labels for copies and a scanner at the counter.
  • Email or SMS reminders two days before the due date.
  • Book details fetched from an ISBN lookup service when a title is added.
  • A renewal button for members, allowed once if nobody has reserved the book.

Questions

What are the modules of a library management system project?

Book and copy management, member management, issue and return, fines, reservations, search and reports, with a librarian login and a member login.

What is the difference between a book and a copy?

A book is the title (author, ISBN). A copy is one physical item with its own accession number. Loans and status belong to copies, which is why they are separate tables.

Can I submit the generated app as it is?

No. Use it to start, then understand every table, change it and add something of your own, and declare the tools you used. Read the note on academic honesty above.

Is this a mini project or a final-year project?

The core (catalogue, issue, return, fines) suits a mini project. Reservations, reports and one extension from the list make it a final-year project.