Skip to content

Commit a465f4e

Browse files
authored
Merge pull request #19 from albegosu/fix/playground-progress-and-docs
fix: restore playground progress on reload and correct docs
2 parents a631fc2 + 400dcc3 commit a465f4e

57 files changed

Lines changed: 11861 additions & 344 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.docker

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
# =============================================================================
55

66
# -----------------------------------------------------------------------------
7-
# PostgreSQL (pkm-postgres container)
7+
# PostgreSQL (rag-postgres container)
88
# -----------------------------------------------------------------------------
9-
POSTGRES_USER=pkm
10-
POSTGRES_PASSWORD=pkm_password
11-
POSTGRES_DB=pkm_rag
9+
POSTGRES_USER=rag
10+
POSTGRES_PASSWORD=rag_password
11+
POSTGRES_DB=rag_db
1212
POSTGRES_PORT=5432
1313

1414
# -----------------------------------------------------------------------------

.github/CI-CD.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## GitHub Actions Workflows
44

5-
Complete CI/CD pipeline for PKM RAG project.
5+
Complete CI/CD pipeline for the From Zero RAG project.
66

77
## Workflow Overview
88

@@ -163,7 +163,7 @@ npm run test:cov
163163
```bash
164164
# Test build locally
165165
cd rag-api
166-
docker build -t pkm-backend:test .
166+
docker build -t rag-backend:test .
167167
```
168168

169169
### Secrets not working

.github/dependabot.yml

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
1+
# Dependabot version updates: disabled via `ignore` on each entry (remove those blocks to re-enable).
12
version: 2
23
updates:
3-
# Backend dependencies
4+
# Monorepo workspace dependencies (pnpm)
5+
- package-ecosystem: npm
6+
directory: /
7+
schedule:
8+
interval: weekly
9+
day: monday
10+
open-pull-requests-limit: 10
11+
reviewers:
12+
- albegosu
13+
labels:
14+
- dependencies
15+
- monorepo
16+
commit-message:
17+
prefix: 'chore(deps)'
18+
include: scope
19+
ignore:
20+
- dependency-name: '*'
21+
22+
# Backend-only updates (explicit)
423
- package-ecosystem: npm
524
directory: /rag-api
625
schedule:
@@ -15,8 +34,10 @@ updates:
1534
commit-message:
1635
prefix: 'chore(deps)'
1736
include: scope
37+
ignore:
38+
- dependency-name: '*'
1839

19-
# Frontend dependencies
40+
# Frontend-only updates (explicit)
2041
- package-ecosystem: npm
2142
directory: /rag-ui
2243
schedule:
@@ -31,6 +52,44 @@ updates:
3152
commit-message:
3253
prefix: 'chore(deps)'
3354
include: scope
55+
ignore:
56+
- dependency-name: '*'
57+
58+
# Learning packages (explicit)
59+
- package-ecosystem: npm
60+
directory: /packages/rag-learning
61+
schedule:
62+
interval: weekly
63+
day: monday
64+
open-pull-requests-limit: 10
65+
reviewers:
66+
- albegosu
67+
labels:
68+
- dependencies
69+
- learning
70+
commit-message:
71+
prefix: 'chore(deps)'
72+
include: scope
73+
ignore:
74+
- dependency-name: '*'
75+
76+
- package-ecosystem: npm
77+
directory: /packages/rag-playground
78+
schedule:
79+
interval: weekly
80+
day: monday
81+
open-pull-requests-limit: 10
82+
reviewers:
83+
- albegosu
84+
labels:
85+
- dependencies
86+
- learning
87+
- frontend
88+
commit-message:
89+
prefix: 'chore(deps)'
90+
include: scope
91+
ignore:
92+
- dependency-name: '*'
3493

3594
# Docker images
3695
- package-ecosystem: docker
@@ -44,3 +103,5 @@ updates:
44103
labels:
45104
- dependencies
46105
- docker
106+
ignore:
107+
- dependency-name: '*'

.github/workflows/ci.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
outputs:
1313
backend: ${{ steps.changes.outputs.backend }}
1414
frontend: ${{ steps.changes.outputs.frontend }}
15+
learning: ${{ steps.changes.outputs.learning }}
1516
steps:
1617
- uses: actions/checkout@v4
1718
- uses: dorny/paths-filter@v2
@@ -20,9 +21,19 @@ jobs:
2021
filters: |
2122
backend:
2223
- 'rag-api/**'
24+
- 'pnpm-lock.yaml'
25+
- 'pnpm-workspace.yaml'
2326
- '.github/workflows/**'
2427
frontend:
2528
- 'rag-ui/**'
29+
- 'pnpm-lock.yaml'
30+
- 'pnpm-workspace.yaml'
31+
- '.github/workflows/**'
32+
learning:
33+
- 'packages/rag-learning/**'
34+
- 'packages/rag-playground/**'
35+
- 'pnpm-lock.yaml'
36+
- 'pnpm-workspace.yaml'
2637
- '.github/workflows/**'
2738
2839
backend:
@@ -35,13 +46,19 @@ jobs:
3546
if: ${{ needs.changes.outputs.frontend == 'true' }}
3647
uses: ./.github/workflows/test-frontend.yml
3748

49+
learning:
50+
needs: changes
51+
if: ${{ needs.changes.outputs.learning == 'true' }}
52+
uses: ./.github/workflows/test-learning.yml
53+
54+
# Security scan job kept but skipped; set `if` to always() && (...) and uncomment triggers in security.yml to re-enable.
3855
security:
39-
needs: [backend, frontend]
40-
if: always() && (needs.backend.result != 'skipped' || needs.frontend.result != 'skipped')
56+
needs: [backend, frontend, learning]
57+
if: false
4158
uses: ./.github/workflows/security.yml
4259

4360
docker:
44-
needs: [backend, frontend]
61+
needs: [backend, frontend, learning]
4562
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
4663
uses: ./.github/workflows/docker-build.yml
4764
secrets: inherit

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
with:
6262
payload: |
6363
{
64-
"text": "🚀 PKM RAG deployed to ${{ github.event.inputs.environment || 'production' }}: ${{ job.status }}"
64+
"text": "🚀 From Zero RAG deployed to ${{ github.event.inputs.environment || 'production' }}: ${{ job.status }}"
6565
}
6666
env:
6767
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

.github/workflows/security.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1+
# Security scan: automatic runs disabled. Re-enable by uncommenting `push`, `pull_request`, and `schedule`
2+
# under `on`, and set the `security` job in ci.yml to `if: always() && (...)`.
13
name: Security Scan
24

35
on:
4-
push:
5-
branches: [main, develop]
6-
pull_request:
7-
branches: [main, develop]
8-
schedule:
9-
- cron: '0 6 * * 1' # Weekly on Monday
6+
workflow_dispatch:
7+
workflow_call:
8+
# push:
9+
# branches: [main, develop]
10+
# pull_request:
11+
# branches: [main, develop]
12+
# schedule:
13+
# - cron: '0 6 * * 1' # Weekly on Monday
1014

1115
jobs:
1216
security:
@@ -56,12 +60,12 @@ jobs:
5660
# Docker image scan
5761
- name: Build backend image
5862
working-directory: ./rag-api
59-
run: docker build -t pkm-backend:test .
63+
run: docker build -t rag-backend:test .
6064

6165
- name: Scan backend image
6266
uses: aquasecurity/trivy-action@master
6367
with:
64-
image-ref: pkm-backend:test
68+
image-ref: rag-backend:test
6569
format: 'sarif'
6670
output: 'trivy-results.sarif'
6771

.github/workflows/test-backend.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,19 @@ jobs:
3737
- name: Checkout code
3838
uses: actions/checkout@v4
3939

40+
- name: Setup pnpm
41+
uses: pnpm/action-setup@v4
42+
with:
43+
version: 10
44+
4045
- name: Setup Node.js
4146
uses: actions/setup-node@v4
4247
with:
4348
node-version: '20'
44-
cache: 'npm'
45-
cache-dependency-path: './rag-api/package-lock.json'
49+
cache: 'pnpm'
4650

4751
- name: Install dependencies
48-
run: npm ci
52+
run: pnpm install --frozen-lockfile
4953

5054
- name: Generate Prisma client
5155
run: npx prisma generate
@@ -56,13 +60,13 @@ jobs:
5660
run: npx prisma migrate deploy
5761

5862
- name: Run linter
59-
run: npm run lint
63+
run: pnpm --filter rag-api lint
6064

6165
- name: Run tests
6266
env:
6367
DATABASE_URL: postgresql://test:test@localhost:5432/test
6468
OLLAMA_URL: http://localhost:11434
65-
run: npm run test -- --coverage
69+
run: pnpm --filter rag-api exec jest --coverage --passWithNoTests
6670

6771
- name: Upload coverage
6872
uses: codecov/codecov-action@v3

.github/workflows/test-frontend.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,25 @@ jobs:
2222
- name: Checkout code
2323
uses: actions/checkout@v4
2424

25+
- name: Setup pnpm
26+
uses: pnpm/action-setup@v4
27+
with:
28+
version: 10
29+
2530
- name: Setup Node.js
2631
uses: actions/setup-node@v4
2732
with:
2833
node-version: '20'
29-
cache: 'npm'
30-
cache-dependency-path: './rag-ui/package-lock.json'
34+
cache: 'pnpm'
3135

3236
- name: Install dependencies
33-
run: npm ci
34-
35-
- name: Run linter
36-
run: npm run lint
37+
run: pnpm install --frozen-lockfile
3738

3839
- name: Type check
39-
run: npx nuxt typecheck
40+
run: pnpm --filter rag-ui exec nuxt typecheck
4041

4142
- name: Build
42-
run: npm run build
43-
44-
- name: Run tests
45-
run: npm run test
43+
run: pnpm --filter rag-ui build
4644

4745
- name: Upload coverage
4846
uses: codecov/codecov-action@v3
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CI - Test Learning
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
paths:
7+
- 'packages/rag-learning/**'
8+
- 'packages/rag-playground/**'
9+
- 'pnpm-lock.yaml'
10+
- 'pnpm-workspace.yaml'
11+
- '.github/workflows/test-learning.yml'
12+
pull_request:
13+
branches: [main, develop]
14+
paths:
15+
- 'packages/rag-learning/**'
16+
- 'packages/rag-playground/**'
17+
- 'pnpm-lock.yaml'
18+
- 'pnpm-workspace.yaml'
19+
20+
jobs:
21+
test:
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@v4
27+
28+
- name: Setup pnpm
29+
uses: pnpm/action-setup@v4
30+
with:
31+
version: 10
32+
33+
- name: Setup Node.js
34+
uses: actions/setup-node@v4
35+
with:
36+
node-version: '20'
37+
cache: 'pnpm'
38+
39+
- name: Install dependencies
40+
run: pnpm install --frozen-lockfile
41+
42+
- name: Build learning package
43+
run: pnpm --filter @rag/learning build
44+
45+
- name: Build playground
46+
run: pnpm --filter @rag/playground build

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ Thumbs.db
2424
.idea/
2525
.vscode/*
2626
!.vscode/extensions.json
27+
.claude/settings.local.json
28+
.claude/scheduled_tasks.lock
2729

2830
# Test / coverage
2931
coverage/

0 commit comments

Comments
 (0)