searchmirror README

The project's README from github.com/databluedev/searchmirror. As one markdown file: README.md.

SearchMirror

CI Licence: AGPL v3

SearchMirror is an open-source, self-hosted rank tracker built around the DataBlue SERP API. It tracks Google positions by keyword, region, language, and device while keeping provider credentials under the control of the instance owner or each account.

Status: pre-1.0. The local Docker stack and supported product paths are functional, but the project still carries a legacy Django 3.2 and MongoDB 4.4 runtime. Treat the included Compose stack as a development environment, not a production deployment template.

Supported scope

The current public surface is intentionally narrow:

Keyword research, search volume, Content Gap, page audit, billing and the old commercial vendor integrations are not part of this application and their code has been removed. Google Search Console and Analytics code is retained but parked until a proper server-side OAuth flow is provided; it is not advertised as ready.

Bring your own keys

Live rank checks require DataBlue. Each account can save its own DataBlue key under Settings -> API Keys. Keys are encrypted at rest with SERP_KEY_SECRET and are not returned in clear text.

An operator may set DATABLUE_API_KEY and explicitly enable ALLOW_INSTANCE_FALLBACK=true for a single-operator install. Fallback is off by default so one account cannot silently spend the instance owner's credits.

Geo Citations and Content Planner optionally use OpenAI, Anthropic, Perplexity, or Gemini. Accounts configure a provider key and model in Settings; both features share the same provider router. No Hugging Face or DataForSEO account is required.

Quick start

Requirements: Docker with the Compose plugin.

git clone https://github.com/databluedev/searchmirror.git
cd searchmirror
cp .env.example .env
docker compose up -d --build

The backend automatically applies migrations and runs the idempotent local seed. Sign in at http://127.0.0.1:3001 with:

Field Local value
Email [email protected]
Password LocalDev12345

These credentials are for the local seed only. Replace the placeholder Django, engine, encryption, and scheduler secrets before exposing an instance.

Service Address Purpose
tracker-app http://127.0.0.1:3001 React application
tracker-backend http://127.0.0.1:8000 Django API
tracker-engine http://127.0.0.1:8001 internal ranking engine
tracker-scheduler - queues the daily 01:00 rank runs
tracker-mongo 127.0.0.1:27017 MongoDB

Every port is published on 127.0.0.1 only -- the stack is not reachable from the local network, and there is no IPv6 listener to half-answer a localhost connection. localhost and 127.0.0.1 both work; the docs use the explicit IPv4 form because that is what the tests and CORS_ALLOWED_ORIGINS are written against.

The tracker-* container names are retained for volume and deployment compatibility; the public product name is SearchMirror.

Run real rankings

Saving a DataBlue key only configures the account. The following command performs live provider requests and spends DataBlue credits:

docker compose exec engine python rank_local.py

The command prints the estimated request count before starting. It is never run automatically by the test suite.

Production-bundle smoke build

The main app can also be compiled and served by nginx on port 4001:

docker compose --profile prod up -d --build app-prod

This validates the frontend bundle; it does not turn the development Django servers or MongoDB image into a hardened production deployment.

Marketing site

landing/ is an independent Vite application:

cd landing
pnpm install
pnpm dev      # http://localhost:5180
pnpm build    # production bundle in landing/dist

Its outbound links live in landing/src/lib/site.ts. REPO_URL there is still a placeholder and has to be set to the real repository before the page is published — the licence, docs, and issues links are all derived from it.

Configuration

Copy .env.example to .env. The example documents every supported setting and contains only local placeholders.

The important security settings are:

AI provider environment variables are optional instance fallbacks. A hosted or multi-user deployment should leave them blank and use per-account keys.

Tests and builds

With the local stack running:

python -m pytest tests -q
docker compose exec -T backend python manage.py check
docker compose exec -T engine python manage.py check
docker compose exec -T app npm run build
cd landing && pnpm build

The tests cover authentication, provider routing, production configuration, supported routes, and Docker-backed integration behavior. Browser verification should avoid clicking Rank, Refresh, or Generate unless spending configured provider credits is intentional.

Project layout

Path Purpose
app/ React 18 + Vite product UI
landing/ React 18 + Vite marketing site
backend/ Django API, accounts, projects, reports, and orchestration
engine/ Django ranking engine and DataBlue integration
shared/ code shared by both Django services
brand/ the mark: source of truth for every favicon, logo, and wordmark
docker/ service Dockerfiles and nginx configuration
tests/ regression and Docker-backed integration tests

The backend and engine are separate Django applications sharing MongoDB. A future runtime upgrade should migrate Django/djongo and MongoDB together rather than changing one layer in isolation.

Documentation

Document What it is for
docs/USER-GUIDE.md Using a running instance: projects, keywords, reading the dashboard, and what costs money
docs/CONFIGURATION.md Every environment variable, what it does, and what breaks without it
SECURITY.md Reporting a vulnerability, and what is in scope
CONTRIBUTING.md Start here to work on the code: running the stack, where things live, conventions, how to submit a change
CODE_OF_CONDUCT.md What is expected of everyone taking part, and how to report a problem
CHANGELOG.md What changed in each release, and the known limitations of the current one
docs/TESTING.md The test suite — how it runs, the two kinds of test, what is covered and what is not
docs/DEPLOYMENT.md Running an instance for real: the production overlay, TLS, secrets, backups
docs/DESIGN.md The design contract. Governs every pixel; read before any UI change
docs/PRODUCT-DESIGN.md Navigation and information architecture
docs/ORCHESTRATION.md How daily ranking is scheduled across projects. Read before changing engine/project/machine/
docs/DATABLUE-INTEGRATION.md How the SERP provider is called and what it returns
docs/DATABLUE-FINDINGS-2026-09-05.md Measured provider behaviour, including fields that are always empty
docs/SHIPPED-SURFACE.md What ships, what is parked and why. Paired with tests/test_shipped_surface.py

Maintainer

Built and maintained by Sheik Mohammed Ali M (@sheik-md-ali) — [email protected].

Bug reports and feature requests belong in the issue tracker; questions are welcome by email. Security issues go through SECURITY.md, not a public issue. Contributions are welcome — start with CONTRIBUTING.md.

License

SearchMirror is licensed under the GNU Affero General Public License v3.0. If you modify it and provide the modified software as a network service, the AGPL requires that service's users be offered the corresponding source code.

Copyright (C) 2026 Sheik Mohammed Ali M and SearchMirror contributors.

searchmirror (databluedev/searchmirror)

Searching Database…

这是什么?SearchMirror 是一个开源、可自托管的排名追踪与 AI 曝光度监控工具,通过 DataBlue SERP API 按关键词、地区、语言和设备检查 Google 搜索排名。
这是一个框架,还是可以直接运行的应用?它是一个开箱即用的自托管 Web 应用:后端是 Django API 加内部排名引擎,前端是 React 18 + Vite 仪表盘,存储用 MongoDB,整体以 Docker Compose 堆栈的形式交付。
怎么把它跑起来?把 .env.example 复制为 .env,然后启动 Docker Compose 堆栈;后端会自动应用迁移并运行幂等的本地种子数据,并带有默认的本地管理员登录。
要看真实排名需要 DataBlue API 密钥吗?需要。实时排名检查要求你自己的 DataBlue SERP API 密钥,需在「Settings -> API Keys」中按账户保存;Geo Citations 和 Content Planner 还可以选用你提供的 OpenAI、Anthropic、Perplexity 或 Gemini 密钥。
它适合用于生产环境吗?不适合。该项目仍处于 1.0 之前的阶段,且还运行在旧的 Django 3.2 和 MongoDB 4.4 技术栈上;自带的 Compose 配置是当作开发环境用的,而不是加固过的生产部署。
我保存的服务商密钥是如何保护的?已保存的 DataBlue 密钥使用 SERPKEYSECRET 设置进行静态加密,绝不会以明文形式返回给账户。
AGPL 许可证对我意味着什么?SearchMirror 采用 AGPL-3.0 许可证,因此如果你修改它并将修改后的版本作为网络服务运行,就必须向该服务的用户提供相应的源代码。
Geo Citations 和 Content Planner 用的是哪些 AI 服务商?账户可以通过一个由这两个功能共用的服务商路由,自行配置 OpenAI、Anthropic、Perplexity 或 Gemini 的密钥和模型。
有哪些功能曾经存在但已被移除?关键词研究、搜索量、Content Gap、页面审计、计费以及旧的商业厂商集成已从代码中完全移除;Google Search Console/Analytics 的代码仍在,但在正式的 OAuth 流程推出之前处于搁置状态。
排名多久刷新一次?tracker-scheduler 服务每天在 01:00 为所有项目排队执行一次排名运行。
所有账户能否共用一个 DataBlue 密钥,而不是各用各的?默认不行——运维人员必须在单运维部署中显式设置 DATABLUE_API_KEY 并启用 ALLOW_INSTANCE_FALLBACK=true,这样某个账户才不会悄悄消耗所有者的额度。
Size
2.7 MB
Stars
110
Updated
CommitOct 01
Age
1mo
Commits · 90 Days