LibraryView is a full-featured library management application built with modern web technologies. It offers both user and admin functionalities, providing a seamless experience for managing books, borrow requests, and user accounts. The app leverages Next.js 15 with the app router, React server actions, and a rich tech stack to ensure high performance and scalability.
- Authentication using Auth.js
- Personalized Profile with avatar and borrowing history
- Library Books List with:
- Search
- Filtering
- Sorting
- Querying
- Pagination
- Borrowing System
- Users can request to borrow books
- Track borrow/return history
- Admin Console with Dashboard displaying library statistics
- User Management
- List of all users
- Modify user roles
- Remove users from the platform
- Book Management
- Add new books
- Edit existing books
- Borrow Requests Management
- Approve/reject borrow requests
- Change borrow statuses (pending/borrowed/returned)
- Generate and send PDF receipts (stored on AWS)
- Borrow Records
- View borrow history
- Retrieve necessary details
- Account Requests Management
- Review newly created accounts
- Approve accounts for access (users cannot borrow books until approved)
- TypeScript
- Next.js 15 with App Router
- React Server Actions for efficient client-server communication
- shadcn/ui for UI components
- TailwindCSS for styling
- TypeScript
- Neon (Serverless PostgreSQL Database)
- Drizzle ORM for database management
- Upstash Workflows & Redis Ratelimit for caching and rate limiting
- Auth.js for authentication
- Nodemailer for email services
- ImageKit for media storage
- AWS S3 for storing PDF receipts
- Puppeteer for generating PDF receipts
Ensure you have the following installed:
- Node.js 18+
- PostgreSQL database (Neon.tech recommended)
- Environment variables configured (see
.env.example
for required keys)
git clone https://github.com/DmytroLysachenko/library-app.git
cd library-app
npm install
npm run db:generate
npm run db:migrate
npm run seed # (optional: seed database with initial data)
npm run dev
Script | Description |
---|---|
npm run dev |
Runs the development server with Turbopack |
npm run build |
Builds the application |
npm run start |
Starts the production server |
npm run lint |
Runs ESLint |
npm run db:generate |
Generates database schema |
npm run db:migrate |
Applies database migrations |
npm run db:studio |
Opens database UI |
npm run seed |
Seeds the database |
Create a .env.local
file and configure the following variables:
NEXT_PUBLIC_IMAGEKIT_URL_ENDPOINT=<ImageKit API endpoint>
NEXT_PUBLIC_IMAGEKIT_PUBLIC_KEY=<ImageKit public API key>
NEXT_PUBLIC_BASE_URL=<Base URL of the application>
DATABASE_URL=<PostgreSQL database connection string>
AUTH_SECRET=<Secret key for authentication>
UPSTASH_REDIS_URL=<Upstash Redis database URL>
UPSTASH_REDIS_TOKEN=<Upstash Redis authentication token>
QSTASH_URL=<Upstash QStash URL>
QSTASH_TOKEN=<Upstash QStash authentication token>
GMAIL_USER=<Gmail email address for sending notifications>
GMAIL_PASSWORD=<Gmail app password>
AWS_ACCESS_KEY_ID=<AWS access key ID>
AWS_SECRET_ACCESS_KEY=<AWS secret access key>
AWS_REGION=<AWS region for S3 storage>
AWS_S3_BUCKET_NAME=<AWS S3 bucket name for storing PDFs>
Contributions are welcome! Please follow the standard GitHub flow:
- Fork the repository
- Create a feature branch (
git checkout -b feature-name
) - Commit changes (
git commit -m "Add feature"
) - Push to branch (
git push origin feature-name
) - Open a Pull Request
This project is licensed under the MIT License.