File size: 2,188 Bytes
de7b4d8
 
 
 
 
 
 
 
194aaa5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
de7b4d8
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
---
license: mit
title: Rednote
sdk: docker
emoji: πŸ“š
colorFrom: yellow
colorTo: red
---
# Document Assistant (RAG Notebook)

A full-stack RAG (Retrieval-Augmented Generation) document assistant application built to upload, index, and query documents using PostgreSQL (with `pgvector`), FastAPI, and a React + TypeScript frontend.

## Project Structure

```text
β”œβ”€β”€ backend/               # FastAPI Python Backend
β”œβ”€β”€ frontend/              # React (Vite + TypeScript) Frontend
β”œβ”€β”€ docker-compose.yml     # Multi-container orchestration
β”œβ”€β”€ nginx.conf             # Nginx reverse proxy configuration
└── .env.example           # Example environment variables
```

## Quick Start (Docker Compose)

The easiest way to run the entire stack is using Docker Compose.

### Prerequisites
* [Docker Desktop](https://www.docker.com/products/docker-desktop/) (with WSL 2 integration enabled if on Windows)

### Steps

1. **Configure Environment Variables**
   Copy the `.env` template from the backend directory to the root (or create a `.env` in the root containing your keys):
   ```bash
   cp backend/.env .env
   ```
   Ensure your `.env` contains a valid `GROQ_API_KEY` and a secure `SECRET_KEY` (for JWT authentication).

2. **Start the Application**
   Run the following command to build the Docker images and start the services:
   ```bash
   docker compose up -d --build
   ```

3. **Access the App**
   * **Frontend Application**: [http://localhost](http://localhost) (runs on port `80` served by Nginx)
   * **Backend API Docs**: [http://localhost:8000/docs](http://localhost:8000/docs)
   * **PostgreSQL Database**: Port `5432` (accessible from host using database settings in `.env`)

4. **Shutdown**
   To stop the services while preserving your data:
   ```bash
   docker compose down
   ```
   To stop and wipe database data:
   ```bash
   docker compose down -v
   ```

## Development

For instructions on running backend or frontend individually outside of Docker:
* Refer to the [Backend README](file:///c:/Users/shahs/project/notebook/backend/README.md)
* Refer to the [Frontend README](file:///c:/Users/shahs/project/notebook/frontend/README.md)