A modern, responsive Library Management System built with React, TypeScript, and Tailwind CSS. This application provides a comprehensive solution for managing books, members, and transactions in a library setting.
- Add, edit, and delete books
- Search and filter books by title, author, genre, or ISBN
- View book details including availability status
- Track total and available copies
- Upload book covers (placeholder implementation)
- Register new members with detailed information
- Edit member profiles and manage membership types
- Toggle member status (active/inactive)
- Search members by name, email, or phone
- Track membership dates and types (Standard, Premium, Student)
- Issue books to members with automatic due date calculation
- Return books with status tracking
- View transaction history with filtering capabilities
- Handle overdue books and fine calculations
- Real-time availability updates
- Overview statistics (total books, active members, issued books, overdue books)
- Recent transaction activity
- Popular books tracking
- Quick action buttons for common tasks
- Frontend: React 18 with TypeScript
- Styling: Tailwind CSS
- Routing: React Router DOM
- State Management: Context API with useReducer
- Form Handling: React Hook Form with Yup validation
- HTTP Client: Axios (configured for mock API)
- Icons: Lucide React
- Build Tool: Vite
src/
├── components/
│ ├── common/ # Reusable UI components
│ ├── books/ # Book management components
│ ├── members/ # Member management components
│ ├── transactions/ # Transaction management components
│ └── dashboard/ # Dashboard components
├── context/ # React Context for state management
├── hooks/ # Custom React hooks
├── services/ # API service layer (mock implementation)
├── types/ # TypeScript type definitions
└── App.tsx # Main application component
-
Clone the repository
git clone <repository-url> cd library-management-system
-
Install dependencies
npm install
-
Environment Setup
cp .env.example .env
Update the
.envfile with your API configuration:VITE_API_BASE_URL=http://localhost:3001/api -
Start the development server
npm run dev
-
Build for production
npm run build
The application is designed to work with a REST API but includes mock data for demonstration purposes. The API endpoints expected are:
GET /api/books- Fetch all booksPOST /api/books- Create a new bookPUT /api/books/:id- Update a bookDELETE /api/books/:id- Delete a bookGET /api/members- Fetch all membersPOST /api/members- Create a new memberPUT /api/members/:id- Update a memberDELETE /api/members/:id- Delete a memberGET /api/transactions- Fetch all transactionsPOST /api/transactions/issue- Issue a bookPUT /api/transactions/:id/return- Return a book
- Mobile-first approach with breakpoints for tablet and desktop
- Adaptive layouts that work seamlessly across all device sizes
- Touch-friendly interface for mobile devices
- Real-time validation using React Hook Form and Yup
- User-friendly error messages
- Prevention of invalid data submission
- Real-time search across multiple fields
- Category-based filtering
- Combination of search and filter capabilities
- Centralized state using Context API
- Optimistic updates for better UX
- Error handling and loading states
- Smooth animations and transitions
- Loading indicators
- Confirmation dialogs for destructive actions
- Responsive modals and forms