A modern library management system built with Next.js (App Router), Prisma, and JWT authentication. This open-source project provides an efficient way to manage books, students, and borrowings.
- Authentication: Secure login for teachers using JWT.
- Book Management: CRUD operations for managing books in the library.
- Student Management: CRUD operations for managing student records.
- Borrowing System: Track borrowings, including statuses (BORROWED, RETURNED, OVERDUE).
- Responsive Design: Optimized for both desktop and mobile views.
- Modular Codebase: Clean and reusable components.
.
├── prisma/ # Prisma schema and migrations
│ ├── migrations/ # Database migrations
│ └── schema.prisma # Prisma schema file
├── src/
│ ├── app/
│ │ ├── api/ # API routes
│ │ │ ├── auth/ # Authentication routes
│ │ │ ├── books/ # Book-related routes
│ │ │ ├── borrowings/ # Borrowing-related routes
│ │ │ └── students/ # Student-related routes
│ │ ├── components/ # Reusable components
│ │ │ ├── layout/ # Layout components
│ │ │ └── ui/ # UI components
│ │ ├── dashboard/ # Dashboard pages
│ │ ├── globals.css # Global styles
│ │ ├── layout.js # Root layout
│ │ ├── login/ # Login page
│ │ └── page.js # Home page
├── public/ # Public assets
├── prisma/ # Prisma schema and migrations
├── jest.config.js # Jest configuration
├── next.config.mjs # Next.js configuration
├── tailwind.config.mjs # Tailwind CSS configuration
└── README.md # Project documentation
This project requires the following environment variables:
DATABASE_URL
: PostgreSQL connection string.JWT_SECRET
: Secret key for JWT token generation.
Create a .env
file in the root directory and add the variables:
DATABASE_URL=your_postgresql_connection_string
JWT_SECRET=your_jwt_secret_key
-
Clone the repository:
git clone https://github.com/jamolweb/library-web.git cd library-management-system
-
Install dependencies:
npm install
-
Set up the database:
- Ensure PostgreSQL is running.
- Update the
DATABASE_URL
in your.env
file. - Run Prisma migrations:
npx prisma migrate dev
-
Run the development server:
npm run dev
-
Access the application: Open your browser and navigate to
http://localhost:3000
.
- Authentication: Teachers can log in to access the dashboard.
- Dashboard: Manage books, students, and borrowings through the intuitive UI.
- API: RESTful endpoints for books, students, and borrowings.
- Frontend: Next.js (App Router), Tailwind CSS.
- Backend: Prisma, PostgreSQL.
- Authentication: JSON Web Tokens (JWT).
- Testing: Jest (optional setup included).
Contributions are welcome! Please fork the repository and submit a pull request.
This project is open-source and available under the MIT License.
Built with ❤️ by Jamoladdin.
Make sure to replace placeholders like `https://github.com/jamolweb/library-web.git` with your actual repository link and `Your Name` with your name.