Skip to content
Merged
Show file tree
Hide file tree
Changes from 72 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
35af2d7
feat(rewrite): add Rewrite tab with document editor and AI assistant
rafchen Feb 18, 2026
5ddabd3
Merge main into feature/rewrite_engine
rafchen Feb 18, 2026
4448c3c
chore: add .kiro to .gitignore and create ai-trend-search-engine branch
kien-ship-it Feb 18, 2026
2c996d0
updated upload process
Deodat-Lawson Feb 18, 2026
238e730
Merge pull request #197 from Deodat-Lawson/timothy/feature/upload-pag…
Deodat-Lawson Feb 18, 2026
16b4392
test(trend-search): add property-based tests for type validation
kien-ship-it Feb 19, 2026
5e6cd1c
feat(study-agent): add list and get actions to note-taking tool
suncatchin Feb 19, 2026
7c3c762
feat(constants): add BATCH_UPLOAD_CONFIG for multi-file upload limits
suncatchin Feb 19, 2026
74460bc
fix(documentQ&A): filter recommendedPages to only AI-cited pages
suncatchin Feb 19, 2026
8e1177f
Enhancing rewrite engine with double pass logic
baekbyte Feb 19, 2026
c5473d9
added query planner with LLM-backed sub-query generation
t1ffnyw Feb 21, 2026
b90158e
Merge main into feature/rewrite_engine
rafchen Feb 21, 2026
3058560
added UI for model selector in chatpanel & querypanel
ezhu15 Feb 21, 2026
446f3a1
added before & after rewrites + validation tests
rafchen Feb 21, 2026
12e6a08
feat(rewrite): store documents in Rewrite tab instead of Document Gen…
rafchen Feb 21, 2026
061de2c
kien
kien-ship-it Feb 21, 2026
fbd163f
Merge pull request #203 from Deodat-Lawson/kien
kien-ship-it Feb 21, 2026
f0030f8
feat: add batch upload backend support
EricLiu2795 Feb 22, 2026
fb98343
add property tests 3-5 for query planner
t1ffnyw Feb 22, 2026
ccd06f5
add web search and property test 6
t1ffnyw Feb 22, 2026
a36d5aa
fixed trigger.dev error, fixed upload azure dependency error
Deodat-Lawson Feb 22, 2026
0617456
Merge pull request #205 from Deodat-Lawson/bugfix/ocr-azure-dependency
Deodat-Lawson Feb 22, 2026
71ff588
merged from main
Deodat-Lawson Feb 22, 2026
e2eebf4
chore: add .kiro to .gitignore and create ai-trend-search-engine branch
kien-ship-it Feb 18, 2026
af3c150
test(trend-search): add property-based tests for type validation
kien-ship-it Feb 19, 2026
fff5b82
added query planner with LLM-backed sub-query generation
t1ffnyw Feb 21, 2026
ce593cd
Create Drizzle schema for trend_search_jobs table
kaan7305 Feb 22, 2026
219453c
fixed trigger.dev error, fixed upload azure dependency error
Deodat-Lawson Feb 22, 2026
ab8b2c7
disabled unavailable models from dropdown bar
ezhu15 Feb 22, 2026
03cd92e
test cases
kaan7305 Feb 22, 2026
f6a75eb
trend-search tested
kaan7305 Feb 22, 2026
64dfa2f
tasks 2.1–2.5 work completed with test cases Create Inngest function …
kaan7305 Feb 22, 2026
ebe5763
verce; problem has beend solved
kaan7305 Feb 22, 2026
1546206
fixed backend lint error and auto zip extract
Deodat-Lawson Feb 22, 2026
5abd2db
changes to web-search
t1ffnyw Feb 22, 2026
43f56ce
add content synthesizer and property tests 7-8
t1ffnyw Feb 22, 2026
3124c7f
add editor to document generator
rafchen Feb 23, 2026
466b7db
fix: resolve ESLint and type errors for prod
rafchen Feb 23, 2026
6ff7315
Merge branch 'main' of https://github.com/Deodat-Lawson/PDR_AI_v2 int…
Feb 23, 2026
1996f53
merging kaan and tiffany, start working on track c
kien-ship-it Feb 23, 2026
1834c0e
added OpenAI extra models 5.2 nano and 5.2 mini
Feb 23, 2026
b14b246
completed wiring (testing by test-trend-search script)
kien-ship-it Feb 23, 2026
a80503c
Merge pull request #208 from Deodat-Lawson/feature/ai-chat-model-sele…
Deodat-Lawson Feb 23, 2026
8c19719
Merge pull request #204 from Deodat-Lawson/feat/batch-upload-backend
Deodat-Lawson Feb 23, 2026
ed8c763
Merge pull request #201 from suncatchin/fix/filter-recommended-pages-…
Deodat-Lawson Feb 23, 2026
c1d0b40
Merge pull request #200 from suncatchin/feat/batch-upload-constants
Deodat-Lawson Feb 23, 2026
c7b8f69
Added badge to indicate which responses were generated with which mod…
Feb 23, 2026
9403d6e
Merge branch 'main' of https://github.com/Deodat-Lawson/PDR_AI_v2 int…
Feb 23, 2026
8edfd26
Merge pull request #211 from Deodat-Lawson/feature/ai-chat-model-sele…
Deodat-Lawson Feb 24, 2026
db0379d
Merge pull request #199 from suncatchin/feat/note-taking-list-get-act…
Deodat-Lawson Feb 24, 2026
4283bb6
Complete the demo of import file and stepping workflow
JunzheShi0702 Feb 24, 2026
a57a236
Emojis Removed
kaan7305 Feb 24, 2026
b2543b3
fix preview whene importing txt file
rafchen Feb 24, 2026
8eb4dd4
gave proper typed parameters and null safe handling
rafchen Feb 24, 2026
9ac454d
Cascade snapshot 2026-02-24T16:16:30.08266Z
kien-ship-it Feb 24, 2026
7be145f
Update import path for runTrendSearch to reflect new location in lib/…
kien-ship-it Feb 24, 2026
2b0006b
refactor: move trend-search to src/lib/tools
kien-ship-it Feb 24, 2026
3ed2d44
Merge branch 'cascade/move-trend-search-folder-to-the-folder-946f0b' …
kien-ship-it Feb 24, 2026
becb467
Merge pull request #214 from Deodat-Lawson/kaan7305-emoji-removed
kaan7305 Feb 25, 2026
1de4be4
Merge pull request #213 from Deodat-Lawson/feature/ai-trend-search-en…
Deodat-Lawson Feb 25, 2026
ff4c500
Merge pull request #215 from Deodat-Lawson/feature/rewrite_engine
Deodat-Lawson Feb 25, 2026
ddf4763
delete document + inngest fix. No longer need to run pnpm inngest
Deodat-Lawson Feb 28, 2026
059b979
Update README.md
Deodat-Lawson Feb 28, 2026
2313c45
Merge pull request #218 from Deodat-Lawson/timothy/bugfix/inngest-pip…
Deodat-Lawson Feb 28, 2026
284a614
Merge pull request #219 from Deodat-Lawson/Deodat-Lawson-patch-7
Deodat-Lawson Feb 28, 2026
4545e75
fixing docker deployment
Deodat-Lawson Feb 28, 2026
fdbef6f
docker fixed
Deodat-Lawson Mar 1, 2026
9f4cf78
Merge pull request #220 from Deodat-Lawson/feature/optimize-docker-de…
Deodat-Lawson Mar 1, 2026
bdb7911
improve vercel deployment guide
Deodat-Lawson Mar 1, 2026
ef7dc8e
Merge pull request #221 from Deodat-Lawson/feature/vercel-deployment
Deodat-Lawson Mar 1, 2026
354c60f
modified landing page
Deodat-Lawson Mar 1, 2026
aee9607
Merge pull request #224 from Deodat-Lawson/feature/rewrote-landing-page
Deodat-Lawson Mar 1, 2026
981798d
Merge branch 'stable' into main
Deodat-Lawson Mar 1, 2026
3df0f2d
fixed tests
Deodat-Lawson Mar 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 24 additions & 6 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Dependencies
# Dependencies (reinstalled inside container)
node_modules
.pnp
.pnp.js

# Build output
# Build output (rebuilt inside container)
.next
out
build
dist

# Generated assets (created by postinstall from node_modules)
public/vad
Expand All @@ -24,24 +25,41 @@ __tests__
*.spec.tsx
jest.config.js
jest.babel.config.cjs
playwright.config.*
playwright-report

# Env files
.env
.env*.local
.env.*

# IDE and misc
# IDE and editor
.DS_Store
.idea
.vscode
*.swp
*.swo

# Docs (not needed in image)
*.md
!README.md

# Vercel
.vercel

# Debug
# Debug logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# TypeScript
# TypeScript incremental
*.tsbuildinfo

# Sidecar (has its own build context)
sidecar

# Docker files (don't copy into context recursively)
docker-compose*.yml
Dockerfile
.dockerignore
start-database.sh
45 changes: 0 additions & 45 deletions .env.example

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,6 @@ yarn-error.log*
.idea
/.localFiles
.windsurf/rules/markdowncreation.md

# kiro
.kiro
47 changes: 23 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,56 +1,55 @@
# Installing dependencies
FROM node:20-alpine AS deps
RUN npm install -g pnpm@10.15.1
# syntax=docker/dockerfile:1

# ── Base: shared Alpine + corepack-managed pnpm ──────────────────────
FROM node:20-alpine AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable && corepack prepare pnpm@10.15.1 --activate
WORKDIR /app

