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 <noreply@anthropic.com>
This commit is contained in:
11
README.md
11
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)
|
||||
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.
|
||||
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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" <<EOF
|
||||
[Desktop Entry]
|
||||
Version=1.0
|
||||
@@ -27,4 +28,20 @@ EOF
|
||||
chmod +x "$HOME/Desktop/DentalApp.desktop"
|
||||
gio set "$HOME/Desktop/DentalApp.desktop" metadata::trusted true 2>/dev/null
|
||||
|
||||
echo "Desktop shortcut created successfully!"
|
||||
# Create Stop shortcut
|
||||
cat > "$HOME/Desktop/StopDentalApp.desktop" <<EOF
|
||||
[Desktop Entry]
|
||||
Version=1.0
|
||||
Type=Application
|
||||
Name=Stop Dental App
|
||||
Comment=Stop all Dental App services and free all ports
|
||||
Exec=bash -c "$PROJECT_DIR/stop-app.sh; zenity --info --text='Dental App stopped.' --timeout=3 2>/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)"
|
||||
|
||||
19
stop-app.sh
Executable file
19
stop-app.sh
Executable file
@@ -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."
|
||||
Reference in New Issue
Block a user