Add full monorepo: virtual-banker, backend, frontend, docs, scripts, deployment
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
35
scripts/setup-database.sh
Executable file
35
scripts/setup-database.sh
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Setup Virtual Banker Database
|
||||
# This script runs all database migrations
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
DB_DIR="$PROJECT_ROOT/database/migrations"
|
||||
|
||||
# Load environment variables
|
||||
if [ -f "$PROJECT_ROOT/.env" ]; then
|
||||
export $(cat "$PROJECT_ROOT/.env" | grep -v '^#' | xargs)
|
||||
fi
|
||||
|
||||
# Set defaults
|
||||
export PGHOST="${PGHOST:-localhost}"
|
||||
export PGPORT="${PGPORT:-5432}"
|
||||
export PGUSER="${PGUSER:-explorer}"
|
||||
export PGPASSWORD="${PGPASSWORD:-changeme}"
|
||||
export PGDATABASE="${PGDATABASE:-explorer}"
|
||||
|
||||
echo "Running database migrations..."
|
||||
|
||||
# Run migrations in order
|
||||
for migration in "$DB_DIR"/*.up.sql; do
|
||||
if [ -f "$migration" ]; then
|
||||
echo "Running $(basename $migration)..."
|
||||
PGPASSWORD="$PGPASSWORD" psql -h "$PGHOST" -p "$PGPORT" -U "$PGUSER" -d "$PGDATABASE" -f "$migration"
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Database setup complete!"
|
||||
|
||||
31
scripts/start-backend.sh
Executable file
31
scripts/start-backend.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Start Virtual Banker Backend Service
|
||||
# This script starts the backend API server with proper environment configuration
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
BACKEND_DIR="$PROJECT_ROOT/backend"
|
||||
|
||||
cd "$BACKEND_DIR"
|
||||
|
||||
# Load environment variables
|
||||
if [ -f "$PROJECT_ROOT/.env" ]; then
|
||||
export $(cat "$PROJECT_ROOT/.env" | grep -v '^#' | xargs)
|
||||
fi
|
||||
|
||||
# Set defaults
|
||||
export DATABASE_URL="${DATABASE_URL:-postgres://explorer:changeme@localhost:5432/explorer?sslmode=disable}"
|
||||
export REDIS_URL="${REDIS_URL:-redis://localhost:6379}"
|
||||
export PORT="${PORT:-8081}"
|
||||
|
||||
echo "Starting Virtual Banker Backend..."
|
||||
echo "Database: $DATABASE_URL"
|
||||
echo "Redis: $REDIS_URL"
|
||||
echo "Port: $PORT"
|
||||
|
||||
# Run the service
|
||||
go run main.go
|
||||
|
||||
Reference in New Issue
Block a user