SurfSense/surfsense_backend
2026-09-18 08:52:14 +02:00
..
alembic refactor(license): make Stripe and Keygen the system of record 2026-09-14 00:08:18 +05:30
app feat(local): more pre release tweaks 2026-09-17 21:19:21 -07:00
scripts Merge branch 'pr-1777' into sunset-fixes 2026-09-17 07:06:57 +02:00
tests feat(local): more pre release tweaks 2026-09-17 21:19:21 -07:00
.dockerignore chore(backend): exclude tests/ from production Docker image 2026-05-06 17:16:22 +05:30
.env.example fix(email): update support email address to rohan@surfsense.com in license recovery instructions 2026-09-17 21:22:40 -07:00
.gitignore feat(knowledge-store): git-native knowledge base 2026-07-31 02:33:38 +02:00
.python-version feat: SurfSense v0.0.6 init 2025-03-14 18:53:14 -07:00
AGENTS.md chore: add AGENTS.md and a small set of vendor skills 2026-09-18 08:51:48 +02:00
alembic.ini add github connector, add alembic for db migrations, fix bug updating connectors 2025-04-13 13:56:22 -07:00
celery_worker.py fix: celery_app path and gmail indexing 2025-10-21 21:11:41 -07:00
Dockerfile fix(Dockerfile): update libmagic package name for Debian 13 compatibility 2026-08-08 16:52:06 +05:30
main.py feat: api playground, other tweaks 2026-07-06 16:45:04 -07:00
pyproject.toml chore: bump version to 0.0.40 2026-09-12 21:32:01 +02:00
README.md docs: add backend and web READMEs so each product has a setup path 2026-09-18 08:52:14 +02:00
uv.lock chore: bump version to 0.0.40 2026-09-12 21:32:01 +02:00

SurfSense backend

FastAPI app: scraper API, knowledge base, auth, and the self-host server.

This is not the desktop sidecar. Desktop Python lives in surfsense_local/backend/.

You need

  • Python 3.12+ and uv
  • PostgreSQL with pgvector
  • Redis (background jobs)

The smallest way to get Postgres and Redis is from the repo root:

docker compose -f docker/docker-compose.deps-only.yml up -d db redis

Run it

cp .env.example .env
uv sync
uv run alembic upgrade head
uv run main.py --reload

API: http://localhost:8000
Docs: http://localhost:8000/docs

.env.example is the config map. For local Docker Postgres the default DATABASE_URL already matches deps-only. Set SECRET_KEY to something of your own. Leave SUNSET_MODE unset.

Uploads, connectors, and other background work need a worker in a second terminal:

uv run celery -A celery_worker.celery_app worker --loglevel=info --concurrency=1 --pool=solo --queues=surfsense,surfsense.connectors,surfsense.gateway

Scheduled jobs need beat as well (uv run celery -A celery_worker.celery_app beat --loglevel=info). Skip both until you touch that path.

Tests

uv run pytest -m unit
AUTH_TYPE=LOCAL uv run pytest -m integration   # needs Postgres

More on the suite: tests/README.md.

UI

The Next.js app is surfsense_web/. It talks to this API. You do not need it for a backend-only change.

Full stack, Google auth, ETL keys, and zero-cache: manual installation.