Skip to content

gcbaptista/search-engine-dashboard

Repository files navigation

Search Engine Dashboard

A modern, responsive dashboard for managing search engine indexes, documents, and performing searches. Built with Next.js 15, TypeScript, and Tailwind CSS.

Features

🎯 Algolia-Inspired Global Index Selection

  • Global index selector in the top navigation (similar to Algolia's interface)
  • Context-aware pages that automatically adapt to the selected index
  • Smart index switching without page reloads
  • Beautiful dropdown interface with search functionality

πŸš€ Smart Loading & Performance

  • Lightning-fast startup (< 1 second initial load)
  • Progressive enhancement (details load automatically in background)
  • Smart caching to avoid redundant API requests
  • Backend-friendly loading with 100ms delays between requests
  • Scales perfectly with any number of indexes (1 to 1000+)

πŸ“Š Core Functionality

  • Index Management: Create, view, edit, and delete search indexes
  • Document Management: Upload and manage documents within selected indexes
  • Advanced Search: Powerful search with filters and faceting
  • Analytics Dashboard: Search performance and usage analytics
  • Settings Management: Configure search behavior and preferences

🎨 Modern UI/UX

  • Responsive design optimized for desktop and mobile
  • Gradient backgrounds and smooth animations
  • Beautiful loading states with skeleton animations
  • Accessible interface following best practices
  • Dark mode ready (easily configurable)

Architecture

Global State Management

// Context-based state with smart loading
interface State {
  indexNames: string[]; // Lightweight list (fast load)
  currentIndex: string | null; // Globally selected index
  indexDetailsCache: Map<string, IndexSettings>; // Smart caching
  loadingIndexes: Set<string>; // Track loading states
  // ... other state
}

Smart Loading Strategy

  1. Initial Load: Load only index names (50-100ms)
  2. Auto-Selection: Automatically select first available index
  3. Progressive Loading: Load details in background with smart pacing
  4. Global Context: All pages respect the globally selected index

Algolia-Inspired UX

  • Top Navigation Index Selector: Always visible and accessible
  • Context-Aware Pages: Automatically adapt to selected index
  • No Redundant Selectors: Single source of truth for index selection
  • Seamless Switching: Change indexes without losing page state

Getting Started

Prerequisites

  • Node.js 18+
  • npm or yarn
  • Go Search Engine API running on localhost:8080

Installation

  1. Clone the repository

    git clone <repository-url>
    cd search-engine-dashboard
  2. Install dependencies

    npm install
  3. Start development server

    npm run dev
  4. Open your browser

    http://localhost:3000
    

Usage

Global Index Selection

  1. Select an index from the dropdown in the top navigation
  2. All pages automatically adapt to work with the selected index
  3. Switch between indexes seamlessly without losing context

Index Management

  • View all available indexes with automatic detail loading
  • Create new indexes with sample configurations
  • Delete indexes with confirmation dialogs

Document Management

  • Upload documents to the currently selected index
  • Add sample movie data for testing
  • Upload custom JSON documents

JSON File Import

  • Drag & drop JSON files directly into the import dialog
  • Bulk upload thousands of documents efficiently
  • Batch processing with 50 documents per batch for optimal performance
  • Progress tracking with real-time status updates
  • Error handling with detailed error reporting
  • File validation ensures only valid JSON files are processed

Sample Data: Use the included sample-movies.json file to test bulk import functionality with 15 top-rated movies.

Search & Analytics

  • Schema-agnostic search - automatically detects and displays any document structure
  • Intelligent field mapping - recognizes common fields regardless of naming (Title/title, Description/plot, etc.)
  • Dynamic result cards - adapts to show relevant fields for any data type
  • Perform searches within the selected index
  • Apply filters and facets
  • View search analytics and performance metrics

API Integration

The dashboard integrates with a Go Search Engine API through a Next.js proxy to handle CORS:

// API calls go through Next.js proxy
const baseURL = "/api/proxy";

// Example: Search in selected index
const result = await searchAPI.search(selectedIndex, {
  query: "search terms",
  page_size: 20,
  filters: {
    /* ... */
  },
});

Performance Features

Smart Loading Benefits

  • βœ… 99%+ reduction in startup API calls
  • βœ… 95%+ faster initial load times
  • βœ… Progressive enhancement with background loading
  • βœ… Scalable architecture for production use

UX Improvements

  • βœ… Instant page loads with immediate content
  • βœ… Global index context eliminates confusion
  • βœ… Consistent navigation across all pages
  • βœ… Professional interface inspired by industry leaders

Technology Stack

  • Frontend: Next.js 15, React 18, TypeScript
  • Styling: Tailwind CSS, Heroicons
  • State Management: React Context + useReducer
  • API Layer: Axios with Next.js API proxy
  • Performance: Smart caching, progressive loading

License

MIT License - see LICENSE file for details.

About

Modern search engine dashboard with Algolia-inspired UI, built with Next.js 15 and TypeScript. Features smart loading, progressive enhancement, and comprehensive search management capabilities.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors