File size: 1,839 Bytes
4d592a4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# RAG System Frontend

React + TypeScript frontend for the Production-Grade RAG System.

## Tech Stack

- **Framework**: React 18+ with TypeScript
- **Styling**: Tailwind CSS
- **State Management**: React Context API
- **HTTP Client**: Axios
- **File Upload**: react-dropzone
- **Icons**: lucide-react
- **Notifications**: react-hot-toast

## Project Structure

```
src/
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ layout/
β”‚   β”‚   β”œβ”€β”€ Header.tsx
β”‚   β”‚   β”œβ”€β”€ Sidebar.tsx
β”‚   β”‚   └── MainContent.tsx
β”‚   β”œβ”€β”€ documents/
β”‚   β”‚   β”œβ”€β”€ FileUpload.tsx
β”‚   β”‚   β”œβ”€β”€ DocumentList.tsx
β”‚   β”‚   └── DocumentCard.tsx
β”‚   β”œβ”€β”€ query/
β”‚   β”‚   β”œβ”€β”€ QueryInput.tsx
β”‚   β”‚   └── ModeSelector.tsx
β”‚   β”œβ”€β”€ results/
β”‚   β”‚   β”œβ”€β”€ ResultsDisplay.tsx
β”‚   β”‚   β”œβ”€β”€ AnswerCard.tsx
β”‚   β”‚   β”œβ”€β”€ ConfidenceIndicator.tsx
β”‚   β”‚   β”œβ”€β”€ SourcesList.tsx
β”‚   β”‚   └── SourceCard.tsx
β”‚   β”œβ”€β”€ common/
β”‚   β”‚   └── EmptyState.tsx
β”‚   └── settings/
β”‚       └── SettingsModal.tsx
β”œβ”€β”€ services/
β”‚   └── api.ts
β”œβ”€β”€ hooks/
β”œβ”€β”€ context/
β”‚   └── AppContext.tsx
β”œβ”€β”€ types/
β”‚   └── index.ts
β”œβ”€β”€ App.tsx
└── index.tsx
```

## Installation

```bash
npm install
```

## Development

```bash
npm run dev
```

## Build

```bash
npm run build
```

## Configuration

Copy `.env.example` to `.env` and configure:

```
VITE_API_URL=http://localhost:8000/api/v1
```

## Features

- PDF document upload with drag-and-drop
- Document management (list, select, delete)
- Multiple query modes (Web, PDF, Hybrid, Restricted)
- Real-time confidence scoring
- Source citations and attribution
- Dark/light theme
- Responsive design
- Keyboard shortcuts (Enter to submit)