Skip to content

Instantly share code, notes, and snippets.

@chrishwiggins
Created March 8, 2026 18:13
Show Gist options
  • Select an option

  • Save chrishwiggins/9af2a31d5050f10c6b711be1b8a0b21b to your computer and use it in GitHub Desktop.

Select an option

Save chrishwiggins/9af2a31d5050f10c6b711be1b8a0b21b to your computer and use it in GitHub Desktop.
code-for-connection Makefile - zero to running webapp
.PHONY: all open install setup dev services web stop clean
# Default: full setup from zero + open browser
all: setup open
# Start everything and open the web app in a browser
open: dev
@sleep 2 && open http://localhost:5173 &
# Start all services + web frontend (background)
dev:
@docker compose up -d postgres redis
@npm run dev &
@echo "Dev servers starting..."
@echo " Web: http://localhost:5173"
@echo " API: http://localhost:3000"
@echo " Signaling: http://localhost:3001"
@echo ""
@echo "Admin logins (pwd: admin123):"
@echo " admin@nydocs.gov (agency)"
@echo " admin@singsingcf.gov (Sing Sing)"
@echo " admin@bedfordhillscf.gov (Bedford Hills)"
# Start only backend services
services:
@docker compose up -d postgres redis
@npm run dev:services
# Start only web frontend
web:
@npm run dev:web
# Install deps (skip if node_modules exists)
node_modules: package.json
npm install
@touch node_modules
# Env file (copy example if missing)
.env:
cp .env.example .env
# First-time setup: install deps, copy env, start DB, run migrations and seed
setup: node_modules .env
docker compose up -d postgres redis
@echo "Waiting for database..."
@sleep 3
npx prisma generate
npx prisma migrate deploy
npm run db:seed
# Stop background services
stop:
-@pkill -f "npm run dev" 2>/dev/null || true
-@pkill -f "vite" 2>/dev/null || true
-@pkill -f "tsx watch" 2>/dev/null || true
docker compose down
# Clean everything
clean: stop
rm -rf node_modules
npm run clean
docker compose down -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment