Skip to content

Latest commit

 

History

History
127 lines (97 loc) · 2.84 KB

File metadata and controls

127 lines (97 loc) · 2.84 KB

Project Setup Guide (Turborepo + Pnpm + Docker):

Project Folder Structure

├── apps/
│   ├── http-server/
│   ├── ws-server/
│   ├── genAI/     # FastAPI GenAI service (Python)
│   └── frontend/
│
├── packages/
│   └── db/   # Prisma + PostgreSQL setup
│
├── docker-compose.yml
├── turbo.json
├── pnpm-workspace.yaml
└── package.json

Prerequisites

Make sure you have the following installes:-

*Node.js (>= 20)
*pnpm (>= 9)
*Python (>= 3.11)   # for the genAI service
*Docker
*Docker Compose

(1) Now, fork & clone the repository

git clone https://github.com/TheCodeHeist-Coder/Qtrive.git
cd Qtrive

(2) Install pnpm globally if not installed

npm install -g pnpm

(3) Install dependencies

pnpm install

(4) Setup Environment Variables

*Create a .env in /packages/db and put this ennvironment variable

DATABASE_URL=postgresql://postgres:postgres@db:5432/mydb

*Create a .env file in /apps/http-server and put these variables

PORT=4000

JWT_SECRET=<yourJWTSecret>

DATABASE_URL=postgresql://postgres:postgres@db:5432/Qtrive

FRONTEND_URL=http://localhost:5173

*Create a .env file in /apps/genAI (copy from .env.example)

cp apps/genAI/.env.example apps/genAI/.env

Then fill in your keys:

GROQ_API_KEY=<yourGroqKey>
GOOGLE_API_KEY=<yourGoogleKey>
TAVILY_API_KEY=<yourTavilyKey>

(5) Start services with Docker

docker-compose up --build

*Build all services (http-server, ws-server, frontend, genAI) *Start PostgreSQL database *Start all containers

(6) Access the application

Frontend → http://localhost:5173
HTTP Server → http://localhost:4000
WebSocket Server → ws://localhost:8080
GenAI Service → http://localhost:8000  (docs at /docs)
PostgreSQL → localhost:5432

Running the GenAI service without Docker

The Python service is part of the Turborepo workspace, so pnpm dev at the repo root starts it alongside the JS apps — but it needs a virtualenv first:

cd apps/genAI
pnpm run setup      # creates .venv and installs requirements.txt

After that, from the repo root:

pnpm dev            # runs frontend, http-server, ws-server and genAI

Or run just the AI service:

pnpm --filter genai dev

Endpoints

Method Path Description
GET /health Health check (used by Docker)
POST /chat Chat agent, with web search when needed
POST /generate-questions Generate quiz questions from a PDF
POST /ask-pdf Ask a question about an uploaded PDF