Library Management

Library Management is a full-stack Next.js application developed in March 2025 for a client to manage a library system. It supports user authentication, book browsing, borrowing with a limit of 3 books, and fine calculation for overdue returns, all powered by MongoDB for robust data management. Users can search books, view borrowing history, and manage profiles, while admins can add, edit, or delete books and view user details. Built with Next.js, React, Tailwind CSS, JavaScript, and MongoDB, the site ensures a responsive and intuitive experience, showcasing skills in database integration, dynamic routing, and modern UI design.

Library Management

Technology Stack

Next.jsNext.js
ReactReact
Tailwind CSSTailwind CSS
JavaScriptJavaScript
MongoDBMongoDB

Landing Page (/ Route)

The landing page displays a grid of book cards with images and IDs, accessible only after login, with a navbar containing History and Login (or profile icon post-login).

Unauthenticated users clicking cards or navbar items are redirected to the /login route.

  • Responsive book card grid layout
  • Protected routes requiring authentication
  • Dynamic navbar with profile icon post-login
  • Visual fallback to first name's letter if no profile image
Landing Page (/ Route) image 1
Landing Page (/ Route) image 2

Authentication Routes

Unauthenticated users are redirected to the /login route, featuring a login form, with an option to navigate to the /register route for account creation.

Post-login, users see their profile image or first name’s initial in the navbar on the landing page.

  • Secure login form with MongoDB-backed authentication
  • Seamless navigation between login and registration
  • Responsive form design for all devices
  • Dynamic navbar update post-authentication
Authentication Routes image 1
Authentication Routes image 2

User Book Interaction (/user Route)

Clicking a book card navigates to the /user route, showing detailed book information on the left with a 'Borrow Book' button, 'Return Book' if borrowed, or messages like 'No more books in the stock' or 'Maximum book borrow limit (3) has reached.'

The right side displays the user’s borrowed books with images, borrow dates, expired dates, and a red pop-up for overdue fines (100 TK per book per day, e.g., 400 TK for two books overdue by two days).

  • Detailed book view with borrow/return options
  • Borrow limit enforcement (max 3 books)
  • Real-time fine calculation for overdue books
  • Responsive split layout for book and borrow list
User Book Interaction (/user Route) image 1
User Book Interaction (/user Route) image 2
User Book Interaction (/user Route) image 3
User Book Interaction (/user Route) image 4
User Book Interaction (/user Route) image 5

Search Functionality

A search input box on the landing page allows users to filter book cards by title, author, genre, or ID, providing real-time results with MongoDB queries.

  • Dynamic search filtering across multiple fields
  • Real-time updates to book card display
  • User-friendly search input design
  • MongoDB-backed search optimization
Search Functionality image 1

History Route (/history)

The /history route, accessible via the navbar, displays the user’s lifetime borrowing history in book cards, each showing the book image, borrowing date, and returning or expired date.

  • Comprehensive borrowing history display
  • Card-based layout for historical records
  • Clear date information for borrowing and returns
  • Responsive design for history overview
History Route (/history) image 1

Profile Route (/profile)

The /profile route shows the user’s personal information from registration, with options to upload, change, or remove a profile photo, update name, bio, password (but not email), and log out.

  • Editable profile with photo and personal details
  • Secure updates for name, bio, and password
  • Logout functionality with redirection to login
  • Responsive profile page layout
Profile Route (/profile) image 1

Admin Dashboard (/admin Route)

Admins access all user features plus two additional navbar items: Users and Admin. The /admin route allows adding new books via a form on the left and viewing/editing/deleting existing books in a row-based list on the right.

Books cannot be deleted if currently borrowed by any user, with MongoDB ensuring data integrity.

  • Form for adding new books with validation
  • Row-based list for book management
  • Restricted deletion for borrowed books
  • MongoDB-backed CRUD operations
Admin Dashboard (/admin Route) image 1

Users Route (/allUsers)

The /allUsers route, accessible to admins via the navbar, displays all user information in card format, including user image, name, email, and phone.

  • Card-based layout for user information
  • Display of user image and contact details
  • Responsive design for admin user management
  • Secure access restricted to admins
Users Route (/allUsers) image 1

Technical Implementation

Built with Next.js for server-side rendering and dynamic routing, ensuring fast performance and SEO-friendly content delivery.

Integrates MongoDB for robust, real-time book and user data management, with Tailwind CSS for responsive, utility-first styling.

  • Next.js dynamic routing for user and admin pages
  • MongoDB for efficient data storage and retrieval
  • React hooks for state and effect management
  • Tailwind CSS for consistent, responsive design
  • Fine calculation logic for overdue books