Skip to main content

Root Scripts

Scripts available in the monorepo root (package.json):

Development

# Start all development servers
bun run dev

# Start development servers for specific apps
bun run dev:apps          # GeoFlow + Backend
bun run dev:geoflow       # Frontend only
bun run dev:motia         # Workflow engine only
bun run dev:backend       # Backend only

Docker

# Start development with Docker
bun run docker:dev

# Stop Docker services
bun run docker:down

Code Quality

# Lint all packages
bun run lint

# Type check all packages
bun run type-check

# Format code in all packages
bun run format

Maintenance

# Clean all node_modules and build artifacts
bun run clean

# Clean everything including Motia dependencies
bun run clean:all

App-Specific Scripts

GeoFlow App (apps/geoflow/package.json)

cd apps/geoflow

# Development
bun run dev              # Start Vite dev server
bun run dev:app          # Alternative dev command

# Build
bun run build            # Production build
bun run serve            # Preview production build

# Testing
bun run test             # Run Vitest tests

# Code Quality
bun run format           # Format with Biome
bun run lint             # Lint with Biome
bun run check            # Check (lint + format)
bun run type-check       # TypeScript type checking

# Maintenance
bun run clean            # Clean build artifacts
bun run ui:add           # Add shadcn/ui component

Backend (apps/backend/package.json)

cd apps/backend

# Development
bun run dev              # Start Convex development server

Motia (apps/motia/package.json)

cd apps/motia

# Development
bunx motia dev --port 4010

# Note: Motia uses its own CLI, not npm scripts

Worker (packages/worker/package.json)

cd packages/worker

# Development
bun run dev              # Start development server

# Build
bun run build            # Production build

MCP (packages/mcp/)

cd packages/mcp

# Development (Python)
python -m uvicorn server:app --reload --port 8000

# Note: MCP uses Python, not npm scripts

Docker Commands

Service Management

# Start all services
docker compose up -d

# Start specific services
docker compose up geoflow-worker postgres -d

# Stop all services
docker compose down

# Stop and remove volumes
docker compose down -v

# View service status
docker compose ps

# View logs
docker compose logs
docker compose logs -f geoflow-app  # Follow specific service

Development with Docker

# Rebuild and start
docker compose up --build -d

# Scale services
docker compose up -d --scale geoflow-app=3

# Execute commands in containers
docker compose exec geoflow-app sh
docker compose exec postgres psql -U geoflow -d geoflow

Docker Maintenance

# Clean up unused resources
docker system prune -a

# View disk usage
docker system df

# Remove all containers and volumes
docker compose down -v --remove-orphans

Database Commands

PostgreSQL

# Connect to database
docker compose exec postgres psql -U geoflow -d geoflow

# Backup database
docker compose exec postgres pg_dump -U geoflow geoflow > backup.sql

# Restore database
docker compose exec -T postgres psql -U geoflow geoflow < backup.sql

# Check database health
docker compose exec postgres pg_isready -U geoflow -d geoflow

Convex

# Deploy schema changes
convex deploy

# View dashboard
convex dashboard

# Run database functions
convex run functionName

# View logs
convex logs

# Manage deployments
convex deployments

Git Commands

Workflow

# Clone repository
git clone https://github.com/qs-geoflow/geoflow.git

# Create feature branch
git checkout -b feature/new-feature

# Stage changes
git add .

# Commit changes
git commit -m "Description of changes"

# Push branch
git push origin feature/new-feature

# Merge main
git checkout main
git pull origin main
git checkout feature/new-feature
git rebase main

Maintenance

# View status
git status

# View changes
git diff
git diff --staged

# View history
git log --oneline
git log --graph --oneline --all

# Stash changes
git stash
git stash pop

Testing Commands

Frontend Tests

# Run all tests
bun run test

# Run tests in watch mode
bun run test --watch

# Run specific test file
bun run test WorkflowCard.test.tsx

# Run tests with coverage
bun run test --coverage

# Update snapshots
bun run test --update

Integration Tests

# Run E2E tests (if configured)
bun run test:e2e

# Run API tests
bun run test:api

Build Commands

Production Builds

# Build all packages
bun run build

# Build specific app
cd apps/geoflow && bun run build

# Build worker
cd packages/worker && bun run build

Docker Builds

# Build all images
docker compose build

# Build specific service
docker compose build geoflow-app

# Build without cache
docker compose build --no-cache

Monitoring Commands

System Monitoring

# View running processes
top
htop

# Monitor disk usage
df -h
du -sh *

# Monitor network
iftop
netstat -tlnp

Docker Monitoring

# Container resource usage
docker stats

# Container logs
docker compose logs -f

# Container health
docker compose ps
docker inspect container_name

Application Monitoring

# View application logs
docker compose logs geoflow-app

# Check application health
curl http://localhost:3000/health

# Database connections
docker compose exec postgres pg_stat_activity

Deployment Commands

Local Deployment

# Deploy to local Docker
docker compose -f docker-compose.yml up -d

# Deploy with production config
docker compose -f docker-compose.prod.yml up -d

Remote Deployment

# SSH to server
ssh user@server

# Pull latest changes
git pull origin main

# Deploy
docker compose up -d --build

# Check deployment
docker compose ps
curl https://your-domain.com

Utility Commands

File Operations

# Find files
find . -name "*.ts" -type f

# Search in files
grep -r "search term" .

# Count lines of code
find . -name "*.ts" -o -name "*.tsx" | xargs wc -l

Network Testing

# Test connectivity
ping google.com
curl ifconfig.me

# Test local services
curl http://localhost:3000
curl http://localhost:3210/version

# Port scanning
nmap localhost

Performance Testing

# Load testing (if configured)
ab -n 1000 -c 10 http://localhost:3000/

# Memory usage
ps aux --sort=-%mem | head

# CPU usage
top -b -n1 | head -20

Custom Scripts

Database Reset

#!/bin/bash
# reset-db.sh
echo "Resetting database..."

# Stop services
docker compose down

# Remove volumes
docker volume rm geoflow_postgres_data

# Start fresh
docker compose up -d postgres

# Wait for database
sleep 10

echo "Database reset complete"

Full Reset

#!/bin/bash
# full-reset.sh
echo "Full environment reset..."

# Stop everything
docker compose down -v --remove-orphans

# Clean workspace
bun run clean:all

# Reinstall
bun install

# Start fresh
bun run dev

echo "Reset complete"

IDE Integration

VS Code

Recommended extensions:
  • TypeScript and JavaScript Language Features
  • Biome (for linting and formatting)
  • Docker
  • PostgreSQL
  • GitLens

Keybindings

// .vscode/keybindings.json
[
  {
    "key": "ctrl+shift+b",
    "command": "workbench.action.tasks.runTask",
    "args": "build"
  },
  {
    "key": "ctrl+shift+t",
    "command": "workbench.action.tasks.runTask",
    "args": "test"
  }
]

Tasks

// .vscode/tasks.json
{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "build",
      "type": "shell",
      "command": "bun run build",
      "group": "build"
    },
    {
      "label": "test",
      "type": "shell",
      "command": "bun run test",
      "group": "test"
    },
    {
      "label": "dev",
      "type": "shell",
      "command": "bun run dev",
      "group": "build"
    }
  ]
}