An open API service indexing awesome lists of open source software.

https://github.com/one-alive/readwise

A social book review and discovery platform with real-time, personalized recommendations using FAISS and LDA. Built with Next.js, Tailwind CSS, and TypeScript.
https://github.com/one-alive/readwise

book-discovery book-recommendation clerk-auth clerk-authentication faiss lda nextjs react real-time-recommendations recommender-system social-platform tailwindcss typescript webapp

Last synced: about 2 months ago
JSON representation

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

Awesome Lists containing this project

README

          

# ๐Ÿ“š 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

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

### 2. Install Dependencies

```bash
npm install
```

### 3. Configure Environment Variables

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

### 4. Start the Development Server

```bash
npm run dev
```

Open [http://localhost:3000](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

* React: `https://cdn.jsdelivr.net/npm/react@18.2.0/umd/react.production.min.js`
* ReactDOM: `https://cdn.jsdelivr.net/npm/react-dom@18.2.0/umd/react-dom.production.min.js`

---

## ๐ŸŒ API Integration

**Endpoint:**

**Example Request:**

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

**Example Response:**

```json
[
{
"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

```bash
npm run build
```

---

## ๐Ÿ“„ License

This project is licensed under the **MIT License**.

---

## ๐Ÿ“ฌ Contact

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