Skip to content

Commit 045fa58

Browse files
author
Matthew Valancy
committed
Merge branch 'dev-neo4j' into development
2 parents 26440cc + d9cb9ca commit 045fa58

59 files changed

Lines changed: 4048 additions & 2362 deletions

Some content is hidden

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

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ node_modules/
77
coverage/
88
*.lcov
99
.nyc_output
10+
test-results/
11+
test-artifacts/
12+
playwright-report/
13+
*.png
14+
*.jpg
15+
*.jpeg
16+
*.gif
17+
*.webp
1018

1119
# Production
1220
build/

CLAUDE.md

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@ GraphDone is a graph-native project management system that reimagines work coord
1717

1818
### Technology Stack
1919
- **Frontend**: React 18 with TypeScript, React Native for mobile, D3.js for graph visualization
20-
- **Backend**: Node.js with TypeScript, GraphQL with Apollo Server, PostgreSQL with graph extensions
20+
- **Backend**: Node.js with TypeScript, GraphQL with Apollo Server, Neo4j with @neo4j/graphql
2121
- **State Management**: Zustand
2222
- **Styling**: Tailwind CSS
2323
- **Build Tool**: Vite
2424
- **Real-time**: WebSocket subscriptions
2525
- **Infrastructure**: Docker, Kubernetes, GitHub Actions for CI/CD
26+
- **Testing**: Playwright for E2E testing, Vitest for unit tests
2627

2728
### Project Structure (Implemented)
2829
```
@@ -61,8 +62,7 @@ npm run typecheck # Type check all packages
6162
npm run build # Build all packages
6263

6364
# Database operations
64-
npm run db:migrate # Run Prisma migrations
65-
npm run db:seed # Seed database with test data
65+
npm run db:seed # Seed Neo4j database with test data
6666

6767
# Docker development
6868
docker-compose -f deployment/docker-compose.dev.yml up # With hot reload
@@ -132,32 +132,34 @@ npm run typecheck # Type check all packages
132132
**Completed:**
133133
- Monorepo structure with Turbo for build orchestration
134134
- Core graph engine with Node, Edge, Priority calculation, and full graph operations
135-
- GraphQL API server with comprehensive schema and resolvers
136-
- React web application with D3.js graph visualization
135+
- Neo4j integration with @neo4j/graphql auto-generated resolvers
136+
- GraphQL API server with comprehensive schema and WebSocket subscriptions
137+
- React web application with D3.js graph visualization and user-friendly error handling
137138
- TypeScript configuration across all packages
138-
- Vitest testing infrastructure with sample tests
139-
- Docker development and production configurations
140-
- Development scripts for setup, running, testing, building, and deployment
139+
- Playwright and Vitest testing infrastructure with E2E tests
140+
- Docker development and production configurations with Neo4j 5.15-community
141+
- Enhanced development scripts with automatic dependency management
141142
- GitHub Actions CI/CD workflows for testing, building, and deployment
142-
- Comprehensive documentation structure
143+
- Comprehensive documentation structure and branding (favicon, logos)
143144

144145
🏗️ **Architecture Implemented:**
145146
- `packages/core/` - Graph engine with priority calculation, node/edge management, path finding, cycle detection
146-
- `packages/server/` - GraphQL API with Prisma database schema, Apollo Server, WebSocket subscriptions
147-
- `packages/web/` - React app with Vite, Tailwind CSS, D3.js visualization, GraphQL client
148-
- Docker configurations for development and production
147+
- `packages/server/` - GraphQL API with Neo4j schema, Apollo Server with @neo4j/graphql, WebSocket subscriptions
148+
- `packages/web/` - React app with Vite, Tailwind CSS, D3.js visualization, Apollo Client, enhanced error handling
149+
- Docker configurations for development and production with Neo4j 5.15-community
149150
- Kubernetes-ready manifests (planned in deployment docs)
150151
- Full CI/CD pipeline with testing, security scanning, and deployment
152+
- Production deployment verified and tested
151153

152154
🎯 **Ready for Development:**
153155
All foundation pieces are in place. To continue development:
154-
1. Run `./tools/setup.sh` to initialize the development environment
155-
2. Use `./tools/run.sh` to start development servers
156-
3. Access the working application at http://localhost:3000
157-
4. Use GraphQL Playground at http://localhost:4000/graphql
156+
1. Run `./start` to initialize the development environment automatically
157+
2. Access the working application at http://localhost:3127
158+
3. Use GraphQL Playground at http://localhost:4127/graphql
159+
4. Backend status at http://localhost:3127/backend shows Neo4j architecture
158160
5. Begin implementing specific features using the established patterns
159-
6. Add more comprehensive tests using the Vitest setup
160-
7. Enhance the GraphQL schema and resolvers as needed
161+
6. Add more comprehensive tests using the Playwright and Vitest setup
162+
7. Enhance the Neo4j schema and GraphQL resolvers as needed
161163

162164
## Core Architecture
163165

@@ -179,17 +181,17 @@ Key files:
179181
### GraphQL API (`packages/server/`)
180182
Apollo Server with real-time subscriptions:
181183

182-
- **Database**: PostgreSQL with Prisma ORM
183-
- **Schema**: Comprehensive GraphQL schema matching core types
184-
- **Resolvers**: CRUD operations for nodes, edges, contributors
184+
- **Database**: Neo4j 5.15-community with APOC plugins
185+
- **Schema**: Auto-generated GraphQL schema with @neo4j/graphql
186+
- **Resolvers**: Automatically generated from Neo4j schema
185187
- **Subscriptions**: Real-time WebSocket updates
186188
- **Health Check**: `/health` endpoint for monitoring
187189

188190
Key files:
189191
- `packages/server/src/index.ts` - Apollo Server setup with WebSocket support
190-
- `packages/server/src/schema/index.ts` - GraphQL type definitions
191-
- `packages/server/src/resolvers/` - GraphQL resolvers
192-
- `packages/server/prisma/schema.prisma` - Database schema
192+
- `packages/server/src/schema/neo4j-schema.ts` - Neo4j GraphQL schema definitions
193+
- `packages/server/src/scripts/seed.ts` - Database seeding script
194+
- `packages/server/src/context.ts` - GraphQL context with Neo4j driver
193195

194196
### Web Application (`packages/web/`)
195197
React app with D3.js visualization:
@@ -229,17 +231,16 @@ Current test files:
229231

230232
## Database Schema
231233

232-
PostgreSQL with these main tables:
233-
- **Node**: Graph nodes with spherical coordinates and priorities
234-
- **Edge**: Connections between nodes with types and weights
234+
Neo4j with these main node types and relationships:
235+
- **WorkItem**: Graph nodes with spherical coordinates and priorities
236+
- **Edge**: Connections between nodes with types (DEPENDS_ON, BLOCKS, etc.)
235237
- **Contributor**: Users and AI agents in the system
236-
- **NodeContributor**: Many-to-many relationship
238+
- **WORKS_ON**: Relationships between contributors and work items
237239

238240
Key database operations:
239241
```bash
240-
npm run db:migrate # Apply schema changes
241-
npm run db:seed # Add test data
242-
npm run db:studio # Open Prisma Studio GUI
242+
npm run db:seed # Add test data with 32 work items and relationships
243+
# Access Neo4j Browser at http://localhost:7474 (neo4j/graphdone_password)
243244
```
244245

245246
## Package-Specific Commands
@@ -260,9 +261,8 @@ cd packages/server
260261
npm run dev # Start with hot reload (tsx)
261262
npm run build # Build TypeScript
262263
npm run start # Start production server
263-
npm run db:migrate # Run Prisma migrations
264-
npm run db:seed # Seed test data
265-
npm run db:studio # Open Prisma Studio
264+
npm run db:seed # Seed Neo4j database with test data
265+
# Neo4j Browser available at http://localhost:7474
266266
```
267267

268268
### Web Package (`packages/web/`)

README.md

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ GraphDone is built on the belief that:
4848

