Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,11 @@ logs/

# Cache
.cache/
.parcel-cache/
.parcel-cache/

# TypeScript
*.tsbuildinfo
tsconfig.tsbuildinfo

# Prisma
prisma/dev.db
77 changes: 67 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,82 @@ GraphDone is built on the belief that:

## Quick Start

### One-Command Setup
### Prerequisites

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

### One Command to Rule Them All

```bash
git clone https://github.com/your-org/graphdone.git
cd graphdone
./tools/setup.sh
./tools/run.sh
git clone https://github.com/GraphDone/GraphDone-Core.git
cd GraphDone-Core
./start
```

Visit http://localhost:3000 to see the working application!
That's it! The script will automatically:
- Check prerequisites and offer to install Node.js if needed
- Install all dependencies
- Set up your environment
- Start the database
- Build the packages
- Launch the development servers

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

> πŸ’‘ **Don't have Node.js?** No problem! The setup script will detect this and offer to install Node.js 18 for you using nvm (Node Version Manager).

### What You Get

- 🌐 **Web Application**: Full graph visualization and collaboration interface
- πŸ”— **GraphQL API**: Complete backend with real-time subscriptions
- 🌐 **Web Application**: http://localhost:3127 - Full graph visualization and collaboration interface
- πŸ”— **GraphQL API**: http://localhost:4127/graphql - Complete backend with real-time subscriptions
- 🩺 **Health Check**: http://localhost:4127/health - Service status monitoring
- πŸ—„οΈ **Database**: PostgreSQL with graph-optimized schema
- 🐳 **Docker Setup**: Development and production containers
- 🐳 **Docker Setup**: Development and production containers ready to go
- πŸ§ͺ **Testing**: Comprehensive test suite with coverage reporting

### Alternative Quick Commands

```bash
# Minimal launcher (less verbose)
./launch.sh

# Manual control (advanced users)
./tools/setup.sh # One-time setup
./tools/run.sh # Start development servers
```

### Troubleshooting

**Docker Permission Denied?**
```bash
# Fix Docker permissions (then restart terminal)
sudo usermod -aG docker $USER
newgrp docker

# Or run the setup with sudo assistance
./start # Will offer to use sudo automatically
```

**Node.js Missing?**
```bash
./start # Will offer to install Node.js 18 automatically
```

**Port Already in Use?**
```bash
./tools/cleanup.sh # Kill any hanging processes
./start # Try starting again
```

**Cannot Find Module Errors?**
```bash
./tools/fix-workspace.sh # Fix workspace dependencies
./start # Try starting again
```

## Core Concepts

### Graph Structure
Expand Down Expand Up @@ -96,7 +153,7 @@ GraphDone is built for and by teams who think differently. We welcome contributi
- Performance for large graphs

**Get Started:**
1. Run `./tools/setup.sh && ./tools/run.sh` to see the system working
1. Run `./start` to see the system working locally
2. Read our [philosophy](./docs/philosophy.md) and [architecture](./docs/guides/architecture-overview.md)
3. Pick an area that excites you and matches your skills
4. Join discussions in GitHub Issues and pull requests
Expand Down
14 changes: 6 additions & 8 deletions deployment/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.8'

services:
postgres:
image: postgres:15-alpine
Expand Down Expand Up @@ -37,10 +35,10 @@ services:
environment:
- NODE_ENV=production
- DATABASE_URL=postgresql://graphdone:graphdone_password@postgres:5432/graphdone
- PORT=4000
- CORS_ORIGIN=http://localhost:3000
- PORT=4127
- CORS_ORIGIN=http://localhost:3127
ports:
- "4000:4000"
- "4127:4127"
depends_on:
postgres:
condition: service_healthy
Expand All @@ -59,10 +57,10 @@ services:
context: ..
dockerfile: packages/web/Dockerfile
environment:
- VITE_GRAPHQL_URL=http://localhost:4000/graphql
- VITE_GRAPHQL_WS_URL=ws://localhost:4000/graphql
- VITE_GRAPHQL_URL=http://localhost:4127/graphql
- VITE_GRAPHQL_WS_URL=ws://localhost:4127/graphql
ports:
- "3000:3000"
- "3127:3127"
depends_on:
- server
volumes:
Expand Down
26 changes: 26 additions & 0 deletions launch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

# GraphDone Simple Launcher
# Super quick way to start GraphDone

echo "πŸš€ GraphDone Quick Start"
echo "========================"
echo ""

# Quick check for dependencies
if ! command -v node &> /dev/null || ! command -v docker &> /dev/null; then
echo "❌ Missing dependencies. Please ensure Node.js and Docker are installed."
exit 1
fi

# Run setup if needed, then start
if [ ! -f "packages/server/.env" ]; then
echo "⚑ Running quick setup..."
./tools/setup.sh
fi

echo "🎯 Starting development servers..."
./tools/run.sh

echo ""
echo "βœ… GraphDone is running at http://localhost:3000"
2 changes: 1 addition & 1 deletion packages/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"dev": "npm run kill-port && vite",
"dev:force": "vite",
"kill-port": "lsof -ti:${PORT:-3000} | xargs -r kill || true",
"kill-port": "lsof -ti:${PORT:-3127} | xargs -r kill -9 || true",
"build": "tsc && vite build",
"preview": "vite preview",
"test": "vitest",
Expand Down
7 changes: 5 additions & 2 deletions packages/web/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { resolve } from 'path';
import { hostname } from 'os';

export default defineConfig({
plugins: [react()],
Expand All @@ -11,11 +12,13 @@ export default defineConfig({
}
},
server: {
port: Number(process.env.PORT) || 3000,
host: '0.0.0.0', // Listen on all interfaces for external access
port: Number(process.env.PORT) || 3127,
strictPort: true, // Exit if port is already in use instead of trying next available
allowedHosts: ['localhost', hostname(), '*.local', '.tailscale'], // Auto-detect hostname + common patterns
proxy: {
'/graphql': {
target: 'http://localhost:4000',
target: 'http://localhost:4127',
changeOrigin: true
}
}
Expand Down
141 changes: 141 additions & 0 deletions start
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
#!/bin/bash

# GraphDone Quick Launcher
# The easiest way to get GraphDone running

set -e

# Colors for better output
RED='\033[0;31m'
GREEN='\033[0;32m'
BLUE='\033[0;34m'
YELLOW='\033[1;33m'
PURPLE='\033[0;35m'
CYAN='\033[0;36m'
NC='\033[0m' # No Color

# Clear screen for a clean start
clear

echo -e "${PURPLE}"
echo "╔══════════════════════════════════════════════════════════════╗"
echo "β•‘ β•‘"
echo "β•‘ 🌐 GraphDone 🌐 β•‘"
echo "β•‘ β•‘"
echo "β•‘ Graph-native project management system β•‘"
echo "β•‘ β•‘"
echo "β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•"
echo -e "${NC}"

# Function to ensure Node.js is available (same as in run.sh)
ensure_nodejs() {
# If node/npm not found, try to source nvm
if ! command -v node &> /dev/null || ! command -v npm &> /dev/null; then
echo -e "${YELLOW}⚠️ Node.js/npm not found in PATH, attempting to load from nvm...${NC}"

# Try to load nvm
export NVM_DIR="$HOME/.nvm"
if [ -s "$NVM_DIR/nvm.sh" ]; then
source "$NVM_DIR/nvm.sh"
if [ -s "$NVM_DIR/bash_completion" ]; then
source "$NVM_DIR/bash_completion"
fi

# Use the latest installed version or 18
if nvm list | grep -q "v18"; then
nvm use 18
else
nvm use node
fi

echo -e "${GREEN}βœ… Loaded Node.js from nvm: $(node --version)${NC}"
else
echo -e "${RED}❌ Node.js not found and nvm not available.${NC}"
echo "Please restart your terminal or run:"
echo " source ~/.bashrc # or ~/.zshrc"
echo " ./start"
exit 1
fi
fi
}

echo -e "${CYAN}Welcome to GraphDone! This script will get you up and running quickly.${NC}"
echo ""

# Ensure Node.js is available
ensure_nodejs

# Check if setup or workspace repair is needed
setup_needed=false
workspace_repair_needed=false

if [ ! -f "packages/server/.env" ] || [ ! -f "packages/web/.env" ]; then
setup_needed=true
fi

# Check if workspace dependencies are broken
if [ ! -f "packages/core/dist/index.js" ] || [ ! -L "node_modules/@graphdone/core" ] || [ ! -f "node_modules/.prisma/client/index.js" ]; then
workspace_repair_needed=true
fi

# Run setup if needed
if [ "$setup_needed" = true ]; then
echo -e "${YELLOW}πŸ”§ First time setup detected...${NC}"
echo ""
echo -e "${BLUE}Running initial setup (this may take a few minutes):${NC}"
echo " β€’ Installing dependencies"
echo " β€’ Setting up environment variables"
echo " β€’ Starting database"
echo " β€’ Running migrations"
echo " β€’ Building packages"
echo ""

./tools/setup.sh

echo ""
echo -e "${GREEN}βœ… Setup complete!${NC}"
echo ""
elif [ "$workspace_repair_needed" = true ]; then
echo -e "${YELLOW}πŸ”§ Workspace dependencies need repair...${NC}"
echo ""
echo -e "${BLUE}Fixing workspace dependencies:${NC}"
echo " β€’ Rebuilding core package"
echo " β€’ Generating Prisma client"
echo " β€’ Ensuring workspace links"
echo ""

# Quick workspace repair (less aggressive than full setup)
echo -e "${CYAN}πŸ“¦ Installing dependencies...${NC}"
npm install

echo -e "${CYAN}πŸ—οΈ Building core package...${NC}"
(cd packages/core && npm run build)

echo -e "${CYAN}πŸ”§ Generating Prisma client...${NC}"
(cd packages/server && npx prisma generate)

# Verify the fix worked
if [ -f "packages/core/dist/index.js" ] && [ -L "node_modules/@graphdone/core" ]; then
echo ""
echo -e "${GREEN}βœ… Workspace repair complete!${NC}"
echo ""
else
echo ""
echo -e "${RED}❌ Workspace repair failed. Running full setup...${NC}"
echo ""
./tools/setup.sh
fi
fi

echo -e "${BLUE}πŸš€ Starting GraphDone development environment...${NC}"
echo ""

# Start the development environment
if ! ./tools/run.sh; then
echo ""
echo -e "${YELLOW}⚠️ If you see 'command not found' errors:${NC}"
echo " 1. Restart your terminal"
echo " 2. Or run: source ~/.bashrc (or ~/.zshrc)"
echo " 3. Then try: ./start again"
echo ""
fi
41 changes: 41 additions & 0 deletions tools/cleanup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash

# GraphDone Cleanup Script
# Kills any processes running on GraphDone's ports

echo "🧹 Cleaning up GraphDone processes..."

# Function to kill processes on a specific port
kill_port() {
local port=$1
local pids=$(lsof -ti:$port 2>/dev/null)

if [ -n "$pids" ]; then
echo "πŸ”„ Killing processes on port $port: $pids"
echo "$pids" | xargs kill -9 2>/dev/null || true
sleep 1

# Check if any processes are still running
local remaining=$(lsof -ti:$port 2>/dev/null)
if [ -n "$remaining" ]; then
echo "⚠️ Some processes on port $port are still running: $remaining"
else
echo "βœ… Port $port is now free"
fi
else
echo "βœ… Port $port is already free"
fi
}

# Clean up GraphDone ports
kill_port 3127 # Web server
kill_port 4127 # GraphQL API

# Also kill any npm/node processes that might be hanging
echo "πŸ”„ Cleaning up any hanging npm/node processes..."
pkill -f "npm run dev" 2>/dev/null || true
pkill -f "vite" 2>/dev/null || true
pkill -f "tsx watch" 2>/dev/null || true

echo ""
echo "βœ… Cleanup complete! You can now run ./start again."
Loading