diff --git a/CLEANUP-SAFETY-CHECK.md b/CLEANUP-SAFETY-CHECK.md deleted file mode 100644 index 3a7c0780..00000000 --- a/CLEANUP-SAFETY-CHECK.md +++ /dev/null @@ -1,76 +0,0 @@ -# Cleanup Safety Check - -## What MUST Stay in Root - -### ✅ Files that MUST remain in root: -- `Makefile` - Make commands expect it in root -- `package.json` - npm/node requirement -- `tsconfig.json` - TypeScript config -- `turbo.json` - Turbo monorepo config -- `.gitignore` - Git requirement -- `.env.example` - Convention for env templates -- `README.md` - GitHub/npm convention -- `LICENSE` - Legal/npm requirement -- `CLAUDE.md` - Project documentation -- `.eslintrc.js` - ESLint looks for it in root -- `.prettierrc` - Prettier config -- `.prettierignore` - Prettier ignore rules - -## What I Fixed After Moving - -### ✅ Fixed package.json scripts: -```json -// Before (broken): -"test:comprehensive": "node run-all-tests.js", -"test:https": "node ssl-certificate-analysis.js && node mobile-https-compatibility-test.js", - -// After (fixed): -"test:comprehensive": "node tests/run-all-tests.js", -"test:https": "node tests/ssl-certificate-analysis.js && node tests/mobile-https-compatibility-test.js", -``` - -### ✅ Restored Makefile to root: -- Initially moved to `scripts/` → broke `make` commands -- Moved back to root → now working - -## What's Safe to Move - -### ✅ Safely moved to organized directories: -- Test scripts (*.test.js, *-test.js) → `tests/` -- Test reports (*.md) → `test-results/reports/` -- Screenshots (*.png) → `artifacts/screenshots/` -- HTML reports → `test-results/` - -## Verification Commands - -Run these to verify nothing is broken: - -```bash -# Package.json scripts -npm run test:comprehensive # ✅ Works -npm run test:https # ✅ Works -npm run test:installation # ✅ Works - -# Make commands -make test-report # ✅ Works -make test-all # ✅ Works - -# Build commands -npm run build # Should work -npm run dev # Should work -``` - -## Potential Issues to Watch - -1. **Import paths in test files**: If any test files import each other, paths may need updating -2. **CI/CD pipelines**: GitHub Actions seem fine, but check other CI systems -3. **Docker**: Dockerfile COPY commands may need updates if they reference moved files -4. **Scripts**: Shell scripts that reference test files may need path updates - -## Summary - -✅ **No critical breakage** - All essential functionality preserved -✅ **Package.json updated** - Test commands now point to correct locations -✅ **Makefile restored** - Back in root where it belongs -✅ **Root is clean** - Only essential files remain -⚠️ **Monitor for issues** - Watch for any path-related errors in CI/CD or scripts \ No newline at end of file diff --git a/README.md b/README.md index 681f1fba..4aa0afc9 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ wget -qO- https://raw.githubusercontent.com/GraphDone/GraphDone-Core/main/public - Linux: Smart sudo authentication (works with curl/wget pipes), uses apt/dnf/yum + Docker Engine (15+ distributions supported) 4. **Code Setup** - Clones repository to `~/graphdone`, installs npm dependencies 5. **Security Config** - Generates self-signed TLS certificates for HTTPS -6. **Service Deployment** - Starts Neo4j, Redis, GraphQL API, React Web App +6. **Service Deployment** - Starts Neo4j, GraphQL API, React Web App 7. **Health Verification** - Waits for all services to be healthy (60s timeout) **Access URLs after installation:** diff --git a/VM_QUICKSTART.md b/VM_QUICKSTART.md deleted file mode 100644 index 83a970d7..00000000 --- a/VM_QUICKSTART.md +++ /dev/null @@ -1,193 +0,0 @@ -# GraphDone VM Quick Start - -Run GraphDone in an isolated Multipass VM with automatic setup. - -## Installation - -```bash -# macOS -brew install --cask multipass - -# Ubuntu -sudo snap install multipass - -# Windows -# Download from https://multipass.run -``` - -## Quick Start (30 seconds) - -```bash -# 1. Launch VM with auto-generated fun name -./start vm launch -# Example output: Generated random VM name: graphdone-vm-happy-turtle-1234 - -# 2. Wait for setup to complete (2-5 minutes) -# VM will auto-configure Ubuntu, Docker, Node.js, and GraphDone - -# 3. List your VMs to see the generated name -./start vm list - -# 4. Get VM IP address (use your generated VM name) -multipass info graphdone-vm-happy-turtle-1234 | grep IPv4 - -# 5. Access GraphDone -# http://:3127 - Web UI -# http://:4127 - GraphQL API -# http://:7474 - Neo4j Browser -``` - -## Common Commands - -```bash -# Launch VM with custom settings -./start vm launch --branch develop --cpus 8 --memory 16G - -# Connect to VM -./start vm shell - -# Stop VM -./start vm stop - -# Start VM -./start vm start - -# Delete VM -./start vm delete - -# List all VMs -./start vm list - -# Show VM info -./start vm info -``` - -## Inside the VM - -```bash -# Shortcuts available in VM shell -gd # Go to GraphDone directory -gd-start # Start GraphDone -gd-stop # Stop GraphDone -gd-status # Check status - -# Or use directly -cd ~/graphdone -./start dev -./start status -``` - -## Configuration - -Edit `vm.config.yml` to customize: - -```yaml -resources: - cpus: 4 # CPU cores - memory: 8G # RAM - disk: 30G # Disk space - -graphdone: - branch: main # Git branch to use - auto_setup: true - auto_seed: true - -tailscale: - enabled: false - auth_key: "" # Tailscale auth key -``` - -## Tailscale Integration - -1. Get auth key: https://login.tailscale.com/admin/settings/keys -2. Set in config or environment: - ```bash - export TAILSCALE_AUTH_KEY="tskey-auth-xxxxx" - ./start vm launch - ``` -3. VM joins your Tailscale network automatically - -## Multiple VMs - -Run different branches simultaneously: - -```bash -# Main branch -./start vm launch --name main-vm --branch main - -# Feature branch -./start vm launch --name feature-vm --branch feature/new-ui - -# Shell into each -./start vm shell --name main-vm -./start vm shell --name feature-vm -``` - -## Troubleshooting - -```bash -# VM not starting? -multipass list # Check status -./start vm delete # Delete and recreate -./start vm launch - -# Services not accessible? -./start vm shell # Connect to VM -cd ~/graphdone && ./start status # Check services -docker ps # Check containers - -# Cloud-init still running? -./start vm shell -cloud-init status # Check provisioning status -``` - -## Full Documentation - -See [docs/VM_SETUP.md](docs/VM_SETUP.md) for complete documentation including: -- Advanced configuration -- Network setup -- Port forwarding -- CI/CD integration -- Security best practices - -## Command Reference - -| Command | Description | -|---------|-------------| -| `./start vm launch` | Create and start new VM | -| `./start vm delete` | Delete VM and all data | -| `./start vm stop` | Stop running VM | -| `./start vm start` | Start stopped VM | -| `./start vm shell` | Open shell in VM | -| `./start vm info` | Show VM details | -| `./start vm list` | List all GraphDone VMs | - -## Options - -| Option | Description | Example | -|--------|-------------|---------| -| `--name` | VM name | `--name my-dev` | -| `--branch` | Git branch | `--branch develop` | -| `--cpus` | CPU cores | `--cpus 8` | -| `--memory` | RAM | `--memory 16G` | -| `--disk` | Disk size | `--disk 50G` | - -## Environment Variables - -Create `.env.vm` from `.env.vm.example`: - -```bash -cp .env.vm.example .env.vm -# Edit .env.vm with your settings -``` - -Key variables: -- `TAILSCALE_AUTH_KEY` - Tailscale authentication -- `VM_BRANCH` - Default Git branch -- `VM_CPUS` - Default CPU count -- `VM_MEMORY` - Default memory -- `VM_DISK` - Default disk size - ---- - -**Need help?** See [docs/VM_SETUP.md](docs/VM_SETUP.md) or run `./start vm --help` diff --git a/docs/README.md b/docs/README.md index ffe47edd..6cd2896d 100644 --- a/docs/README.md +++ b/docs/README.md @@ -25,6 +25,9 @@ Welcome to the GraphDone documentation! This directory contains comprehensive gu - [Testing Guide](../tests/README.md) - **E2E testing with robust authentication system** - [SQLite Deployment Modes](./guides/sqlite-deployment-modes.md) - Local dev vs Docker authentication storage - [User Flows](./guides/user-flows.md) - How teams actually use GraphDone +- [VM Setup (Multipass)](./guides/vm-setup.md) - Run GraphDone in a throwaway VM +- [Git Hooks](./guides/git-hooks.md) - Pre-commit / pre-push hooks +- More: [`docs/testing/`](./testing/) (test architecture, PR + OAuth testing) · [`docs/security/`](./security/) (TLS, OAuth) · [`docs/deployment/`](./deployment/) ### 🤖 AI Agents Documentation > **Start here**: [Simple AI Agent Reality Check](./simple-agent-reality.md) - **What we're actually building** diff --git a/docs/VM_SETUP.md b/docs/VM_SETUP.md deleted file mode 100644 index 491b3fca..00000000 --- a/docs/VM_SETUP.md +++ /dev/null @@ -1,372 +0,0 @@ -# GraphDone Multipass VM Setup - -This guide explains how to run GraphDone in a Multipass VM for isolated development and testing. - -## Prerequisites - -1. **Multipass** - Install from [multipass.run](https://multipass.run) - - macOS: `brew install --cask multipass` - - Ubuntu: `sudo snap install multipass` - - Windows: Download from website - -2. **yq** - YAML processor (automatically installed if missing) - - macOS: `brew install yq` - - Ubuntu: Auto-installed by the script - -## Quick Start - -```bash -# Launch a VM with auto-generated random name -./start vm launch -# Example: graphdone-vm-happy-turtle-1234 - -# List VMs to see your generated name -./start vm list - -# Connect to the VM (use your generated name) -./start vm shell --name graphdone-vm-happy-turtle-1234 - -# Or if you only have one VM -multipass shell - -# Inside the VM, GraphDone is automatically set up at ~/graphdone -cd ~/graphdone -./start status -``` - -### VM Names - -By default, VMs get fun random names like: -- `graphdone-vm-happy-turtle-1234` -- `graphdone-vm-cosmic-dragon-5678` -- `graphdone-vm-mighty-phoenix-9012` - -You can specify a custom name with `--name`: -```bash -./start vm launch --name my-dev-vm -``` - -## Configuration - -Edit `vm.config.yml` to customize your VM: - -### Basic Resources - -```yaml -resources: - cpus: 4 # Number of CPU cores - memory: 8G # RAM (4G, 8G, 16G, etc.) - disk: 30G # Disk size (20G, 50G, etc.) -``` - -### Git Configuration - -```yaml -graphdone: - repo_url: "https://github.com/GraphDone/GraphDone-Core.git" - branch: "main" # Change to develop, feature/xxx, etc. - clone_path: "/home/ubuntu/graphdone" - auto_setup: true # Run ./start setup automatically - auto_seed: true # Seed database with test data -``` - -### Tailscale Integration - -```yaml -tailscale: - enabled: true - auth_key: "tskey-auth-xxxxx" # Get from https://login.tailscale.com/admin/settings/keys - flags: "--advertise-tags=tag:dev" -``` - -To use Tailscale: -1. Go to https://login.tailscale.com/admin/settings/keys -2. Generate an **ephemeral** auth key -3. Set it in `vm.config.yml` or via environment variable: - ```bash - export TAILSCALE_AUTH_KEY="tskey-auth-xxxxx" - ./start vm launch - ``` - -### Node.js Version - -```yaml -nodejs: - version: "20" # 18, 20, or latest - use_nvm: true # Recommended for version management -``` - -### Startup Configuration - -```yaml -startup: - auto_start: false # Start VM on host boot - run_on_boot: true # Start GraphDone services on VM boot -``` - -## Usage - -### Launch a VM - -```bash -# Default configuration -./start vm launch - -# Custom branch -./start vm launch --branch develop - -# Custom resources -./start vm launch --cpus 8 --memory 16G --disk 50G - -# Custom name and branch -./start vm launch --name my-dev-vm --branch feature/new-ui -``` - -### Manage VMs - -```bash -# List all GraphDone VMs -./start vm list - -# Connect to VM shell -./start vm shell -./start vm shell --name my-vm - -# Show VM info -./start vm info - -# Stop VM -./start vm stop - -# Start a stopped VM -./start vm start - -# Delete VM -./start vm delete -``` - -### Access Services - -After launching a VM, services are available at: - -**Via VM IP:** -- Web UI: `http://:3127` -- GraphQL API: `http://:4127/graphql` -- Neo4j Browser: `http://:7474` - -Get the VM IP: -```bash -multipass info graphdone-dev | grep IPv4 -``` - -**Via localhost** (requires port forwarding): -- Web UI: `http://localhost:3127` -- GraphQL API: `http://localhost:4127/graphql` -- Neo4j Browser: `http://localhost:7474` - -## Command-Line Options - -All VM commands support these options: - -| Option | Description | Example | -|--------|-------------|---------| -| `--name NAME` | VM name | `--name my-dev` | -| `--branch BRANCH` | Git branch | `--branch develop` | -| `--cpus N` | Number of CPUs | `--cpus 8` | -| `--memory SIZE` | Memory size | `--memory 16G` | -| `--disk SIZE` | Disk size | `--disk 50G` | - -## Inside the VM - -When you shell into the VM, helpful aliases are available: - -```bash -# GraphDone shortcuts -gd # cd to GraphDone directory -gd-start # Start GraphDone -gd-stop # Stop GraphDone -gd-status # Check status - -# Or use directly -cd ~/graphdone -./start dev -./start status -./start test -``` - -## Advanced Configuration - -### Mount Host Directories - -```yaml -mounts: - enabled: true - paths: - - "~/graphdone-data:/home/ubuntu/data" - - "~/projects:/home/ubuntu/projects" -``` - -### Custom Development Tools - -```yaml -development: - dev_tools: - - git - - vim - - htop - - tmux - - jq -``` - -### Network Configuration - -```yaml -network: - bridged: true # Use bridged network (external IP) - bridge_interface: "eth0" # Bridge interface name -``` - -## Troubleshooting - -### VM fails to launch - -```bash -# Check Multipass status -multipass list - -# View VM logs -multipass exec graphdone-dev -- journalctl -xe - -# Delete and recreate -./start vm delete -./start vm launch -``` - -### Services not starting - -```bash -# Shell into VM -./start vm shell - -# Check GraphDone status -cd ~/graphdone -./start status - -# Check logs -docker logs graphdone-neo4j -journalctl -u graphdone -f -``` - -### Port forwarding not working - -On macOS/Windows, Multipass uses NAT. Access services via VM IP: - -```bash -# Get VM IP -multipass info graphdone-dev | grep IPv4 - -# Access directly -curl http://:3127 -``` - -Or set up SSH tunnel: - -```bash -# Forward port 3127 -multipass exec graphdone-dev -- sudo iptables -t nat -A PREROUTING -p tcp --dport 3127 -j REDIRECT --to-port 3127 -``` - -### Tailscale not connecting - -```bash -# Check Tailscale status in VM -./start vm shell -sudo tailscale status - -# Reconnect -sudo tailscale up --authkey= -``` - -## Performance Tips - -1. **Allocate enough resources**: Development needs at least 4 CPUs and 8GB RAM -2. **Use SSD**: Multipass performs better on SSDs -3. **Enable Docker caching**: Speeds up container operations -4. **Use bridged networking**: Better performance than NAT on Linux - -## Security Notes - -1. **Use ephemeral Tailscale keys**: They expire and are safer -2. **Don't commit auth keys**: Use environment variables -3. **Limit VM resources**: Prevent host resource exhaustion -4. **Regular updates**: Keep Multipass and Ubuntu updated - -## Integration with CI/CD - -Use VMs for consistent testing: - -```bash -# In CI pipeline -./start vm launch --name ci-test-$CI_BUILD_ID --branch $CI_BRANCH -./start vm shell --name ci-test-$CI_BUILD_ID -- "cd ~/graphdone && ./start test" -./start vm delete --name ci-test-$CI_BUILD_ID -``` - -## Examples - -### Development on different branches - -```bash -# Main branch VM -./start vm launch --name main-dev --branch main - -# Feature branch VM -./start vm launch --name feature-dev --branch feature/new-api - -# Work on both simultaneously -./start vm shell --name main-dev -./start vm shell --name feature-dev -``` - -### Testing with different resources - -```bash -# Minimum viable setup -./start vm launch --name min-test --cpus 2 --memory 4G - -# Production-like setup -./start vm launch --name prod-test --cpus 8 --memory 16G --disk 100G -``` - -### Tailscale mesh network - -```bash -# Launch VMs that can communicate via Tailscale -export TAILSCALE_AUTH_KEY="tskey-auth-xxxxx" - -./start vm launch --name dev1 --branch main -./start vm launch --name dev2 --branch develop - -# VMs can now reach each other via Tailscale IPs -``` - -## Cleanup - -```bash -# Delete a specific VM -./start vm delete --name my-vm - -# Delete all GraphDone VMs -multipass list | grep graphdone | awk '{print $1}' | xargs -I {} multipass delete {} -multipass purge - -# Clean up cloud-init artifacts -rm -f /tmp/graphdone-cloud-init.yml -``` - -## Additional Resources - -- [Multipass Documentation](https://multipass.run/docs) -- [Cloud-init Documentation](https://cloud-init.io/) -- [Tailscale Documentation](https://tailscale.com/kb/) -- [GraphDone Documentation](../README.md) diff --git a/DEVOPS_INTEGRATION.md b/docs/deployment/devops-integration.md similarity index 100% rename from DEVOPS_INTEGRATION.md rename to docs/deployment/devops-integration.md diff --git a/docs/detailed-overview.md b/docs/detailed-overview.md index 712d1b57..ade1c800 100644 --- a/docs/detailed-overview.md +++ b/docs/detailed-overview.md @@ -2,6 +2,15 @@ > This document contains the comprehensive technical documentation, architecture details, and implementation guides for GraphDone. +> ⚠️ **Accuracy note:** the actual stack is **React + Vite + Tailwind + D3** (web), +> **Node + Apollo + @neo4j/graphql** (server), **Neo4j** (graph) + **SQLite** (auth), +> and an **MCP** server; the hosted edition runs on **Cloudflare Workers + D1** (see +> the GraphDone-Cloud repo). Some sections below describe earlier or aspirational +> designs (e.g. PostgreSQL, Prisma, Redis, React Native) that are **not** the current +> implementation. For the concise current picture see +> [guides/architecture-overview.md](./guides/architecture-overview.md) and +> [guides/web-ui-architecture.md](./guides/web-ui-architecture.md). + ## How GraphDone Works: A Visual Deep Dive ### The Core Concept: Work as a Graph diff --git a/docs/guides/architecture-overview.md b/docs/guides/architecture-overview.md index 65e87687..54a0b945 100644 --- a/docs/guides/architecture-overview.md +++ b/docs/guides/architecture-overview.md @@ -18,8 +18,7 @@ GraphDone is architected around three core principles: ```mermaid graph TB subgraph "Client Applications" - WEB[Web Application
React + TypeScript + D3.js
Touch-optimized UI
Port 3127] - IOS[iPhone App
SwiftUI
Separate GraphDone-iOS repo] + WEB[Web Application
React + TypeScript + D3.js
Responsive desktop + mobile web
Port 3127] CLAUDE[Claude Code MCP
Natural language interface
Port 3128] end @@ -41,7 +40,6 @@ graph TB end WEB --> GQL - IOS --> GQL CLAUDE --> NEO4J GQL --> SQLITE GQL --> NEO4J diff --git a/docs/git-hooks.md b/docs/guides/git-hooks.md similarity index 100% rename from docs/git-hooks.md rename to docs/guides/git-hooks.md diff --git a/TAILSCALE_TROUBLESHOOTING.md b/docs/guides/tailscale-troubleshooting.md similarity index 100% rename from TAILSCALE_TROUBLESHOOTING.md rename to docs/guides/tailscale-troubleshooting.md diff --git a/SETUP_MULTIPASS.md b/docs/guides/vm-setup.md similarity index 100% rename from SETUP_MULTIPASS.md rename to docs/guides/vm-setup.md diff --git a/docs/oauth-implementation.md b/docs/security/oauth-implementation.md similarity index 100% rename from docs/oauth-implementation.md rename to docs/security/oauth-implementation.md diff --git a/docs/oauth-setup-guide.md b/docs/security/oauth-setup-guide.md similarity index 100% rename from docs/oauth-setup-guide.md rename to docs/security/oauth-setup-guide.md diff --git a/docs/oauth-testing-guide.md b/docs/security/oauth-testing-guide.md similarity index 97% rename from docs/oauth-testing-guide.md rename to docs/security/oauth-testing-guide.md index be8958af..dcee9f8a 100644 --- a/docs/oauth-testing-guide.md +++ b/docs/security/oauth-testing-guide.md @@ -27,7 +27,7 @@ npx playwright test tests/e2e/oauth-linkedin.spec.ts --ui ## What's Included -### 1. Official Documentation (`docs/oauth-implementation.md`) +### 1. Official Documentation (`docs/security/oauth-implementation.md`) **Comprehensive guide with:** - ✅ Official spec links for Google, GitHub, LinkedIn @@ -306,8 +306,8 @@ LINKEDIN_CALLBACK_URL=https://localhost:4128/auth/linkedin/callback ## Support **Documentation:** -- Implementation guide: `docs/oauth-implementation.md` -- This testing guide: `docs/oauth-testing-guide.md` +- Implementation guide: `docs/security/oauth-implementation.md` +- This testing guide: `docs/security/oauth-testing-guide.md` **Code:** - OAuth strategies: `packages/server/src/auth/oauth-strategies.ts` diff --git a/E2E_TEST_SUMMARY.md b/docs/testing/e2e-test-summary.md similarity index 98% rename from E2E_TEST_SUMMARY.md rename to docs/testing/e2e-test-summary.md index ddea0a80..df59b69c 100644 --- a/E2E_TEST_SUMMARY.md +++ b/docs/testing/e2e-test-summary.md @@ -198,4 +198,4 @@ The remaining work is to debug why the runcmd commands aren't executing as expec **For Support:** - Check `tools/multipass.sh --help` - Review logs in `test-reports/` -- Consult `SETUP_MULTIPASS.md` for detailed setup instructions +- Consult `docs/guides/vm-setup.md` for detailed setup instructions diff --git a/docs/pr-testing-guide.md b/docs/testing/pr-testing-guide.md similarity index 97% rename from docs/pr-testing-guide.md rename to docs/testing/pr-testing-guide.md index fd8d5290..adf8f194 100644 --- a/docs/pr-testing-guide.md +++ b/docs/testing/pr-testing-guide.md @@ -290,7 +290,7 @@ docker logs graphdone-neo4j ### OAuth Test Maintenance -See [docs/oauth-testing-guide.md](./oauth-testing-guide.md) for OAuth-specific maintenance: +See [docs/oauth-testing-guide.md](../security/oauth-testing-guide.md) for OAuth-specific maintenance: - Monthly spec review (every 12th) - Provider documentation updates - Token handling validation @@ -371,8 +371,8 @@ open test-results/reports/pr-report.html ## Support **Documentation**: -- [OAuth Testing Guide](./oauth-testing-guide.md) - OAuth-specific testing -- [OAuth Implementation Guide](./oauth-implementation.md) - OAuth compliance tracking +- [OAuth Testing Guide](../security/oauth-testing-guide.md) - OAuth-specific testing +- [OAuth Implementation Guide](../security/oauth-implementation.md) - OAuth compliance tracking - [TLS/SSL Setup](./tls-ssl-setup.md) - HTTPS configuration **Test Code**: diff --git a/docs/test-organization.md b/docs/testing/test-organization.md similarity index 100% rename from docs/test-organization.md rename to docs/testing/test-organization.md diff --git a/docs/testing-architecture.md b/docs/testing/testing-architecture.md similarity index 100% rename from docs/testing-architecture.md rename to docs/testing/testing-architecture.md diff --git a/packages/web/src/components/InteractiveGraphVisualization.tsx b/packages/web/src/components/InteractiveGraphVisualization.tsx index f812c828..0a8b899d 100644 --- a/packages/web/src/components/InteractiveGraphVisualization.tsx +++ b/packages/web/src/components/InteractiveGraphVisualization.tsx @@ -114,6 +114,16 @@ const legibilityTransform = (cy: number, basePx: number, k: number) => { return `translate(0,${cy}) scale(${s}) translate(0,${-cy})`; }; +// Hex color → normalized 0..1 RGB for SVG feColorMatrix glow filters. +const hexToRgb = (hex: string) => { + const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); + return result ? { + r: parseInt(result[1], 16) / 255, + g: parseInt(result[2], 16) / 255, + b: parseInt(result[3], 16) / 255 + } : { r: 0.06, g: 0.73, b: 0.51 }; // fallback green +}; + interface NodeMenuState { node: WorkItem | null; position: { x: number; y: number }; @@ -323,11 +333,10 @@ export function InteractiveGraphVisualization({ onResetLayout, onNodeSelected, i awaitRefetchQueries: true, // Wait for refetch to complete errorPolicy: 'all', onCompleted: (data) => { - console.log('[Graph Debug] Node update completed successfully', data); // Don't force reinitialization - let data updates flow through naturally }, onError: (error) => { - console.error('[Graph Debug] Node update failed:', error); + console.error('Node update failed:', error); } }); @@ -565,14 +574,6 @@ export function InteractiveGraphVisualization({ onResetLayout, onNodeSelected, i .attr('height', '300%'); // Convert hex to RGB values for feColorMatrix - const hexToRgb = (hex: string) => { - const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); - return result ? { - r: parseInt(result[1], 16) / 255, - g: parseInt(result[2], 16) / 255, - b: parseInt(result[3], 16) / 255 - } : { r: 0.06, g: 0.73, b: 0.51 }; // fallback green - }; const rgb = hexToRgb(nodeColor); nodeGlowFilter.append('feColorMatrix') @@ -630,14 +631,6 @@ export function InteractiveGraphVisualization({ onResetLayout, onNodeSelected, i .attr('height', '300%'); // Convert hex to RGB values for feColorMatrix - const hexToRgb = (hex: string) => { - const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); - return result ? { - r: parseInt(result[1], 16) / 255, - g: parseInt(result[2], 16) / 255, - b: parseInt(result[3], 16) / 255 - } : { r: 0.06, g: 0.73, b: 0.51 }; // fallback green - }; const rgb = hexToRgb(nodeColor); nodeGlowFilter.append('feColorMatrix') @@ -699,14 +692,6 @@ export function InteractiveGraphVisualization({ onResetLayout, onNodeSelected, i .attr('height', '300%'); // Convert hex to RGB values - const hexToRgb = (hex: string) => { - const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); - return result ? { - r: parseInt(result[1], 16) / 255, - g: parseInt(result[2], 16) / 255, - b: parseInt(result[3], 16) / 255 - } : { r: 0.06, g: 0.73, b: 0.51 }; // fallback green - }; const rgb = hexToRgb(nodeColor); nodeGlowFilter.append('feColorMatrix') @@ -752,14 +737,6 @@ export function InteractiveGraphVisualization({ onResetLayout, onNodeSelected, i .attr('width', '400%') .attr('height', '400%'); - const hexToRgb = (hex: string) => { - const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); - return result ? { - r: parseInt(result[1], 16) / 255, - g: parseInt(result[2], 16) / 255, - b: parseInt(result[3], 16) / 255 - } : { r: 0.06, g: 0.73, b: 0.51 }; // fallback green - }; const rgb = hexToRgb(edgeColor); edgeGlowFilter.append('feColorMatrix') @@ -1062,7 +1039,6 @@ export function InteractiveGraphVisualization({ onResetLayout, onNodeSelected, i if (!event.ctrlKey && !event.metaKey && !event.altKey) { // Only plain R key event.preventDefault(); refreshTextVisibility(); - console.log('[Graph Debug] Manual text visibility refresh triggered'); } } }; @@ -1199,14 +1175,7 @@ export function InteractiveGraphVisualization({ onResetLayout, onNodeSelected, i refetchEdges(); } }, [currentGraph?.id, refetch, refetchEdges]); - - // Refresh text visibility after data changes - DISABLED to prevent conflicts - // useEffect(() => { - // if (workItems && edgesData?.edges) { - // refreshTextVisibility(); - // } - // }, [workItems?.length, edgesData?.edges?.length, refreshTextVisibility]); - + const workItemEdges: WorkItemEdge[] = []; // Add edges from Neo4j Edge entities @@ -1246,25 +1215,6 @@ export function InteractiveGraphVisualization({ onResetLayout, onNodeSelected, i // Validate and sanitize data before D3 processing const currentValidationResult = validateGraphData(workItems, workItemEdges); - // Debug logging for data validation issues - useEffect(() => { - console.log('[Graph Debug] Data validation result:', { - totalWorkItems: workItems.length, - totalEdges: workItemEdges.length, - validNodes: currentValidationResult.validNodes.length, - validEdges: currentValidationResult.validEdges.length, - errors: currentValidationResult.errors, - warnings: currentValidationResult.warnings - }); - - if (workItems.length > 0 && currentValidationResult.validNodes.length === 0) { - console.error('[Graph Debug] CRITICAL: All nodes filtered out by validation!', { - rawWorkItems: workItems, - validationResult: currentValidationResult - }); - } - }, [workItems.length, currentValidationResult.validNodes.length, currentValidationResult.errors.length]); - // Update validation state useEffect(() => { setValidationResult(currentValidationResult); @@ -1313,10 +1263,6 @@ export function InteractiveGraphVisualization({ onResetLayout, onNodeSelected, i priority: item.priority || 0 }; - // DEBUG: Log if this node is being reset to origin - if (x === 0 && y === 0 && item.positionX !== 0 && item.positionY !== 0) { - console.log('[CRITICAL DEBUG] Node position being reset to origin:', item.id, 'was at:', item.positionX, item.positionY); - } return node; }) @@ -1691,13 +1637,11 @@ export function InteractiveGraphVisualization({ onResetLayout, onNodeSelected, i const needsReinit = (currentNodeCount !== newNodeCount) || (currentEdgeCount !== newEdgeCount); if (needsReinit) { - console.log('[Graph Debug] Data structure changed - triggering reinitialization with preserved camera'); setReinitTrigger(prev => prev + 1); return; } // If counts are the same, update both simulation data AND DOM elements (for property changes) - console.log('[Graph Debug] Data counts unchanged - updating simulation data and DOM elements'); // Merge fresh data INTO the live simulation objects instead of swapping // arrays. The DOM is data-bound to these exact objects; replacing them @@ -1836,7 +1780,6 @@ export function InteractiveGraphVisualization({ onResetLayout, onNodeSelected, i simulation.alpha(0.1).restart(); } - console.log('[Graph Debug] Simulation data and DOM elements updated'); }, [nodes, validatedEdges, getNodeDimensions]); // Define initializeVisualization function with access to nodes data @@ -4209,7 +4152,6 @@ export function InteractiveGraphVisualization({ onResetLayout, onNodeSelected, i if ((window as any).debugLog) { (window as any).debugLog('Graph', '🎯 Center on node', viewportUpdate); } - console.log('🎯 CENTER-ON-NODE viewport update:', viewportUpdate); (window as any).updateMiniMapViewport(viewportUpdate); } }, [nodes, currentTransform]); @@ -4225,7 +4167,6 @@ export function InteractiveGraphVisualization({ onResetLayout, onNodeSelected, i if ((window as any).debugLog) { (window as any).debugLog('Graph', '📊 Viewport dimensions updated', dimensions); } - console.log('📊 VIEWPORT DIMENSIONS:', dimensions); if ((window as any).updateViewportDimensions) { (window as any).updateViewportDimensions(dimensions); } @@ -4469,13 +4410,6 @@ export function InteractiveGraphVisualization({ onResetLayout, onNodeSelected, i // Comprehensive reinitialization effect - ONLY when actually needed useEffect(() => { - console.log('[Graph Debug] Checking if reinitialization needed...', { - nodesLength: nodes.length, - prevNodesLength: prevNodeCountRef.current, - edgesLength: validatedEdges.length, - trigger: reinitTrigger, - currentGraph: currentGraph?.id - }); // Detect transition from empty to non-empty graph (first node creation) const wasEmpty = prevNodeCountRef.current === 0; @@ -4515,14 +4449,12 @@ export function InteractiveGraphVisualization({ onResetLayout, onNodeSelected, i nodesChanged; // a node's type changed — re-render its color/border/icon if (shouldReinit) { - console.log('[Graph Debug] Full reinitialization required'); initializeVisualization(); // Reset trigger after use if (reinitTrigger > 0) { setReinitTrigger(0); } } else { - console.log('[Graph Debug] Using selective updates instead of full reinit'); // Use selective data updates instead of full reinitialization updateVisualizationData(); } @@ -4574,26 +4506,8 @@ export function InteractiveGraphVisualization({ onResetLayout, onNodeSelected, i // Manual reinitialization function (expose globally for debugging) useEffect(() => { (window as any).forceGraphReinit = () => { - console.log('[Graph Debug] Forcing manual reinitialization...'); setReinitTrigger(prev => prev + 1); }; - - // Auto-reinit on view switches or navigation changes - DISABLED to prevent conflicts - // const handleVisibilityChange = () => { - // if (!document.hidden) { - // console.log('[Graph Debug] View became visible, checking if reinit needed...'); - // setTimeout(() => { - // const svg = d3.select(containerRef.current).select('svg'); - // const hasNodes = svg.select('.nodes-group').selectAll('.node').size() > 0; - // if (nodes.length > 0 && !hasNodes) { - // console.log('[Graph Debug] Missing nodes detected, forcing reinit...'); - // setReinitTrigger(prev => prev + 1); - // } - // }, 100); - // } - // }; - - // document.addEventListener('visibilitychange', handleVisibilityChange); return () => { delete (window as any).forceGraphReinit; }; @@ -4604,7 +4518,6 @@ export function InteractiveGraphVisualization({ onResetLayout, onNodeSelected, i const handleKeyDown = (event: KeyboardEvent) => { if (event.key === 'R' && event.shiftKey) { event.preventDefault(); - console.log('[Graph Debug] Manual reinit triggered by Shift+R'); setReinitTrigger(prev => prev + 1); } }; diff --git a/scripts/setup-oauth.sh b/scripts/setup-oauth.sh index 08033011..6eb1c15e 100755 --- a/scripts/setup-oauth.sh +++ b/scripts/setup-oauth.sh @@ -163,7 +163,7 @@ ENVEXAMPLE # Direct edit echo "" echo -e "${CYAN}Opening $ENV_FILE for editing...${NC}" - echo -e "${YELLOW}💡 Refer to docs/oauth-setup-guide.md for detailed setup steps${NC}" + echo -e "${YELLOW}💡 Refer to docs/security/oauth-setup-guide.md for detailed setup steps${NC}" sleep 2 ${EDITOR:-nano} "$ENV_FILE" echo "" @@ -243,5 +243,5 @@ esac echo "" echo -e "${GREEN}${BOLD}✅ Setup complete!${NC}" echo "" -echo -e "${CYAN}📚 For more details, see: ${YELLOW}docs/oauth-setup-guide.md${NC}" +echo -e "${CYAN}📚 For more details, see: ${YELLOW}docs/security/oauth-setup-guide.md${NC}" echo ""