Files
indee-demo/scripts/start.sh
Dorian 725896673c Update package dependencies and enhance application structure
- Added several new dependencies related to the Applesauce library, including 'applesauce-accounts', 'applesauce-common', 'applesauce-core', 'applesauce-loaders', 'applesauce-relay', and 'applesauce-signers', all at version 5.1.0.
- Updated the development script in package.json to specify a port for Vite and added new seed scripts for profiles and activity.
- Removed outdated image files from the public directory to clean up unused assets.
- Enhanced the App.vue structure by integrating shared components like AppHeader and AuthModal for improved user experience.
- Refactored ContentDetailModal and MobileNav components to support new features and improve usability.

These changes improve the overall functionality and maintainability of the application while ensuring it utilizes the latest libraries for better performance.
2026-02-12 12:24:58 +00:00

76 lines
1.9 KiB
Bash
Executable File

#!/usr/bin/env bash
set -e
RELAY_PORT=7777
RELAY_URL="ws://localhost:$RELAY_PORT"
VITE_PORT=5174
cleanup() {
echo ""
echo "Shutting down..."
# Kill background jobs (relay)
kill $(jobs -p) 2>/dev/null
exit 0
}
trap cleanup SIGINT SIGTERM
# Check that nak is installed
if ! command -v nak &>/dev/null; then
echo "Error: 'nak' is not installed."
echo "Install with: brew install nak"
exit 1
fi
# Kill any existing process on the relay port
if lsof -i :$RELAY_PORT -P &>/dev/null; then
echo "Port $RELAY_PORT is already in use, killing existing process..."
lsof -ti :$RELAY_PORT | xargs kill -9 2>/dev/null
sleep 1
fi
# Start the local relay in the background
echo "Starting local Nostr relay on port $RELAY_PORT..."
nak serve --port $RELAY_PORT &
RELAY_PID=$!
# Wait for the relay to be ready
echo "Waiting for relay to be ready..."
for i in $(seq 1 30); do
if curl -s -o /dev/null http://localhost:$RELAY_PORT 2>/dev/null; then
echo "Relay is ready at $RELAY_URL (pid $RELAY_PID)"
break
fi
if ! kill -0 $RELAY_PID 2>/dev/null; then
echo "Error: relay process died unexpectedly"
exit 1
fi
sleep 0.5
done
# Verify relay is actually responding
if ! curl -s -o /dev/null http://localhost:$RELAY_PORT 2>/dev/null; then
echo "Error: relay did not start in time"
kill $RELAY_PID 2>/dev/null
exit 1
fi
# Seed test profiles and activity
echo ""
echo "Seeding test profiles..."
npx tsx scripts/seed-profiles.ts
echo ""
echo "Seeding activity (reactions & comments)..."
npx tsx scripts/seed-activity.ts
echo ""
# Start the Vite dev server (in foreground so Ctrl+C works)
echo "Starting dev server..."
echo "============================================"
echo " Relay: $RELAY_URL (pid $RELAY_PID)"
echo " App: http://localhost:$VITE_PORT"
echo " Press Ctrl+C to stop everything"
echo "============================================"
echo ""
npx vite --port $VITE_PORT