|
1 | | -# PaperDebugger |
| 1 | + |
2 | 2 |
|
3 | | -## Clone and Build (locally) |
| 3 | +PaperDebugger is an AI-powered academic writing assistant that helps researchers debug and improve their LaTeX papers. This document provides comprehensive setup and deployment instructions for the backend service. |
4 | 4 |
|
5 | | -**Prequisite:** |
6 | | -- `brew install bufbuild/buf/buf` |
| 5 | +## Overview |
| 6 | +The PaperDebugger backend is built with: |
7 | 7 |
|
8 | | -**Clone and Build** |
9 | | -```bash |
10 | | -git clone https://github.com/PaperDebugger/paperdebugger.git |
11 | | -cd paperdebugger |
| 8 | +<img src="docs/imgs/stacks.png" style="height: 200px;" /> |
12 | 9 |
|
13 | | -make deps # install dependencies and libraries |
14 | | -make build # build the backend |
15 | | -# the binary is located in ./dist/pd.exe |
| 10 | +- **Language**: Go 1.24+ |
| 11 | +- **Framework**: Gin (HTTP) + gRPC (API) |
| 12 | +- **Database**: MongoDB |
| 13 | +- **AI Integration**: OpenAI API |
| 14 | +- **Architecture**: Microservices with Protocol Buffers |
| 15 | +- **Authentication**: JWT-based with OAuth support |
16 | 16 |
|
17 | | -cd webapp/_webapp |
18 | | -npm run build:prd:chrome |
19 | | -# the extension is located in wbeapp/_webapp/dist/* |
20 | | -``` |
| 17 | +## Features |
21 | 18 |
|
22 | | -**Run mongodb** |
| 19 | +PaperDebugger never modifies your project, it only reads and provides suggestions. |
23 | 20 |
|
24 | | -```bash |
25 | | -docker run -d --name mongodb -p 27017:27017 mongo:latest |
26 | | -``` |
| 21 | +- **Chat**: AI-powered chats about your overleaf project |
| 22 | +- **Instant Insert**: One-click, insert AI response to your project |
| 23 | +- **Comment System**: Automatically generate comments and insert into your project |
| 24 | +- **Prompt Library**: Custom prompt templates for different use cases |
27 | 25 |
|
28 | | -**Run backend** |
| 26 | +## Prerequisites |
29 | 27 |
|
| 28 | +### System Requirements |
| 29 | +- **Go**: 1.24 or higher |
| 30 | +- **Node.js**: LTS version (for frontend build) |
| 31 | +- **MongoDB**: 4.4 or higher |
| 32 | +- **Git**: For cloning the repository |
| 33 | + |
| 34 | +### Development Tools |
| 35 | +- **Buf**: Protocol Buffer compiler |
| 36 | +- **Wire**: Dependency injection code generator |
| 37 | +- **Make**: Build automation |
| 38 | + |
| 39 | +### Installation |
| 40 | + |
| 41 | +#### On macOS/Linux (using Homebrew) |
30 | 42 | ```bash |
31 | | -./dist/pd.exe |
32 | | -``` |
| 43 | +# Install Go |
| 44 | +brew install go |
33 | 45 |
|
34 | | -## Step 1 k9s |
| 46 | +# Install Buf (required for Protocol Buffers) |
| 47 | +brew install bufbuild/buf/buf |
35 | 48 |
|
36 | | -open k9s, then expose the mongo db port at 27017 |
37 | | -and also expose paperdebugger-mcp at 8000. (also make sure you modify the `/etc/hosts` let `127.0.0.1 paperdebugger-mcp-server`) |
| 49 | +# Install Node.js |
| 50 | +brew install node |
| 51 | +``` |
38 | 52 |
|
39 | | -## Step 2 build |
| 53 | +## Backend Build |
40 | 54 |
|
| 55 | +### 1. Clone |
41 | 56 | ```bash |
42 | | -make deps # 安装依赖 |
43 | | -make build |
| 57 | +# Clone the repository |
| 58 | +git clone https://github.com/PaperDebugger/paperdebugger.git |
| 59 | +cd paperdebugger |
44 | 60 | ``` |
45 | 61 |
|
| 62 | +### 2. Start MongoDB |
| 63 | +```bash |
| 64 | +# Using Docker (recommended) |
| 65 | +docker run -d --name mongodb -p 27017:27017 mongo:latest |
| 66 | +``` |
46 | 67 |
|
47 | | -## Step 3 run |
| 68 | +### 3. Setting up environments |
48 | 69 |
|
49 | 70 | ```bash |
50 | | -PD_MONGO_URI="mongodb://localhost:27017" ./dist/pd.exe |
| 71 | +cp .env.example .env |
| 72 | +# edit the .env file based on your condition |
51 | 73 | ``` |
52 | 74 |
|
| 75 | +### 4. Build and Run |
53 | 76 |
|
54 | | -## 从克隆开始 |
55 | | - |
56 | | -### 自动 |
57 | 77 | ```bash |
58 | | -make all |
| 78 | +# Build the backend |
| 79 | +make build |
| 80 | +# Run the backend server |
| 81 | +./dist/pd.exe |
59 | 82 | ``` |
60 | 83 |
|
61 | | -### 手动 |
| 84 | +The server will start on `http://localhost:6060`. |
62 | 85 |
|
63 | | -#### 0. 安装环境 |
| 86 | + |
64 | 87 |
|
65 | | -```bash |
66 | | -make deps |
67 | | -``` |
68 | 88 |
|
69 | | -#### 1. Web 构建 |
| 89 | +## Frontend Extension Build |
70 | 90 |
|
| 91 | +### Chrome Extension |
71 | 92 | ```bash |
72 | 93 | cd webapp/_webapp |
| 94 | + |
| 95 | +# Install frontend dependencies |
73 | 96 | npm install |
74 | 97 |
|
75 | | -npm run build:local:chrome # 构建本地版本(链接至本地后端) |
76 | | -# or |
77 | | -npm run build:prd:chrome # 构建生产环境版本(连接至生产环境服务器) |
| 98 | +# Build for production (connects to production server) |
| 99 | +npm run build:prd:chrome |
| 100 | + |
| 101 | +# The extension files will be in dist/ |
| 102 | +cd dist |
| 103 | +zip -r paperdebugger-extension.zip * |
78 | 104 | ``` |
79 | 105 |
|
80 | | -#### 2. 后端 构建 |
| 106 | +### Installing the Extension |
| 107 | +1. Open Chrome and navigate to `chrome://extensions/` |
| 108 | +2. Enable "Developer mode" |
| 109 | +3. Click "Load unpacked" and select the `webapp/_webapp/dist` directory, or drag the `paperdebugger-extension.zip` file into the extensions page |
81 | 110 |
|
82 | | -```bash |
83 | | -make build |
84 | | -``` |
| 111 | +## Custom Endpoint Configuration |
| 112 | + |
| 113 | +If you're using PaperDebugger with Overleaf.com, ensure your backend service uses HTTPS. Chrome blocks HTTP requests from HTTPS websites for security reasons. |
| 114 | + |
| 115 | + |
| 116 | + |
| 117 | +To configure a custom endpoint: |
| 118 | +1. Open the PaperDebugger extension |
| 119 | +2. Go to Settings, click version number 5 times to enabled "Developer Tools" |
| 120 | +3. Enter your backend URL in the "Backend Endpoint" field |
| 121 | +4. Refresh the page |
| 122 | + |
| 123 | +If you encounter endpoint errors after refresh, use the "Advanced Options" at the bottom of the login page to reconfigure the endpoint. |
0 commit comments