# ── Dependencies ─────────────────────────────────────────────────────
FROM base AS deps
COPY package.json pnpm-lock.yaml ./
# scripts currently only include vad-web assets.
COPY scripts ./scripts
RUN pnpm install --frozen-lockfile

# Builder
FROM node:20-alpine AS builder
RUN npm install -g pnpm@10.15.1
WORKDIR /app
COPY scripts ./scripts
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
pnpm install --frozen-lockfile

# ── Builder ──────────────────────────────────────────────────────────
FROM base AS builder
COPY --from=deps /app/node_modules ./node_modules
COPY . .
# public/vad is excluded from context; copy from deps (created by postinstall)
COPY --from=deps /app/public/vad ./public/vad

# Build env validation runs at import time; skip during Docker build
ENV SKIP_ENV_VALIDATION=1
ENV NEXT_TELEMETRY_DISABLED=1

# Build args from docker-compose (passed via --env-file .env)
ARG NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY
ARG OPENAI_API_KEY
ENV NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=${NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY}
ENV OPENAI_API_KEY=${OPENAI_API_KEY}

RUN pnpm build

# Schema sync
FROM node:20-alpine AS migrate
RUN npm install -g pnpm@10.15.1
WORKDIR /app
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/pnpm-lock.yaml ./pnpm-lock.yaml
RUN pnpm install --frozen-lockfile --ignore-scripts
# ── Schema sync (migrate) ───────────────────────────────────────────
# Reuses node_modules from deps instead of running a second install
FROM base AS migrate
COPY --from=deps /app/node_modules ./node_modules
COPY --from=deps /app/package.json ./package.json
COPY --from=deps /app/pnpm-lock.yaml ./pnpm-lock.yaml
COPY --from=builder /app/drizzle.config.ts ./drizzle.config.ts
COPY --from=builder /app/src ./src
COPY --from=builder /app/scripts ./scripts

CMD ["sh", "-c", "node scripts/ensure-pgvector.mjs && pnpm db:push"]

# Runner
# ── Runner ───────────────────────────────────────────────────────────
FROM node:20-alpine AS runner
WORKDIR /app

ENV NEXT_TELEMETRY_DISABLED=1

RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
RUN addgroup --system --gid 1001 nodejs && \
adduser --system --uid 1001 nextjs