4949
GraphDone requires:
5050
- **Node.js 18+** - JavaScript runtime (our setup script can install this automatically)
51-
- **Docker** - For running PostgreSQL database ([Install Docker](https://docs.docker.com/get-docker/))
51+
- **Docker** - For running Neo4j graph database ([Install Docker](https://docs.docker.com/get-docker/))
5252
- **Git** - For version control (usually pre-installed)
5353

5454
### One Command to Rule Them All
@@ -61,11 +61,12 @@ cd GraphDone-Core
6161

6262
That's it! The script will automatically:
6363
- Check prerequisites and offer to install Node.js if needed
64-
- Install all dependencies
65-
- Set up your environment
66-
- Start the database
64+
- Install all dependencies including Neo4j drivers and Playwright for testing
65+
- Set up your environment with proper Neo4j configuration
66+
- Start Neo4j database with APOC plugins
6767
- Build the packages
6868
- Launch the development servers
69+
- Seed the database with sample data if empty
6970

7071
Visit **http://localhost:3127** when you see the "GraphDone is Ready!" message.
7172

@@ -74,21 +75,26 @@ Visit **http://localhost:3127** when you see the "GraphDone is Ready!" message.
7475
### What You Get
7576

7677
- 🌐 **Web Application**: http://localhost:3127 - Full graph visualization and collaboration interface
77-
- 🔗 **GraphQL API**: http://localhost:4127/graphql - Complete backend with real-time subscriptions
78+
- 🔗 **GraphQL API**: http://localhost:4127/graphql - Auto-generated resolvers with @neo4j/graphql
7879
- 🩺 **Health Check**: http://localhost:4127/health - Service status monitoring
79-
- 🗄️ **Database**: PostgreSQL with graph-optimized schema
80+
- 🗄️ **Database**: Neo4j 5.15-community with APOC plugins for native graph storage
8081
- 🐳 **Docker Setup**: Development and production containers ready to go
8182
- 🧪 **Testing**: Comprehensive test suite with coverage reporting
8283

8384
### Alternative Quick Commands
8485

8586
```bash
86-
# Minimal launcher (less verbose)
87-
./launch.sh
87+
# Quick start without full setup checks
88+
./start quick
8889

8990
# Manual control (advanced users)
9091
./tools/setup.sh # One-time setup
9192
./tools/run.sh # Start development servers
93+
94+
# Other commands
95+
./start clean # Clean and restart fresh
96+
./start status # Check system status
97+
./start stop # Stop all services
9298
```
9399

94100
### Troubleshooting
@@ -116,10 +122,15 @@ newgrp docker
116122

117123
**Cannot Find Module Errors?**
118124
```bash
119-
./tools/fix-workspace.sh # Fix workspace dependencies
120-
./start # Try starting again
125+
./start # Script will automatically detect and install missing dependencies
121126
```
122127

128+
**Service Connection Issues?**
129+
The app now provides user-friendly error messages instead of technical errors. If you see connection issues:
130+
- Check that `./start` completed successfully
131+
- Visit http://localhost:4127/health to verify the server is running
132+
- The error UI will guide you through common troubleshooting steps
133+
123134
## Core Concepts
124135

125136
### Graph Structure

deployment/docker-compose.yml

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
services:
2-
postgres:
3-
image: postgres:15-alpine
2+
neo4j:
3+
image: neo4j:5.15-community
44
environment:
5-
POSTGRES_DB: graphdone
6-
POSTGRES_USER: graphdone
7-
POSTGRES_PASSWORD: graphdone_password
5+
NEO4J_AUTH: neo4j/graphdone_password
6+
NEO4J_PLUGINS: '["graph-data-science", "apoc"]'
7+
NEO4J_dbms_security_procedures_unrestricted: "gds.*,apoc.*"
8+
NEO4J_dbms_security_procedures_allowlist: "gds.*,apoc.*"
89
ports:
9-
- "5432:5432"
10+
- "7474:7474" # HTTP
11+
- "7687:7687" # Bolt
1012
volumes:
11-
- postgres_data:/var/lib/postgresql/data
12-
- ../scripts/init-db.sql:/docker-entrypoint-initdb.d/init-db.sql
13+
- neo4j_data:/data
14+
- neo4j_logs:/logs
1315
healthcheck:
14-
test: ["CMD-SHELL", "pg_isready -U graphdone"]
16+
test: ["CMD", "cypher-shell", "-u", "neo4j", "-p", "graphdone_password", "RETURN 1"]
1517
interval: 10s
1618
timeout: 5s
1719
retries: 5
@@ -34,20 +36,22 @@ services:
3436
dockerfile: packages/server/Dockerfile
3537
environment:
3638
- NODE_ENV=production
37-
- DATABASE_URL=postgresql://graphdone:graphdone_password@postgres:5432/graphdone
39+
- NEO4J_URI=bolt://neo4j:7687
40+
- NEO4J_USER=neo4j
41+
- NEO4J_PASSWORD=graphdone_password
3842
- PORT=4127
3943
- CORS_ORIGIN=http://localhost:3127
4044
ports:
4145
- "4127:4127"
4246
depends_on:
43-
postgres:
47+
neo4j:
4448
condition: service_healthy
4549
redis:
4650
condition: service_healthy
4751
volumes:
4852
- ../packages/server/.env:/app/.env
4953
healthcheck:
50-
test: ["CMD", "curl", "-f", "http://localhost:4000/health"]
54+
test: ["CMD", "curl", "-f", "http://localhost:4127/health"]
5155
interval: 30s
5256
timeout: 10s
5357
retries: 3
@@ -67,5 +71,6 @@ services:
6771
- ../packages/web/.env:/app/.env
6872

6973
volumes:
70-
postgres_data:
74+
neo4j_data:
75+
neo4j_logs:
7176
redis_data:

launch.sh

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)