Capybook is a modern reading tracking application built with Next.js. It helps readers track their reading progress, manage their book collection, set reading goals, write reviews, and connect with a community of book lovers.
Capybook was founded in 2025 with a mission to transform how readers track and enjoy their reading experience. The application was created to solve the common problem of losing track of reading progress or forgetting where you left off in a book.
- π Reading Progress Tracking: Track your progress through each book with intuitive and customizable tools
- π Book Management: Organize your personal library with books you're reading, want to read, or have completed
- π― Reading Goals: Set and track reading goals (books, pages, or time-based)
- β Reviews & Ratings: Write and share book reviews with customizable privacy settings
- π Achievements & Badges: Earn badges for various reading milestones
- π₯ Community: Connect with other readers, follow friends, and share your reading journey
- π Statistics: Analyze your reading habits with detailed and personalized statistics
- π Daily Book: Discover a new book recommendation every day
- π Book Lending: Borrow and lend books with friends
- π Notes & Quotes: Take notes and save quotes from your books
- Framework: Next.js 15 (App Router)
- Language: TypeScript
- Database: PostgreSQL with Prisma ORM
- Authentication: NextAuth.js v5
- Styling: Tailwind CSS
- UI Components: Radix UI
- State Management: Zustand, SWR
- Animations: Motion (Framer Motion)
- Testing: Vitest (unit tests), Playwright (E2E tests)
- Package Manager: pnpm
Before you begin, ensure you have the following installed:
- Node.js 20.x or higher
- pnpm (recommended) or npm/yarn
- PostgreSQL database (local or cloud-hosted)
- Git
git clone https://github.com/Raxuis/Capybook.git
cd capybookpnpm installCreate a .env file in the root directory with the following variables:
# Database
DATABASE_URL="postgresql://user:password@localhost:5432/capybook?schema=public"
# NextAuth
NEXTAUTH_SECRET="your-secret-key-here"
NEXTAUTH_URL="http://localhost:3000"
# Optional: For production
AUTH_URL="http://localhost:3000"Important:
- Generate a secure
NEXTAUTH_SECRETusing:openssl rand -base64 32 - Update
DATABASE_URLwith your PostgreSQL connection string - For production, set
NEXTAUTH_URLto your production domain
Generate Prisma Client and run migrations:
# Generate Prisma Client
pnpm prisma generate
# Run database migrations
pnpm prisma migrate dev
# (Optional) Seed badges
pnpm seed-badgespnpm devOpen http://localhost:3000 in your browser to see the application.
pnpm dev # Start development server with Turbopack
pnpm build # Build for production
pnpm start # Start production server
pnpm lint # Run ESLint
pnpm type-check # Run TypeScript type checkingpnpm prisma generate # Generate Prisma Client
pnpm prisma migrate # Run database migrations
pnpm prisma studio # Open Prisma Studio (database GUI)
pnpm seed-badges # Seed badges into databasepnpm test # Run unit tests in watch mode
pnpm test:unit # Run unit tests once
pnpm test:unit:watch # Run unit tests in watch mode
pnpm test:e2e # Run E2E tests
pnpm test:e2e:ui # Run E2E tests with Playwright UI
pnpm test:e2e:report # Show E2E test reportcapybook/
βββ app/ # Next.js App Router pages
β βββ (user)/ # User-facing routes
β βββ (admin)/ # Admin routes
β βββ api/ # API routes
βββ components/ # React components
β βββ ui/ # Reusable UI components
β βββ Dashboard/ # Dashboard components
β βββ BookStore/ # Book store components
β βββ ...
βββ prisma/ # Prisma schema and migrations
βββ lib/ # Utility libraries
βββ hooks/ # Custom React hooks
βββ store/ # Zustand stores
βββ tests/ # Test files
β βββ e2e/ # End-to-end tests
β βββ unit/ # Unit tests
β βββ utils/ # Test utilities
βββ public/ # Static assets
- Track progress by percentage or pages
- Set a current book
- Mark books as finished
- View reading history
- Add books to your collection
- Organize books into shelves (reading, want to read, completed)
- Search and discover new books
- View book details and covers
- Write detailed book reviews
- Rate books from 1 to 5 stars
- Control review visibility:
- Public: Visible to everyone
- Private: Only accessible via private link
- Friends: Visible to your followers
- Specific Friend: Visible to one selected friend
- Set goals for:
- Number of books to read
- Number of pages to read
- Time spent reading
- Track progress toward goals
- Set deadlines
- View reading statistics:
- Books read
- Pages read
- Reading streak
- Genre distribution
- Reading pace
- Discover a new book recommendation every day
- View book of the day history
- Track which daily books you've viewed
- Request to borrow books from friends
- Manage lending requests (accept/reject)
- Track borrowed and lent books
- Set due dates and reminders
The application uses PostgreSQL with the following main models:
- User: User accounts and profiles
- Book: Book information
- UserBook: User's book collection and progress
- BookReview: Reviews and ratings
- ReadingGoal: Reading objectives
- Badge & UserBadge: Achievement system
- BookLending: Book borrowing system
- ReadingProgress & ReadingDay: Reading statistics
- DailyBook: Daily book recommendations
See prisma/schema.prisma for the complete schema.
The application uses NextAuth.js v5 with:
- Credentials Provider: Email/password authentication
- JWT Sessions: 30-day session duration
- Role-based Access: USER, ADMIN, MODERATOR roles
- Protected Routes: Middleware-based route protection
- Push your code to GitHub
- Import the project in Vercel
- Add environment variables in Vercel dashboard
- Deploy
The vercel-build script automatically:
- Generates Prisma Client
- Runs migrations
- Seeds badges
- Builds the application
Ensure you:
- Set all required environment variables
- Run
pnpm prisma generatebefore building - Run
pnpm prisma migrate deployto apply migrations - Optionally run
pnpm seed-badgesto seed initial data
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
The project includes comprehensive testing:
- Unit Tests: Component and hook testing with Vitest
- E2E Tests: Full user flow testing with Playwright
See TESTS.md for detailed testing documentation.
This project is licensed under a Non-Commercial License. See LICENSE.md for details.
Summary: You are free to use, modify, and distribute this software for non-commercial purposes. Commercial use requires explicit permission from the copyright holder.
For support, email raxuis@proton.me or open an issue on GitHub.
Made with β€οΈ by RaphaΓ«l Raclot