From 1b017177e99965f3bca34ae361d4ee0519849535 Mon Sep 17 00:00:00 2001 From: ff Date: Tue, 26 May 2026 22:00:06 -0400 Subject: [PATCH] feat: add stop-app script and update desktop shortcut setup Adds stop-app.sh to kill all services by port (5000-5003, 3000/3001) and updates setup-desktop-shortcut.sh to create both Start and Stop desktop shortcuts in a single run. README Step 13 updated accordingly. Co-Authored-By: Claude Sonnet 4.6 --- README.md | 13 +++++++---- .../.prisma-zod-generator-manifest.json | 4 ++-- setup-desktop-shortcut.sh | 23 ++++++++++++++++--- stop-app.sh | 19 +++++++++++++++ 4 files changed, 49 insertions(+), 10 deletions(-) create mode 100755 stop-app.sh diff --git a/README.md b/README.md index 88f31c09..9bd3010c 100644 --- a/README.md +++ b/README.md @@ -186,9 +186,9 @@ cd apps/SeleniumService .venv/bin/python3 agent.py ``` -### Step 13 — Create desktop shortcut (optional) +### Step 13 — Create desktop shortcuts (optional) -Instead of opening two terminals manually every time, you can create a desktop shortcut that starts both services with a single double-click. +Instead of opening two terminals manually every time, you can create desktop shortcuts that start and stop all services with a single double-click. Run this once after cloning and installing: @@ -196,9 +196,12 @@ Run this once after cloning and installing: bash ~/Desktop/DentalManagementMH06/setup-desktop-shortcut.sh ``` -A **Dental App** shortcut will appear on your desktop. Double-clicking it opens: -- A terminal running `npm run dev` (Backend + Frontend) -- A terminal running the Selenium service +Two shortcuts will appear on your desktop: + +- **Dental App** — starts the app. Double-clicking it opens: + - A terminal running `npm run dev` (Backend + Frontend + Python services) + - A terminal running the Selenium service +- **Stop Dental App** — stops all services and frees all ports (5000, 5001, 5002, 5003, 3000/3001) > No username or path editing needed — the script automatically detects the current user's home folder. diff --git a/packages/db/shared/.prisma-zod-generator-manifest.json b/packages/db/shared/.prisma-zod-generator-manifest.json index ae6c3d5c..b69fa4cf 100755 --- a/packages/db/shared/.prisma-zod-generator-manifest.json +++ b/packages/db/shared/.prisma-zod-generator-manifest.json @@ -1,8 +1,8 @@ { "version": "1.0", "generatorVersion": "1.0.0", - "generatedAt": "2026-05-18T02:15:24.393Z", - "outputPath": "/home/ff/Desktop/DentalManagementMH05/packages/db/shared", + "generatedAt": "2026-05-26T15:00:01.445Z", + "outputPath": "/home/ff/Desktop/DentalManagementMH06/packages/db/shared", "files": [ "schemas/enums/TransactionIsolationLevel.schema.ts", "schemas/enums/UserScalarFieldEnum.schema.ts", diff --git a/setup-desktop-shortcut.sh b/setup-desktop-shortcut.sh index 2c7f98fc..87b2a4b1 100755 --- a/setup-desktop-shortcut.sh +++ b/setup-desktop-shortcut.sh @@ -4,14 +4,15 @@ PROJECT_DIR="$HOME/Desktop/DentalManagementMH06" ICON_SRC="$PROJECT_DIR/assets/dental-icon.svg" ICON_DEST="$HOME/.local/share/icons/dental-icon.svg" -# Make start script executable +# Make scripts executable chmod +x "$PROJECT_DIR/start-app.sh" +chmod +x "$PROJECT_DIR/stop-app.sh" # Install icon mkdir -p "$HOME/.local/share/icons" cp "$ICON_SRC" "$ICON_DEST" -# Create desktop shortcut +# Create Start shortcut cat > "$HOME/Desktop/DentalApp.desktop" </dev/null -echo "Desktop shortcut created successfully!" +# Create Stop shortcut +cat > "$HOME/Desktop/StopDentalApp.desktop" </dev/null || true" +Icon=system-shutdown +Terminal=false +Categories=Application; +EOF + +chmod +x "$HOME/Desktop/StopDentalApp.desktop" +gio set "$HOME/Desktop/StopDentalApp.desktop" metadata::trusted true 2>/dev/null + +echo "Desktop shortcuts created successfully! (Start + Stop)" diff --git a/stop-app.sh b/stop-app.sh new file mode 100755 index 00000000..f4f15b84 --- /dev/null +++ b/stop-app.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# Kill processes by port (backend 5000, selenium 5002, patient extractor 5001, payment OCR 5003, frontend 3000/3001) +for PORT in 5000 5001 5002 5003 3000 3001; do + PIDS=$(lsof -ti :$PORT 2>/dev/null) + if [ -n "$PIDS" ]; then + echo "Killing port $PORT (PID $PIDS)" + kill -9 $PIDS 2>/dev/null + fi +done + +# Kill any remaining turbo / ts-node-dev / vite processes for this project +PROJECT="DentalManagementMH06" +pkill -9 -f "turbo.*$PROJECT" 2>/dev/null +pkill -9 -f "ts-node-dev.*$PROJECT" 2>/dev/null +pkill -9 -f "vite.*$PROJECT" 2>/dev/null +pkill -9 -f "agent.py" 2>/dev/null + +echo "All Dental App processes stopped."