A modern, full-stack Library Management System built with React, TypeScript, and Supabase. This application provides a seamless experience for both students and librarians to manage library resources, track borrowed books, and handle fines.
- Framework: React (v18) with Vite for fast build and development.
- Language: TypeScript for type safety and developer experience.
- Styling: Tailwind CSS for utility-first styling.
- UI Components: shadcn/ui for accessible and customizable components.
- Icons: Lucide React for beautiful icons.
- Routing: React Router DOM for client-side routing.
- State Management: TanStack Query for efficient server state management.
- Charts: Recharts for data visualization in dashboards.
- Platform: Supabase (Firebase alternative).
- Database: PostgreSQL.
- Authentication: Supabase Auth with Row Level Security (RLS).
- Security: Comprehensive RLS policies to ensure data privacy and role-based access control.
- Role-Based Access Control (RBAC): Distinct login flows and dashboards for Students and Librarians.
- Secure Signup:
- Students: Restricted to specific email domains (
@cambridge.edu.in,@cambridge.edu.com). Requires University Serial Number (USN). - Librarians: Role-based signup.
- Students: Restricted to specific email domains (
- Protected Routes: Prevents unauthorized access to dashboard pages.
- Row Level Security (RLS): Database policies ensure students can only view their own data, while librarians have broader management access.
- Personalized View: See personal details (Name, USN, Department).
- Borrowed Books: View currently borrowed books with due dates.
- Fine Tracking: Check outstanding fines and payment status.
- Profile Management: View student profile information.
- Book Management:
- Add new books to the library inventory.
- Update book details (copies, author, category).
- Remove books from the system.
- Student Management:
- View all registered students.
- Add new students manually.
- Update student details.
- Issue & Return:
- Issue books to students.
- Process book returns.
- Automatically calculate fines for late returns.
- Fine Management: Track and manage student fines.
- Analytics: Visual charts showing book distribution and usage.
Follow these steps to run the project locally.
- Node.js (v18 or higher)
- npm or yarn
-
Clone the repository
git clone https://github.com/sanjanatg/Library-management-system.git cd Library-management-system -
Install dependencies
npm install
-
Environment Configuration Create a
.envfile in the root directory and add your Supabase credentials:VITE_SUPABASE_URL=your_supabase_project_url VITE_SUPABASE_PUBLISHABLE_KEY=your_supabase_anon_key
-
Run the development server
npm run dev
-
Build for production
npm run build
src/
├── api/ # API functions for Supabase interactions
├── components/ # Reusable UI components (Buttons, Inputs, etc.)
│ ├── dashboard/ # Specific components for Student/Librarian dashboards
│ └── ui/ # shadcn/ui components
├── contexts/ # React Contexts (AuthContext for global auth state)
├── hooks/ # Custom React hooks (use-toast, etc.)
├── integrations/ # Third-party integrations (Supabase client)
├── pages/ # Main application pages (Auth, Dashboard, Index)
├── utils/ # Utility functions
└── App.tsx # Main application entry point with routing
- STUDENT: Stores student profiles (USN, Name, Email, Dept, Year).
- Librarian: Stores librarian profiles.
- BOOKS: Library inventory.
- ISSUE: Tracks book transactions (Issue Date, Return Date, Status).
- FINE: Records fines associated with issues.
- Implementation Details - Technical implementation and architecture decisions
- Features Implemented - Complete list of all implemented features
- Quick Reference - Quick guide for common tasks and operations