lumina/verify-search.sh
2025-11-30 04:03:12 +03:00

104 lines
3.2 KiB
Bash
Executable File

#!/bin/bash
# Lumina Search Implementation Verification Script
# This script verifies that all search features are properly implemented
echo "๐Ÿ” Lumina Search Implementation Verification"
echo "=============================================="
echo ""
# Colors
GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Check if API is running
echo "1. Checking if API server is running..."
if curl -s http://localhost:3000/ > /dev/null; then
echo -e "${GREEN}โœ“${NC} API server is running"
else
echo -e "${RED}โœ—${NC} API server is not running. Start it with: cd api && npm start"
exit 1
fi
echo ""
# Check unified search endpoint
echo "2. Testing unified search endpoint..."
SEARCH_RESPONSE=$(curl -s "http://localhost:3000/explorer/public/search/unified?q=XLM")
if echo "$SEARCH_RESPONSE" | grep -q "records"; then
echo -e "${GREEN}โœ“${NC} Unified search endpoint working"
else
echo -e "${RED}โœ—${NC} Unified search endpoint failed"
fi
echo ""
# Check Soroban RPC connector
echo "3. Checking Soroban RPC connector..."
if [ -f "api/connectors/soroban-rpc.js" ]; then
echo -e "${GREEN}โœ“${NC} Soroban RPC connector exists"
else
echo -e "${RED}โœ—${NC} Soroban RPC connector missing"
fi
echo ""
# Check asset details endpoint
echo "4. Testing asset details endpoint..."
ASSET_RESPONSE=$(curl -s "http://localhost:3000/explorer/public/asset/XLM/details")
if echo "$ASSET_RESPONSE" | grep -q "asset"; then
echo -e "${GREEN}โœ“${NC} Asset details endpoint working"
else
echo -e "${RED}โœ—${NC} Asset details endpoint failed"
fi
echo ""
# Check latest transactions endpoint
echo "5. Testing latest transactions endpoint..."
TX_RESPONSE=$(curl -s "http://localhost:3000/explorer/public/transactions/latest?limit=5")
if echo "$TX_RESPONSE" | grep -q "records"; then
echo -e "${GREEN}โœ“${NC} Latest transactions endpoint working"
else
echo -e "${RED}โœ—${NC} Latest transactions endpoint failed"
fi
echo ""
# Check frontend components
echo "6. Checking frontend components..."
if [ -f "ui/views/components/global-search-bar.js" ]; then
echo -e "${GREEN}โœ“${NC} Global search bar component exists"
else
echo -e "${YELLOW}โš ${NC} Global search bar component missing"
fi
if [ -f "ui/views/components/latest-transactions-feed.js" ]; then
echo -e "${GREEN}โœ“${NC} Latest transactions feed component exists"
else
echo -e "${YELLOW}โš ${NC} Latest transactions feed component missing"
fi
echo ""
# Summary
echo "=============================================="
echo "Verification Complete!"
echo ""
echo "๐Ÿ“ Implementation Summary:"
echo " โ€ข Unified search with Soroban support"
echo " โ€ข Asset details page (Solscan-like)"
echo " โ€ข Latest transactions feed with SSE"
echo " โ€ข AI-powered search suggestions"
echo ""
echo "๐Ÿ“š Documentation: See SEARCH_IMPLEMENTATION.md"
echo ""
echo "๐Ÿš€ Next Steps:"
echo " 1. Test search: http://localhost:3000/explorer/public/search/unified?q=XLM"
echo " 2. Test assets: http://localhost:3000/explorer/public/asset/XLM/details"
echo " 3. Test stream: http://localhost:3000/explorer/public/transactions/latest"
echo ""
echo "๐ŸŽ‰ Your Lumina Explorer now has Solscan-like features!"