A modern, feature-rich web application for managing your personal book library. Built with Next.js, NestJS, PostgreSQL, and Prisma.
- β User Authentication - Secure JWT-based authentication with refresh tokens
- π Book Management - Add, edit, delete, and organize your book collection
- π Reading Progress Tracking - Track pages read and reading progress
- β Rating System - Rate your books from 1-5 stars
- π Personal Notes - Add notes for each book
- π·οΈ Genre Organization - Categorize books by genre
- π Smart Search - Search by title, author, or ISBN
- π Dashboard Analytics - View reading statistics and progress
- π Dark Mode - Beautiful dark/light theme toggle
- π± Responsive Design - Works perfectly on desktop, tablet, and mobile
- π Google Books API Integration - Auto-fill book details by searching
- π― Filtering & Sorting - Filter by status, sort by various criteria
- π Reading Statistics - Track your reading journey with charts
- π¨ Modern UI - Built with Tailwind CSS and ShadCN/UI components
- β‘ Real-time Updates - Instant UI updates with React Query
- π Secure - Password hashing, rate limiting, and protected routes
- Framework: Next.js 15 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS
- UI Components: ShadCN/UI
- State Management: Zustand
- Data Fetching: TanStack Query (React Query)
- Form Handling: React Hook Form + Zod
- Theme: next-themes
- Framework: NestJS
- Language: TypeScript
- Database: PostgreSQL
- ORM: Prisma
- Authentication: JWT + Passport
- Validation: class-validator
- Security: Helmet, Rate Limiting, CORS
Before you begin, ensure you have the following installed:
- Node.js 18.x or higher
- npm or yarn
- PostgreSQL 14.x or higher
- Git
git clone <repository-url>
cd my-librarycd backend
# Install dependencies
npm install
# Configure environment variables
cp .env.example .env
# Edit .env and update the DATABASE_URL and other settings
# Generate Prisma Client
npx prisma generate
# Run database migrations
npx prisma migrate dev
# (Optional) Seed the database with sample data
npm run seed
# Start the backend server
npm run start:devThe backend API will be available at http://localhost:3001/api
cd frontend
# Install dependencies
npm install
# Configure environment variables
# Create .env.local file (already provided)
# Start the development server
npm run devThe frontend will be available at http://localhost:3000
# Database
DATABASE_URL="postgresql://username:password@localhost:5432/my_library?schema=public"
# JWT Configuration
JWT_SECRET="your-super-secret-jwt-key"
JWT_REFRESH_SECRET="your-super-secret-refresh-jwt-key"
JWT_EXPIRATION="15m"
JWT_REFRESH_EXPIRATION="7d"
# Application
PORT=3001
NODE_ENV="development"
# CORS
FRONTEND_URL="http://localhost:3000"
# Google Books API (Optional)
GOOGLE_BOOKS_API_KEY="your-google-books-api-key"NEXT_PUBLIC_API_URL=http://localhost:3001/api
NEXT_PUBLIC_APP_NAME="My Library"The application uses the following database models:
- User - User accounts with authentication
- RefreshToken - JWT refresh tokens
- Genre - Book genres/categories
- Book - Book information and metadata
- ReadingProgress - Track reading progress over time
- Note - Personal notes for books
See backend/prisma/schema.prisma for the complete schema.
POST /api/auth/signup- Create new accountPOST /api/auth/login- Sign inPOST /api/auth/refresh- Refresh access tokenPOST /api/auth/logout- Sign outGET /api/auth/me- Get current user
GET /api/books- Get all user books (with filters, search, sorting)GET /api/books/:id- Get single bookPOST /api/books- Create new bookPATCH /api/books/:id- Update bookDELETE /api/books/:id- Delete bookGET /api/books/statistics- Get reading statistics
POST /api/books/:id/progress- Update reading progressGET /api/books/:id/progress- Get progress historyPOST /api/books/:id/notes- Add noteGET /api/books/:id/notes- Get all notesDELETE /api/books/:id/notes/:noteId- Delete note
GET /api/genres- Get all genresPOST /api/genres- Create genrePATCH /api/genres/:id- Update genreDELETE /api/genres/:id- Delete genre
GET /api/google-books/search?q=query- Search booksGET /api/google-books/isbn?isbn=123- Get book by ISBN
# Build the application
npm run build
# Run migrations in production
npx prisma migrate deploy
# Start the production server
npm run start:prod# Build for production
npm run build
# Start the production server
npm start- Frontend: Vercel, Netlify, AWS Amplify
- Backend: Railway, Render, Heroku, AWS EC2
- Database: Railway, Supabase, AWS RDS, DigitalOcean
- Sign Up: Create a new account at
/signup - Add Books:
- Click "Add Book" button
- Search using Google Books API or add manually
- Fill in book details and save
- Manage Library:
- View all books in "My Library"
- Filter by status (Reading, Completed, Want to Read)
- Search by title, author, or ISBN
- Sort by various criteria
- Track Progress:
- Click on a book to edit
- Update reading status and pages read
- Add personal notes and ratings
- View Statistics:
- Check the Dashboard for reading analytics
- See top genres and reading progress
- Password hashing with bcrypt
- JWT access tokens (15 min expiration)
- Refresh tokens (7 day expiration)
- Rate limiting (100 requests per minute)
- CORS protection
- Helmet security headers
- Input validation
- Protected API routes
- Clean, modern Material Design-inspired interface
- Smooth animations and transitions
- Loading states and skeletons
- Toast notifications for user feedback
- Responsive grid layouts
- Mobile-friendly navigation
- Accessible components (ARIA labels)
# Backend tests
cd backend
npm run test
npm run test:e2e
# Frontend tests
cd frontend
npm run testContributions are welcome! Please feel free to submit a Pull Request.
This project is open source and available under the MIT License.
- Google Books API for book data
- ShadCN for beautiful UI components
- Next.js and NestJS teams for excellent frameworks
For issues, questions, or suggestions, please open an issue on GitHub.
Built with β€οΈ using modern web technologies