COPY --from=builder /app/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
Expand Down
27 changes: 13 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

PDR AI is a Next.js platform for role-based document management, AI-assisted Q&A, and predictive document analysis. It combines document upload, optional OCR, embeddings, and retrieval to help teams find gaps and act faster.

## Core Features
## Core Features

- Clerk-based Employer/Employee authentication with role-aware middleware.
- Document upload pipeline with optional OCR for scanned PDFs.
Expand All @@ -11,7 +11,7 @@ PDR AI is a Next.js platform for role-based document management, AI-assisted Q&A
- Optional web-enriched analysis with Tavily.
- Optional reliability/observability via Inngest and LangSmith.

## 🏗️ Architecture
## Architecture

PDR AI follows a three-layer modular architecture:

Expand Down Expand Up @@ -91,7 +91,7 @@ The platform is organized into:

All services operate within domain-partitioned boundaries enforced by Clerk RBAC. RAG queries are scoped by `domain + company_id` to ensure data isolation.

## 🛠 Tech Stack
## Tech Stack

- Next.js 15 + TypeScript
- PostgreSQL + Drizzle ORM + pgvector
Expand All @@ -100,14 +100,14 @@ All services operate within domain-partitioned boundaries enforced by Clerk RBAC
- UploadThing + optional OCR providers
- Tailwind CSS

## 📋 Prerequisites
## Prerequisites

- Node.js 18+
- pnpm
- Docker + Docker Compose (recommended for local DB/full stack)
- Git

## Quick Start
## Quick Start

### 1) Clone and install

Expand Down Expand Up @@ -146,13 +146,12 @@ pnpm db:push
### 4) Run app

```bash
pnpm inngest:dev
pnpm run dev
```

Open `http://localhost:3000`.

## 🐳 Docker Deployment Methods
## Docker Deployment Methods

### Method 1: Full stack (recommended)

Expand Down Expand Up @@ -191,34 +190,34 @@ pnpm dev

For host DB tools, use `localhost:5433`.

## 🧩 How Docker Supports Platform Features
## How Docker Supports Platform Features

- `app` service runs auth, upload, OCR integration, RAG chat, and predictive analysis.
- `db` service provides pgvector-backed storage/retrieval for embeddings.
- `migrate` service ensures schema readiness before app startup.
- Optional providers (Inngest, Tavily, OCR, LangSmith) are enabled by env vars in the same runtime.

## 📚 Documentation
## Documentation

- Deployment details (Docker, Vercel, VPS): [docs/deployment.md](docs/deployment.md)
- Feature workflows and architecture: [docs/feature-workflows.md](docs/feature-workflow.md)
- Usage and API examples: [docs/usage-examples.md](docs/usage-examples.md)
- Observability and metrics: [docs/observability.md](docs/observability.md)
- **Manual testing (dev, post-PR):** [docs/manual-testing-guide.md](docs/manual-testing-guide.md)

## 🔌 API Endpoints (high-level)
## API Endpoints (high-level)

- `POST /api/uploadDocument` - upload and process document (OCR optional)
- `POST /api/LangChain` - document-grounded Q&A
- `POST /api/agents/predictive-document-analysis` - detect gaps and recommendations
- `GET /api/metrics` - Prometheus metrics stream

## 🔐 User Roles
## User Roles

- **Employee**: view assigned documents, use AI chat/analysis.
- **Employer**: upload/manage documents, categories, and employee access.

## 🧪 Useful Scripts
## Useful Scripts

```bash
pnpm db:studio
Expand All @@ -230,14 +229,14 @@ pnpm build
pnpm start
```

## 🐛 Troubleshooting
## Troubleshooting

- Confirm Docker is running before DB startup.
- If build issues occur: remove `.next` and reinstall dependencies.
- If OCR UI is missing: verify OCR provider keys are configured.
- If Docker image pull/build is corrupted: remove image and rebuild with `--no-cache`.

## 🤝 Contributing
## Contributing

1. Create a feature branch.
2. Make changes and run `pnpm check`.
Expand Down
Loading
Loading