Skip to content

one-Alive/readwise

Repository files navigation

πŸ“š Readwise: Social Book Review Platform

Readwise is a Next.js (React) web application developed as part of the research project:

"Accelerating Book Recommendations: Real-Time Personalization on Social Review Platforms with FAISS and LDA"

It enables users to discover, review, and discuss books through real-time, personalized recommendations powered by FAISS and LDA.


πŸš€ Features

  • ⚑ Real-Time Recommendations: Sub-50ms latency using FAISS and topic modeling (LDA).
  • 🧭 User Onboarding: Multi-step flow to initialize reading preferences.
  • πŸ’¬ Social Interactions: Thread creation, comments, and ratings on books.
  • πŸ” Book Discovery: Search, trending books, metadata, and reviews.
  • πŸ‘€ User Profiles: View personal threads and recommendation history.
  • πŸ’³ Purchase / Rental System: Rent or buy books directly within the app.
  • πŸŒ™ Responsive UI: Built with Tailwind CSS, dark/light theme switcher, and Geist fonts.

πŸ› οΈ Prerequisites

  • Node.js: v18.x or higher
  • npm: For dependency management
  • Backend API: e.g., https://x.ai/api
  • Fonts: GeistMonoVF.woff and GeistVF.woff should be placed in app/fonts/

βš™οΈ Setup Instructions

1. Clone the Repository

git clone https://github.com/one-Alive/readwise.git
cd readwise

2. Install Dependencies

npm install

3. Configure Environment Variables

Create a .env.local file in the root directory for clerk api

4. Start the Development Server

npm run dev

Open http://localhost:3000 in your browser.


πŸ§ͺ Usage

πŸ” Authentication

  • /auth/sign-up
  • /auth/sign-in

🧭 Onboarding (/auth/onboarding)

  1. welcome.tsx – Welcome screen
  2. interests.tsx – Select interests
  3. recommendation.tsx – Preview personalized recommendations
  4. final.tsx – Finalize and save preferences

πŸ“š Book Discovery

  • Trending: /discover

  • Search: /search

  • Book Details: /details/[id]

    • Includes: BookMetadataCard, SampleReviewCard, and Comments

πŸ’¬ Community

  • Create threads: /create-thread
  • View threads and engage: /thread/[id]
  • Rate books using the Rating component

πŸ‘€ Profiles

  • View user activity: /profile/[id]
  • Explore personal threads via ThreadsTab

πŸ’Έ Buy or Rent Books

  • Rent: /rentals/[id]/[user_id]
  • Buy: /purchase/[id]/[user_id]

πŸ–ΌοΈ Screenshots

Located in the ss/ folder:

  • homepage.png
  • onboarding.png
  • book-details.png
  • recommendations.png
  • profile.png

πŸ“ Project Structure

readwise/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ (auth)/
β”‚   β”‚   β”œβ”€β”€ onboarding/
β”‚   β”‚   β”œβ”€β”€ sign-in/
β”‚   β”‚   └── sign-up/
β”‚   β”œβ”€β”€ (root)/
β”‚   β”‚   β”œβ”€β”€ create-thread/
β”‚   β”‚   β”œβ”€β”€ details/[id]/
β”‚   β”‚   β”œβ”€β”€ discover/
β”‚   β”‚   β”œβ”€β”€ profile/[id]/
β”‚   β”‚   β”œβ”€β”€ purchase/[id]/[user_id]/
β”‚   β”‚   β”œβ”€β”€ rentals/[id]/[user_id]/
β”‚   β”‚   β”œβ”€β”€ search/
β”‚   β”‚   └── thread/[id]/
β”‚   β”œβ”€β”€ fonts/
β”‚   └── ThemeProvider.tsx
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ cards/
β”‚   β”œβ”€β”€ forms/
β”‚   β”œβ”€β”€ onboarding/
β”‚   β”œβ”€β”€ shared/
β”‚   └── ui/
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ actions/
β”‚   β”œβ”€β”€ validations/
β”‚   └── utils.ts
β”œβ”€β”€ public/
β”œβ”€β”€ ss/
β”œβ”€β”€ .env.local
β”œβ”€β”€ next.config.mjs
β”œβ”€β”€ tailwind.config.ts
β”œβ”€β”€ tsconfig.json
└── README.md

πŸ“¦ Scripts

  • npm run dev – Start development server
  • npm run build – Build for production
  • npm run start – Launch production build

🧰 Technologies

  • Next.js – App Router, SSR, SSG
  • React + TypeScript – Component-driven development
  • Tailwind CSS – Utility-first styling
  • Axios – For API communication
  • Geist Fonts – Custom font system

CDN Fallbacks


🌐 API Integration

Endpoint:

Example Request:

{
  "user_id": "user_1",
  "liked_book_ids": ["1001", "1002"],
  "preferred_author_ids": ["author_1"],
  "user_interests": ["science", "fiction"],
  "top_n": 5
}

Example Response:

[
  {
    "book_id": "1003",
    "title": "Science Book A",
    "similarity": 0.95
  }
]

⚠️ Note on Backend

This repository contains only the frontend. The Flask-based backend, including FAISS, LDA, and recommendation logic, will be released separately.


πŸš€ Deployment

npm run build

πŸ“„ License

This project is licensed under the MIT License.


πŸ“¬ Contact

Questions or feedback? Reach out to @oneAlive or open an issue.

About

A social book review and discovery platform with real-time, personalized recommendations using FAISS and LDA. Built with Next.js, Tailwind CSS, and TypeScript.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages