Skip to content

DmytroLysachenko/library-app

Repository files navigation

LibraryView

Overview

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.

Features

User Features

  • 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 Features

  • 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)

Tech Stack

Frontend

  • TypeScript
  • Next.js 15 with App Router
  • React Server Actions for efficient client-server communication
  • shadcn/ui for UI components
  • TailwindCSS for styling

Backend

  • 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

Installation and Setup

Prerequisites

Ensure you have the following installed:

  • Node.js 18+
  • PostgreSQL database (Neon.tech recommended)
  • Environment variables configured (see .env.example for required keys)

Clone the Repository

git clone https://github.com/DmytroLysachenko/library-app.git
cd library-app

Install Dependencies

npm install

Database Setup

npm run db:generate
npm run db:migrate
npm run seed # (optional: seed database with initial data)

Run the Development Server

npm run dev

Scripts

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

Environment Variables

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>

Contributing

Contributions are welcome! Please follow the standard GitHub flow:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature-name)
  3. Commit changes (git commit -m "Add feature")
  4. Push to branch (git push origin feature-name)
  5. Open a Pull Request

License

This project is licensed under the MIT License.

About

Library keeper app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •