Run these commands in PowerShell from your project directory:
# Step 1: Install dependencies (if not already done)
npm install
# Step 2: Setup environment file
if (!(Test-Path .env)) {
Copy-Item .env.example .env
Write-Host "β
Created .env file - Please add your GEMINI_API_KEY" -ForegroundColor Green
notepad .env
} else {
Write-Host "β οΈ .env already exists" -ForegroundColor Yellow
}
# Step 3: Setup database (if not already done)
npm run prisma:generate
npm run db:push
npm run db:seed
# Step 4: Build CSS (optional)
npm run css:build
# Step 5: Start the server
Write-Host "π Starting PocketGuard..." -ForegroundColor Cyan
npm run devRun these commands in Terminal from your project directory:
# Step 1: Install dependencies
npm install
# Step 2: Setup environment file
if [ ! -f .env ]; then
cp .env.example .env
echo "β
Created .env file - Please add your GEMINI_API_KEY"
nano .env # or use your preferred editor: code .env, vim .env
else
echo "β οΈ .env already exists"
fi
# Step 3: Setup database
npm run prisma:generate
npm run db:push
npm run db:seed
# Step 4: Build CSS (optional)
npm run css:build
# Step 5: Start the server
echo "π Starting PocketGuard..."
npm run devnpm installVerifies: All packages from package.json are installed
# Copy template
cp .env.example .env
# Edit with your favorite editor
code .env # VS Code
# or
notepad .env # Windows Notepad
# or
nano .env # Terminal editorAdd your Gemini API key:
GEMINI_API_KEY=your_actual_key_here# Generate Prisma client
npm run prisma:generate
# Push schema to database
npm run db:push
# Seed with demo data
npm run db:seedCreates: SQLite database with demo user and transactions
npm run css:buildNote: Pre-compiled CSS is already included, but you can rebuild if needed
npm run devOpens: http://localhost:3000
- Navigate to http://localhost:3000
- Login with:
- Email:
demo@pocketguard.test - Password:
demo123
- Email:
- Click "Buddy" in bottom navigation
- Start chatting!
After installation, verify:
# Check if .env exists and has GEMINI_API_KEY
Get-Content .env | Select-String "GEMINI_API_KEY" # PowerShell
# or
cat .env | grep GEMINI_API_KEY # macOS/LinuxShould show: GEMINI_API_KEY=your_key_here
# Check if database exists
Test-Path ".\prisma\dev.db" # PowerShell
# or
ls -la prisma/dev.db # macOS/LinuxShould show: File exists with size > 0
# Check if node_modules installed
Test-Path ".\node_modules" # PowerShell
# or
ls -la node_modules # macOS/LinuxShould show: Directory with packages
# Check if CSS compiled
Test-Path ".\public\css\buddy.css" # PowerShell
# or
ls -la public/css/buddy.css # macOS/LinuxShould show: buddy.css file exists
# Solution 1: Clear cache
npm cache clean --force
npm install
# Solution 2: Delete and reinstall
Remove-Item -Recurse -Force node_modules # PowerShell
rm -rf node_modules # macOS/Linux
npm install
# Solution 3: Use specific Node version
nvm install 18
nvm use 18
npm install# Solution: Install Prisma CLI
npm install -D prisma
npx prisma generate# Solution: Delete existing database and start fresh
Remove-Item ".\prisma\dev.db" # PowerShell
rm prisma/dev.db # macOS/Linux
npm run db:push
npm run db:seed# Solution 1: Use different port
# Edit .env:
PORT=3001
# Solution 2: Kill process on port 3000
# PowerShell:
Get-Process -Id (Get-NetTCPConnection -LocalPort 3000).OwningProcess | Stop-Process -Force
# macOS/Linux:
lsof -ti:3000 | xargs kill -9# Solution: Verify .env location
# Should be in project root, same level as package.json
Get-Location # PowerShell
pwd # macOS/Linux
# Check file location
Get-ChildItem .env # PowerShell
ls -la .env # macOS/LinuxSave as test-setup.ps1 (PowerShell) or test-setup.sh (Bash):
Write-Host "π Testing PocketGuard Setup..." -ForegroundColor Cyan
# Test 1: Check .env
if (Test-Path .env) {
Write-Host "β
.env file exists" -ForegroundColor Green
} else {
Write-Host "β .env file missing" -ForegroundColor Red
}
# Test 2: Check API key
$apiKey = Select-String -Path .env -Pattern "GEMINI_API_KEY=\w+"
if ($apiKey) {
Write-Host "β
API key configured" -ForegroundColor Green
} else {
Write-Host "β οΈ API key not set or empty" -ForegroundColor Yellow
}
# Test 3: Check database
if (Test-Path ".\prisma\dev.db") {
Write-Host "β
Database exists" -ForegroundColor Green
} else {
Write-Host "β Database missing - run: npm run db:push" -ForegroundColor Red
}
# Test 4: Check node_modules
if (Test-Path ".\node_modules") {
Write-Host "β
Dependencies installed" -ForegroundColor Green
} else {
Write-Host "β Dependencies missing - run: npm install" -ForegroundColor Red
}
# Test 5: Check CSS
if (Test-Path ".\public\css\buddy.css") {
Write-Host "β
Chatbot CSS exists" -ForegroundColor Green
} else {
Write-Host "β Chatbot CSS missing" -ForegroundColor Red
}
Write-Host "`n⨠Setup check complete!" -ForegroundColor Cyan#!/bin/bash
echo "π Testing PocketGuard Setup..."
# Test 1: Check .env
if [ -f .env ]; then
echo "β
.env file exists"
else
echo "β .env file missing"
fi
# Test 2: Check API key
if grep -q "GEMINI_API_KEY=\w\+" .env 2>/dev/null; then
echo "β
API key configured"
else
echo "β οΈ API key not set or empty"
fi
# Test 3: Check database
if [ -f prisma/dev.db ]; then
echo "β
Database exists"
else
echo "β Database missing - run: npm run db:push"
fi
# Test 4: Check node_modules
if [ -d node_modules ]; then
echo "β
Dependencies installed"
else
echo "β Dependencies missing - run: npm install"
fi
# Test 5: Check CSS
if [ -f public/css/buddy.css ]; then
echo "β
Chatbot CSS exists"
else
echo "β Chatbot CSS missing"
fi
echo -e "\n⨠Setup check complete!"For production deployment:
# 1. Set production environment
# In .env:
NODE_ENV=production
SESSION_SECRET=generate_strong_secret_here
# 2. Use PostgreSQL instead of SQLite
# In .env:
DATABASE_URL=postgresql://user:password@localhost:5432/pocketguard
# 3. Build and start
npm run prisma:generate
npm run db:push
npm run css:build
npm start- Visit: https://makersuite.google.com/app/apikey
- Sign in with your Google account
- Click "Get API Key" or "Create API Key"
- Copy the generated key
- Paste into your
.envfile:GEMINI_API_KEY=AIza...your_key_here
Copy and paste this complete setup:
# Complete PocketGuard setup
Write-Host "π Starting PocketGuard setup..." -ForegroundColor Cyan
npm install
Copy-Item .env.example .env -ErrorAction SilentlyContinue
npm run prisma:generate
npm run db:push
npm run db:seed
Write-Host "β
Setup complete!" -ForegroundColor Green
Write-Host "π Don't forget to add your GEMINI_API_KEY to .env" -ForegroundColor Yellow
Write-Host "π Starting server..." -ForegroundColor Cyan
npm run dev#!/bin/bash
echo "π Starting PocketGuard setup..."
npm install
cp .env.example .env 2>/dev/null || true
npm run prisma:generate
npm run db:push
npm run db:seed
echo "β
Setup complete!"
echo "π Don't forget to add your GEMINI_API_KEY to .env"
echo "π Starting server..."
npm run devReady to go! π Your Finance Buddy chatbot is now installed and configured.