mirror of
https://github.com/wahyd4/hey-search.git
synced 2026-08-09 05:06:23 +10:00
- Add optional Redis caching for search results (REDIS_URL env var) - Cache TTL configurable via UI: 0h (disabled) to 168h (1 week), default 6h - New backend modules: cache.py (async Redis get/set/flush), settings.py (SQLite settings table) - New API endpoints: GET/PUT /api/settings, DELETE /api/cache - New 'Cache' tab in Settings modal with status indicator, preset buttons, slider, and flush - Cache keys are deterministic hashes of query+category+page+image_size+engines - Redis is fully optional: graceful no-op when REDIS_URL unset or Redis unreachable - Updated Dockerfile, README, CHANGELOG, FEATURES Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2.4 KiB
2.4 KiB
Hey Search
A privacy-respecting metasearch engine that aggregates results from multiple search engines.
Inspired by SearXNG.
Architecture
- Backend: Python / FastAPI — async metasearch orchestrator with retry logic
- Frontend: React + Vite + TypeScript + Tailwind CSS (shadcn theming) — mobile-first UI
- Docker: Multi-stage build (Node frontend build → Python runtime)
Prerequisites
- uv (Python package manager)
- Node.js >= 18
- Python >= 3.12
- Redis (optional — enables search result caching)
Running Locally
1. Backend
cd backend
uv sync # install dependencies
uv run uvicorn app.main:app --reload --port 8000
To enable Redis caching:
REDIS_URL=redis://192.168.1.2:6399 uv run uvicorn app.main:app --reload --port 8000
The API will be available at http://localhost:8000. Interactive docs:
- Swagger UI: http://localhost:8000/docs
- Redoc: http://localhost:8000/redoc
2. Frontend
cd frontend
npm install # install dependencies
npm run dev # start dev server with hot reload
The frontend dev server runs at http://localhost:5173 and proxies /api requests to the backend.
3. Quick start (both)
# Without Redis (caching disabled)
just dev
# With Redis
REDIS_URL=redis://192.168.1.2:6399 just dev
4. Docker (production)
docker build -t hey-search .
# Without Redis
docker run -p 8000:8000 hey-search
# With Redis
docker run -p 8000:8000 -e REDIS_URL=redis://your-redis:6379 hey-search
Then open http://localhost:8000.
API Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /api/search?q=&category= |
Search web or images |
| GET | /api/autocomplete?q= |
Autocomplete suggestions |
| GET | /api/engines |
List all search engines |
| PUT | /api/engines/{name} |
Enable/disable an engine |
| GET | /api/settings |
Get app settings (cache TTL) |
| PUT | /api/settings |
Update settings |
| DELETE | /api/cache |
Flush search cache |
Features
See FEATURES.md for the full feature list.