# Library LMS

A library lending system where staff manage students, books, borrows, and returns.

## Stack

- **Backend:** Node.js, Express, Mongoose, JWT, bcrypt
- **Frontend:** React (Vite), Tailwind CSS, React Router, axios

## Prerequisites

- Node.js (v18+)
- MongoDB running locally

## Setup

### Backend

```powershell
cd backend
npm install
npm run dev
```

API: **http://localhost:5001**

Database: `mongodb://localhost:27017/library-lms`

### Frontend

```powershell
cd frontend
npm install
npm run dev
```

App: **http://localhost:5173**

## Default login

| Username   | Password   | Role       |
|-----------|------------|------------|
| admin     | admin123   | Admin      |
| librarian | lib123     | Librarian  |

**Admin** can add students and books, borrow, return, search, and run reports.

**Librarian** can borrow, return, search, and view reports (no student/book management).

## Features

- Dashboard statistics (students, books, borrowed, returned)
- Borrow with automatic quantity decrease (blocked when 0 copies)
- Return restores inventory
- Search students and books
- Printable reports
