Skip to content

Commit 25a86f2

Browse files
committed
frontend
1 parent 3a91c39 commit 25a86f2

21 files changed

+4288
-0
lines changed

frontend/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

frontend/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Document RAG Frontend
2+
3+
A React + Vite + TypeScript frontend for the Document RAG system.
4+
5+
## Setup
6+
7+
1. Navigate to the frontend directory:
8+
```bash
9+
cd frontend
10+
```
11+
2. Install dependencies:
12+
```bash
13+
npm install
14+
```
15+
3. Start the development server:
16+
```bash
17+
npm run dev
18+
```
19+
20+
## Features
21+
22+
- **Session Management**: Automatically generates unique sessions, persists them in sessionStorage, and ensures backend cleanup on reload/reset.
23+
- **Secure Key Handling**: Gemini API Key is stored in memory only and cleared on reload.
24+
- **Styling**: Custom CSS (no frameworks) with a premium dark/glassmorphism design.
25+
- **Type Safety**: Full TypeScript implementation.
26+
- **API Integration**: Connects to `http://localhost:8000/api`.
27+
28+
## Tech Stack
29+
30+
- React
31+
- Vite
32+
- TypeScript
33+
- Vanilla CSS

frontend/eslint.config.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import js from '@eslint/js'
2+
import globals from 'globals'
3+
import reactHooks from 'eslint-plugin-react-hooks'
4+
import reactRefresh from 'eslint-plugin-react-refresh'
5+
import tseslint from 'typescript-eslint'
6+
import { defineConfig, globalIgnores } from 'eslint/config'
7+
8+
export default defineConfig([
9+
globalIgnores(['dist']),
10+
{
11+
files: ['**/*.{ts,tsx}'],
12+
extends: [
13+
js.configs.recommended,
14+
tseslint.configs.recommended,
15+
reactHooks.configs.flat.recommended,
16+
reactRefresh.configs.vite,
17+
],
18+
languageOptions: {
19+
ecmaVersion: 2020,
20+
globals: globals.browser,
21+
},
22+
},
23+
])

frontend/index.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Document RAG Chat</title>
8+
<meta name="description" content="Secure document-based RAG chat application using Gemini API. Upload PDFs and chat instantly." />
9+
</head>
10+
<body>
11+
<div id="root"></div>
12+
<script type="module" src="/src/main.tsx"></script>
13+
</body>
14+
</html>

0 commit comments

Comments
 (0)