Backend: - Add registry_address configuration API (GET/POST) - Add tar image upload with OCI and Docker format support - Add image download with streaming optimization - Fix blob download using c.Send (Fiber v3 SendStream bug) - Add registry_address prefix stripping for all OCI v2 endpoints - Add AGENTS.md for project documentation Frontend: - Add settings store with Snackbar notifications - Add image upload dialog with progress bar - Add download state tracking with multi-stage feedback - Replace alert() with MUI Snackbar messages - Display image names without registry_address prefix 🤖 Generated with [Qoder](https://qoder.com)
69 lines
1.7 KiB
Bash
Executable File
69 lines
1.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Run backend (Go) and frontend (Vite) together; stop both on Ctrl+C
|
|
|
|
set -e
|
|
|
|
# Colors for output
|
|
GREEN='\033[0;32m'
|
|
YELLOW='\033[1;33m'
|
|
RED='\033[0;31m'
|
|
NC='\033[0m' # No Color
|
|
|
|
# Get the directory where the script is located
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
cd "$SCRIPT_DIR"
|
|
|
|
# Function to cleanup background processes
|
|
cleanup() {
|
|
echo -e "\n${YELLOW}Shutting down services...${NC}"
|
|
if [ ! -z "$BACKEND_PID" ]; then
|
|
kill $BACKEND_PID 2>/dev/null || true
|
|
wait $BACKEND_PID 2>/dev/null || true
|
|
fi
|
|
if [ ! -z "$FRONTEND_PID" ]; then
|
|
kill $FRONTEND_PID 2>/dev/null || true
|
|
wait $FRONTEND_PID 2>/dev/null || true
|
|
fi
|
|
echo -e "${GREEN}All services stopped.${NC}"
|
|
exit 0
|
|
}
|
|
|
|
# Trap Ctrl+C and cleanup
|
|
trap cleanup SIGINT SIGTERM
|
|
|
|
# Check if pnpm is available, otherwise use npm
|
|
if command -v pnpm &> /dev/null; then
|
|
PACKAGE_MANAGER="pnpm"
|
|
elif command -v npm &> /dev/null; then
|
|
PACKAGE_MANAGER="npm"
|
|
else
|
|
echo -e "${RED}Error: Neither pnpm nor npm is installed.${NC}"
|
|
exit 1
|
|
fi
|
|
|
|
# Check if Go is installed
|
|
if ! command -v go &> /dev/null; then
|
|
echo -e "${RED}Error: Go is not installed.${NC}"
|
|
exit 1
|
|
fi
|
|
|
|
echo -e "${GREEN}Starting backend (Go)...${NC}"
|
|
go run main.go &
|
|
BACKEND_PID=$!
|
|
|
|
# Wait a moment for backend to start
|
|
sleep 2
|
|
|
|
echo -e "${GREEN}Starting frontend (Vite)...${NC}"
|
|
cd frontend
|
|
$PACKAGE_MANAGER run dev &
|
|
FRONTEND_PID=$!
|
|
cd ..
|
|
|
|
echo -e "${GREEN}Both services are running!${NC}"
|
|
echo -e "${YELLOW}Backend PID: $BACKEND_PID${NC}"
|
|
echo -e "${YELLOW}Frontend PID: $FRONTEND_PID${NC}"
|
|
echo -e "${YELLOW}Press Ctrl+C to stop both services${NC}"
|
|
|
|
# Wait for both processes
|
|
wait $BACKEND_PID $FRONTEND_PID |