Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
defbd5f
Initial plan
Copilot Mar 6, 2026
085be9f
Restructure frontend from Next.js to Vite React app
Copilot Mar 6, 2026
83aa5a0
Restructure: move frontend to app/ (Vite React), add Python backend t…
Copilot Mar 6, 2026
55d1a98
Add Dockerfile, Makefile, start.sh; update docs, config, and workflows
Copilot Mar 6, 2026
f9d258e
Fix Flask debug mode security alert in test file
Copilot Mar 6, 2026
ca5fdad
Merge staging into copilot/merge-code-graph-repositories
gkorland Mar 8, 2026
2e2c9ad
Fix Playwright CI for new Vite + Flask architecture
gkorland Mar 8, 2026
21fe0d7
Merge branch 'staging' into copilot/merge-code-graph-repositories
gkorland Mar 8, 2026
5ef5754
Fix bugs and issues from PR review comments
gkorland Mar 8, 2026
a45ac22
Fix Playwright tests: parse FALKORDB_URL and wait for Flask
gkorland Mar 8, 2026
eee3686
Fix workflow: handle FALKORDB_URL parsing in script instead of if con…
gkorland Mar 8, 2026
908683d
Add /api prefix to Flask routes for dev/prod consistency
gkorland Mar 8, 2026
fa46838
Set VITE_SECRET_TOKEN during frontend build for auth in CI
gkorland Mar 8, 2026
f88c3f0
Remove FALKORDB_URL parsing, use local FalkorDB service
gkorland Mar 8, 2026
cff30c1
Add data seeding step to Playwright CI workflow
gkorland Mar 8, 2026
940cb5e
Fix AttributeError in Python analyzer for non-poetry pyproject.toml
gkorland Mar 8, 2026
d236d92
Fix tree-sitter 0.25.x API: use QueryCursor instead of Query.captures
gkorland Mar 8, 2026
c19ff5b
Trigger CI re-run
gkorland Mar 8, 2026
62fcc5f
Merge staging: resolve conflicts, bump @falkordb/canvas to 0.0.44
Copilot Mar 8, 2026
af27c7b
Merge staging: resolve conflicts, incorporate e2e waitForCanvasAnimat…
Copilot Mar 8, 2026
9609d7e
fix: update Makefile to use uv instead of bare pip/python
gkorland Mar 8, 2026
ac6cd7a
chore: add uv.lock and update package-lock.json
gkorland Mar 8, 2026
1ec9b80
chore: add ruff linting, e2e target, and improve Makefile
gkorland Mar 8, 2026
a5737f0
merge: resolve conflicts with staging
gkorland Mar 8, 2026
671cfa1
fix: bypass token auth when CODE_GRAPH_PUBLIC=1
gkorland Mar 8, 2026
d5e1be2
fix: scope public_access to safe routes, protect analyze_folder
gkorland Mar 8, 2026
c7e6cee
fix: replace toml library with stdlib tomllib to fix Flask pyproject.…
gkorland Mar 9, 2026
81cbff7
fix: align E2E test response types with Flask API format
gkorland Mar 9, 2026
d7421ed
fix: enable public access for CI E2E tests and update test data
gkorland Mar 9, 2026
a909532
fix: resolve remaining Playwright CI failures
gkorland Mar 9, 2026
9387bb5
fix(e2e): ensure CALLS edges exist for path tests
gkorland Mar 9, 2026
66263c1
fix(e2e): resolve path test timing and autocomplete ambiguity
gkorland Mar 9, 2026
8cc0357
Fix find_paths API call sending string IDs instead of integers
gkorland Mar 9, 2026
ae44c91
Fix clear graph test assertion and relax chat LLM comparison
gkorland Mar 10, 2026
9e9d770
Merge branch 'staging' into copilot/merge-code-graph-repositories
gkorland Mar 10, 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
17 changes: 15 additions & 2 deletions .env.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
PORT=<PORT>
HOST=<HOST>
# FalkorDB connection
FALKORDB_HOST=localhost
FALKORDB_PORT=6379

# OpenAI API key for LLM features
OPENAI_API_KEY=<YOUR_OPENAI_API_KEY>

# Secret token for API authentication
SECRET_TOKEN=<YOUR_SECRET_TOKEN>

# Flask server settings
FLASK_RUN_HOST=0.0.0.0
FLASK_RUN_PORT=5000

# Set to 1 to enable public access for analyze_repo/switch_commit endpoints
CODE_GRAPH_PUBLIC=0
3 changes: 0 additions & 3 deletions .eslintrc.json

This file was deleted.

76 changes: 21 additions & 55 deletions .github/workflows/nextjs.yml
Original file line number Diff line number Diff line change
@@ -1,73 +1,39 @@
# Sample workflow for building and deploying a Next.js site to GitHub Pages
#
# To get started with Next.js see: https://nextjs.org/docs/getting-started
#
name: Build Next.js site
name: Build

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

pull_request:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Detect package manager
id: detect-package-manager
run: |
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
echo "manager=yarn" >> $GITHUB_OUTPUT
echo "command=install" >> $GITHUB_OUTPUT
echo "runner=yarn" >> $GITHUB_OUTPUT
exit 0
elif [ -f "${{ github.workspace }}/package.json" ]; then
echo "manager=npm" >> $GITHUB_OUTPUT
echo "command=ci" >> $GITHUB_OUTPUT
echo "runner=npx --no-install" >> $GITHUB_OUTPUT
exit 0
else
echo "Unable to determine package manager"
exit 1
fi

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "24"
cache: ${{ steps.detect-package-manager.outputs.manager }}
- name: Restore cache
uses: actions/cache@v3
with:
path: |
.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
- name: Install dependencies
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
- name: Build with Next.js
run: ${{ steps.detect-package-manager.outputs.runner }} next build
node-version: "20"

- name: Install frontend dependencies
working-directory: ./app
run: npm ci

- name: Build frontend
working-directory: ./app
run: npm run build

- name: Lint frontend
working-directory: ./app
run: npm run lint

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install backend dependencies
run: pip install -e ".[test]"
45 changes: 36 additions & 9 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,61 @@ jobs:
- 6379:6379
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 24
- name: Install dependencies

- uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install backend dependencies
run: pip install -e .

- name: Install frontend dependencies
working-directory: ./app
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Set up environment variables and run tests

- name: Build frontend
working-directory: ./app
env:
VITE_SECRET_TOKEN: ${{ secrets.SECRET_TOKEN }}
run: npm run build

- name: Seed test data into FalkorDB
run: python e2e/seed_test_data.py

- name: Install Playwright
run: |
npm ci
npx playwright install --with-deps

- name: Run Playwright tests
env:
FALKORDB_URL: ${{ secrets.FALKORDB_URL }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
SECRET_TOKEN: ${{ secrets.SECRET_TOKEN }}
NEXT_PUBLIC_MODE: UNLIMITED
BACKEND_URL: ${{ secrets.BACKEND_URL }}
CODE_GRAPH_PUBLIC: "1"
MODEL_NAME: "openai/gpt-4.1-mini"
run: |
npm run build
NEXTAUTH_SECRET=SECRET npm start & npx playwright test --shard=${{ matrix.shard }}/2 --reporter=dot,list
flask --app api/index.py run --host 0.0.0.0 --port 5000 &
# Wait for Flask to be ready
timeout 30 bash -c 'until curl -s http://localhost:5000/ > /dev/null 2>&1; do sleep 0.5; done'
npx playwright test --shard=${{ matrix.shard }}/2 --reporter=dot,list

- name: Ensure required directories exist
if: always()
run: |
mkdir -p playwright-report
mkdir -p playwright-report/artifacts

- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report-shard-${{ matrix.shard }}
path: playwright-report/
retention-days: 30

- name: Upload failed test screenshots
if: always()
uses: actions/upload-artifact@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
- name: Set tags
run: |
if ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }}; then
echo "TAGS=falkordb/code-graph-frontend:latest,falkordb/code-graph-frontend:${{ github.ref_name }}" >> $GITHUB_ENV
echo "TAGS=falkordb/code-graph:latest,falkordb/code-graph:${{ github.ref_name }}" >> $GITHUB_ENV
else
echo "TAGS=falkordb/code-graph-frontend:edge" >> $GITHUB_ENV
echo "TAGS=falkordb/code-graph:edge" >> $GITHUB_ENV
fi

- name: Login to DockerHub
Expand Down
37 changes: 26 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz
node_modules/

# frontend build output
app/dist/

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

Expand All @@ -26,20 +22,39 @@ yarn-debug.log*
yarn-error.log*

# local env files
.env
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts


# vscode
/.vscode/
node_modules/

# test results
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/

# Python
__pycache__/
*.pyc
*.pyo
*.pyd
*.egg-info/
.eggs/
dist/
venv/
env/
.virtualenv/
htmlcov/
*.cover
.coverage
.cache/
pytest_cache/
*.log
repositories/
70 changes: 56 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,64 @@
# Use a Node.js base image
FROM node:24
# Multi-stage build: Start with Python 3.12 base
FROM python:3.12-bookworm AS python-base

# Main stage: Use FalkorDB base and copy Python 3.12
FROM falkordb/falkordb:latest

ENV PYTHONUNBUFFERED=1 \
FALKORDB_HOST=localhost \
FALKORDB_PORT=6379

USER root

# Copy Python 3.12 from the python base image
COPY --from=python-base /usr/local /usr/local

# Install netcat for wait loop in start.sh and system build tools
RUN apt-get update && apt-get install -y --no-install-recommends \
netcat-openbsd \
git \
build-essential \
curl \
ca-certificates \
gnupg \
&& rm -rf /var/lib/apt/lists/* \
&& ln -sf /usr/local/bin/python3.12 /usr/bin/python3 \
&& ln -sf /usr/local/bin/python3.12 /usr/bin/python

# Set working directory
WORKDIR /app

# Copy package.json and install dependencies
COPY package*.json ./
RUN npm ci
# Install Python dependencies
COPY pyproject.toml ./
RUN pip install --no-cache-dir --break-system-packages .

# Install Node.js for building the frontend
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
&& apt-get update \
&& apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/* \
&& node --version && npm --version

# Copy frontend package files and install dependencies
COPY app/package*.json ./app/
RUN if [ -f ./app/package-lock.json ]; then \
npm --prefix ./app ci --no-audit --no-fund; \
elif [ -f ./app/package.json ]; then \
npm --prefix ./app install --no-audit --no-fund; \
fi

# Copy frontend source and build
COPY ./app ./app
RUN npm --prefix ./app run build

# Copy the rest of the application code
COPY . .
# Copy backend code
COPY ./api ./api

# Expose the port the frontend runs on
EXPOSE 3000
# Copy and make start.sh executable
COPY start.sh /start.sh
RUN chmod +x /start.sh

# Build nextJS
RUN npm run build
EXPOSE 5000 6379

# Start the frontend
CMD ["npm", "start"]
# Use start.sh as entrypoint
ENTRYPOINT ["/start.sh"]

53 changes: 53 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
.PHONY: help install test e2e lint lint-py lint-fe clean build-dev build-prod run-dev run-prod docker-falkordb docker-stop

help: ## Show this help message
@echo 'Usage: make [target]'
@echo ''
@echo 'Targets:'
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " %-15s %s\n", $$1, $$2}' $(MAKEFILE_LIST)

install: ## Install all dependencies (backend + frontend)
uv sync --all-extras
npm install --prefix ./app

build-dev: ## Build frontend for development
npm --prefix ./app run build:dev

build-prod: ## Build frontend for production
npm --prefix ./app run build

test: ## Run backend tests
uv run python -m pytest tests/ --verbose

e2e: ## Run end-to-end Playwright tests
npx playwright test

lint: lint-py lint-fe ## Run all linters

lint-py: ## Run Python linting (ruff)
uv run ruff check .

lint-fe: ## Run frontend linting (TypeScript)
npm --prefix ./app run lint

clean: ## Clean up build and test artifacts
rm -rf app/dist/
rm -rf test-results/
rm -rf playwright-report/
rm -rf .pytest_cache/
rm -rf __pycache__/
find . -name "*.pyc" -delete
find . -name "*.pyo" -delete

run-dev: build-dev ## Run development server (Python backend serving built frontend)
uv run flask --app api/index.py run --host $${HOST:-127.0.0.1} --port $${PORT:-5000} --debug

run-prod: build-prod ## Run production server
uv run flask --app api/index.py run --host $${HOST:-0.0.0.0} --port $${PORT:-5000}

docker-falkordb: ## Start FalkorDB in Docker for testing
docker run -d --name falkordb-test -p 6379:6379 falkordb/falkordb:latest

docker-stop: ## Stop test containers
docker stop falkordb-test || true
docker rm falkordb-test || true
Loading
Loading