# Script to help set up Neo4j connection in .env file
Write-Host "Neo4j Connection Setup" -ForegroundColor Cyan
Write-Host ""
# Check if .env exists
if (-not (Test-Path .env)) {
Write-Host "Creating .env file from template..." -ForegroundColor Yellow
Copy-Item env.example .env
}
# Read current .env
$envContent = Get-Content .env -Raw
# Check if Neo4j settings exist
if ($envContent -notmatch "NEO4J_URI") {
Write-Host "Neo4j connection details are missing in .env file!" -ForegroundColor Yellow
Write-Host ""
Write-Host "You need to add Neo4j connection details. Options:" -ForegroundColor Cyan
Write-Host ""
Write-Host "Option 1: Neo4j Aura (Free Cloud - Recommended)" -ForegroundColor Green
Write-Host " 1. Go to: https://neo4j.com/cloud/aura/" -ForegroundColor White
Write-Host " 2. Sign up for a free account" -ForegroundColor White
Write-Host " 3. Create a free database" -ForegroundColor White
Write-Host " 4. Copy your connection URI" -ForegroundColor White
Write-Host " 5. Copy your username and password" -ForegroundColor White
Write-Host ""
Write-Host "Then add these lines to your .env file:" -ForegroundColor Yellow
Write-Host " NEO4J_URI=neo4j+s://xxxxx.databases.neo4j.io" -ForegroundColor White
Write-Host " NEO4J_USER=neo4j" -ForegroundColor White
Write-Host " NEO4J_PASSWORD=your_password_here" -ForegroundColor White
Write-Host ""
$openEditor = Read-Host "Would you like to open .env file for editing now? (y/n)"
if ($openEditor -eq 'y' -or $openEditor -eq 'Y') {
notepad .env
Write-Host ""
Write-Host "After saving your Neo4j connection details, run the server again." -ForegroundColor Green
}
} else {
Write-Host "Neo4j connection details found in .env" -ForegroundColor Green
Write-Host ""
Write-Host "Current Neo4j settings:" -ForegroundColor Cyan
Get-Content .env | Select-String 'NEO4J'
}