-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·59 lines (50 loc) · 2.48 KB
/
setup.sh
File metadata and controls
executable file
·59 lines (50 loc) · 2.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
set -e
echo "╔════════════════════════════════════════════════════════════╗"
echo "║ GRAPHMASTER - Quick Setup ║"
echo "╚════════════════════════════════════════════════════════════╝"
echo ""
# Check for Docker
if ! command -v docker &> /dev/null; then
echo "❌ Docker is required but not installed."
echo " Install Docker: https://docs.docker.com/get-docker/"
exit 1
fi
# Check for Node.js
if ! command -v node &> /dev/null; then
echo "❌ Node.js is required but not installed."
echo " Install Node.js 18+: https://nodejs.org/"
exit 1
fi
# Determine docker compose command
if docker compose version &> /dev/null 2>&1; then
DC="docker compose"
else
DC="docker-compose"
fi
echo "🐳 Starting Neo4j..."
$DC up -d
echo "⏳ Waiting for Neo4j to be ready..."
until curl -s http://localhost:7474 > /dev/null 2>&1; do
sleep 2
done
echo "✓ Neo4j is ready"
echo ""
echo "📦 Installing dependencies..."
npm install
echo ""
echo "🌱 Seeding data..."
cp -n .env.example .env 2>/dev/null || true
npm run ingest
echo ""
echo "╔════════════════════════════════════════════════════════════╗"
echo "║ SETUP COMPLETE ║"
echo "╠════════════════════════════════════════════════════════════╣"
echo "║ ║"
echo "║ Neo4j Browser: http://localhost:7474 ║"
echo "║ Credentials: neo4j / graphmaster ║"
echo "║ ║"
echo "║ Run sample queries: npm run queries ║"
echo "║ Stop Neo4j: docker compose down ║"
echo "║ ║"
echo "╚════════════════════════════════════════════════════════════╝"