Skip to content

wynn5a/chat2book

Repository files navigation

Chat2Book

Chat2Book is a RAG-based platform for uploading a book, extracting its main characters, and chatting with them in character.

Overview

  • Upload a book and process it into searchable RAG context
  • Extract the main characters and generate lightweight character profiles
  • Start a character conversation grounded in the source material

Screenshots

Home

Chat2Book home screen

Characters

Chat2Book character list

Chat

Chat2Book chat screen

Prerequisites

  • Java 21
  • Node.js 22 via nvm
  • pnpm
  • Docker and Docker Compose
  • OPENAI_API_KEY

Quick Start

1. Start infrastructure

docker-compose up -d

PostgreSQL is exposed on localhost:5433.

2. Configure environment

export OPENAI_API_KEY=sk-xxx

Optional:

export OPENAI_BASE_URL=https://api.openai.com

3. Start the backend

cd backend
./mvnw spring-boot:run

Backend runs on http://localhost:8080.

4. Start the frontend

cd frontend
pnpm install
pnpm dev

Frontend runs on http://localhost:5173.

Common Development Commands

Backend

cd backend
./mvnw test

Frontend

cd frontend
pnpm lint

Repository Layout

  • backend/: Spring Boot backend
  • frontend/: React frontend
  • spec/: canonical design and planning documents

Troubleshooting

Database connection issues

docker-compose ps

OpenAI API errors

echo $OPENAI_API_KEY

Frontend cannot reach backend

Verify:

  • backend is running on http://localhost:8080
  • frontend is running on http://localhost:5173

About

A tool that can allow you to chat with the person in book

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors