From 73e150a0f6decff77679d78032555fcd91e9f156 Mon Sep 17 00:00:00 2001 From: NikhilRaikar17 Date: Sun, 4 Aug 2024 21:41:22 +0200 Subject: [PATCH 1/8] Added workflow for frontend --- .github/workflows/ci.yml | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e7d5148..7b562d9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,7 @@ name: FastAPI CI on: [push, pull_request] jobs: - test: + FastApi-backend: runs-on: ubuntu-latest steps: @@ -38,3 +38,38 @@ jobs: echo "Health check failed" exit 1 fi + + Vue-frontend: + runs-on: ubuntu-latest + needs: FastApi-backend + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '20' + + - name: Install frontend dependencies + run: | + cd frontend + npm install + + - name: Run frontend development server + run: | + cd frontend + nohup npm run dev > /dev/null 2>&1 & + echo $! > npm.pid + sleep 10 + + - name: Verify frontend server is running + run: | + response=$(curl -s http://localhost:9000) + if [[ $response == *"expected content"* ]]; then + echo "Frontend is running" + else + echo "Frontend is not running or did not return expected content" + exit 1 + fi From 0956d909e52f332997fe6fd8e3af20ffa798be23 Mon Sep 17 00:00:00 2001 From: NikhilRaikar17 Date: Sun, 4 Aug 2024 21:44:24 +0200 Subject: [PATCH 2/8] Updated workflow --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b562d9..3ff59c9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,7 +66,8 @@ jobs: - name: Verify frontend server is running run: | - response=$(curl -s http://localhost:9000) + response=$(curl -s http://localhost:9000/2) + echo "Response: $response" if [[ $response == *"expected content"* ]]; then echo "Frontend is running" else From fbd987ede86afb34bc257b21f375beb328ccb08c Mon Sep 17 00:00:00 2001 From: NikhilRaikar17 Date: Sun, 4 Aug 2024 22:22:14 +0200 Subject: [PATCH 3/8] Updated frontend code --- .github/workflows/ci.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ff59c9..24174b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,10 +67,9 @@ jobs: - name: Verify frontend server is running run: | response=$(curl -s http://localhost:9000/2) - echo "Response: $response" - if [[ $response == *"expected content"* ]]; then - echo "Frontend is running" + if echo "$response" | grep -q "DOC-INFO"; then + echo "Frontend is running and contains 'DOC-INFO'" else - echo "Frontend is not running or did not return expected content" + echo "Frontend did not return expected content" exit 1 fi From 5db4d83a2a02cfd5a70c2dfb1de86398ed50b6c6 Mon Sep 17 00:00:00 2001 From: NikhilRaikar17 Date: Sun, 4 Aug 2024 22:25:47 +0200 Subject: [PATCH 4/8] Validating the workflows for the frontend --- .github/workflows/ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 24174b6..baeede2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,9 +60,8 @@ jobs: - name: Run frontend development server run: | cd frontend - nohup npm run dev > /dev/null 2>&1 & - echo $! > npm.pid - sleep 10 + npm run dev + sleep 20 - name: Verify frontend server is running run: | From 16037b12a8a5eed7f32eb90f5fc6a42bd3c8cc94 Mon Sep 17 00:00:00 2001 From: NikhilRaikar17 Date: Sun, 4 Aug 2024 22:30:18 +0200 Subject: [PATCH 5/8] Trying to check whether the workflows are proper --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index baeede2..7dfecd0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,12 +60,12 @@ jobs: - name: Run frontend development server run: | cd frontend - npm run dev + nohup npm run dev > /dev/null 2>&1 & sleep 20 - name: Verify frontend server is running run: | - response=$(curl -s http://localhost:9000/2) + response=$(curl -s http://127.0.0.1:9000/2) if echo "$response" | grep -q "DOC-INFO"; then echo "Frontend is running and contains 'DOC-INFO'" else From 95efb8d3a5b662006f0bd59d4de7189597c60631 Mon Sep 17 00:00:00 2001 From: NikhilRaikar17 Date: Sun, 4 Aug 2024 22:33:47 +0200 Subject: [PATCH 6/8] Checking github actions --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7dfecd0..b43c3d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,6 +66,7 @@ jobs: - name: Verify frontend server is running run: | response=$(curl -s http://127.0.0.1:9000/2) + echo "$response" if echo "$response" | grep -q "DOC-INFO"; then echo "Frontend is running and contains 'DOC-INFO'" else From 016bbabb8f0056bc12b2bc4e6ec5a3f3a3593242 Mon Sep 17 00:00:00 2001 From: NikhilRaikar17 Date: Sun, 4 Aug 2024 22:36:59 +0200 Subject: [PATCH 7/8] Updated workflow --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b43c3d3..3c1f409 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,8 +66,8 @@ jobs: - name: Verify frontend server is running run: | response=$(curl -s http://127.0.0.1:9000/2) - echo "$response" - if echo "$response" | grep -q "DOC-INFO"; then + sleep 10 + if echo "$response" | grep -q "rag app for small business"; then echo "Frontend is running and contains 'DOC-INFO'" else echo "Frontend did not return expected content" From 0e6d5da65168297162491155d6c23d1809acffb1 Mon Sep 17 00:00:00 2001 From: NikhilRaikar17 Date: Sun, 4 Aug 2024 22:41:21 +0200 Subject: [PATCH 8/8] Updated readme file --- README.md | 95 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 67 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 5c90ccb..d1eabd0 100644 --- a/README.md +++ b/README.md @@ -1,52 +1,91 @@ # RAGGI AI-Oracle -more text will be added soon... +RAGGI AI-Oracle is an application designed to leverage AI for advanced document handling and natural language processing. This repository contains both backend and frontend components to get the application up and running. -# Installation +## Installation -## Backend +### Backend -create a virtual env +1. **Create a virtual environment:** -> python -m venv venv + ```bash + python -m venv venv + ``` -install all packages +2. **Activate the virtual environment:** -> pip install -r requirements.txt + - On Windows: + ```bash + venv\Scripts\activate + ``` + - On macOS/Linux: + ```bash + source venv/bin/activate + ``` -run following command to run the dev server +3. **Install all required packages:** -> fastapi dev + ```bash + pip install -r requirements.txt + ``` -## Frontend +4. **Run the development server:** -navigate to **frontend/raggi** folder and following command to install all packages needed: + ```bash + fastapi dev + ``` -> npm install +### Frontend -then run following command to run the dev server: +1. **Navigate to the frontend directory:** -> quasar dev + ```bash + cd frontend/raggi + ``` -# Settings +2. **Install all necessary packages:** -## Environments + ```bash + npm install + ``` -1. add an .env file inside **rag** folder that contains Setting for Langfuse: +3. **Run the development server:** - - SECRET_KEY - - PUBLIC_KEY - - LANGFUSE_HOST + ```bash + npm run dev + ``` -2. add also an .env file in side **frontend/raggi** folder for the setting of the UI: +## Settings - - API="http://ip-adress-of-api:port" +### Environments -# Features +1. **Backend Environment Settings:** -### Backend + Create an `.env` file inside the `rag` folder with the following settings for Langfuse: + + ```env + SECRET_KEY=your_secret_key + PUBLIC_KEY=your_public_key + LANGFUSE_HOST=your_langfuse_host + ``` + +2. **Frontend Environment Settings:** + + Create an `.env` file inside the `frontend/raggi` folder with the following settings for the UI: + + ```env + API=http://ip-address-of-api:port + ``` + + +## Contributing + +Contributions are welcome! Please open an issue or submit a pull request to contribute to the project. + +## License + +This project is licensed under the MIT License. + +## Contact -- [ ] Add a digest worker for emebding documents -- [ ] Extend user permissions -- [ ] Add new documents to db -- [ ] Add meta data to a document +For any questions or inquiries, please contact.