#!/bin/bash # CannaiQ Local Development Shutdown # # Stops all local development services: # - Backend API # - CannaiQ Admin UI # - FindADispo Consumer UI # - Findagram Consumer UI # # Note: PostgreSQL container is left running by default. set -e RED='\033[0;31m' GREEN='\033[0;32m' YELLOW='\033[1;33m' NC='\033[0m' echo -e "${YELLOW}Stopping CannaiQ local services...${NC}" # Stop backend if [ -f /tmp/cannaiq-backend.pid ]; then PID=$(cat /tmp/cannaiq-backend.pid) if kill -0 $PID 2>/dev/null; then echo -e "${YELLOW}Stopping Backend API (PID: $PID)...${NC}" kill $PID 2>/dev/null || true fi rm -f /tmp/cannaiq-backend.pid fi # Stop CannaiQ Admin frontend if [ -f /tmp/cannaiq-frontend.pid ]; then PID=$(cat /tmp/cannaiq-frontend.pid) if kill -0 $PID 2>/dev/null; then echo -e "${YELLOW}Stopping CannaiQ Admin (PID: $PID)...${NC}" kill $PID 2>/dev/null || true fi rm -f /tmp/cannaiq-frontend.pid fi # Stop FindADispo frontend if [ -f /tmp/findadispo-frontend.pid ]; then PID=$(cat /tmp/findadispo-frontend.pid) if kill -0 $PID 2>/dev/null; then echo -e "${YELLOW}Stopping FindADispo (PID: $PID)...${NC}" kill $PID 2>/dev/null || true fi rm -f /tmp/findadispo-frontend.pid fi # Stop Findagram frontend if [ -f /tmp/findagram-frontend.pid ]; then PID=$(cat /tmp/findagram-frontend.pid) if kill -0 $PID 2>/dev/null; then echo -e "${YELLOW}Stopping Findagram (PID: $PID)...${NC}" kill $PID 2>/dev/null || true fi rm -f /tmp/findagram-frontend.pid fi # Kill any remaining node processes for this project pkill -f "vite.*cannaiq" 2>/dev/null || true pkill -f "vite.*findadispo" 2>/dev/null || true pkill -f "vite.*findagram" 2>/dev/null || true pkill -f "tsx.*backend" 2>/dev/null || true # Stop PostgreSQL (optional - uncomment if you want to stop DB too) # docker compose -f docker-compose.local.yml down echo -e "${GREEN}All frontend services stopped.${NC}" echo -e "${YELLOW}Note: PostgreSQL container is still running. To stop it:${NC}" echo " cd backend && docker compose -f docker-compose.local.yml down"