Skip to content

feat(backend): initialize project structure - #9

Merged
ariwired merged 2 commits into
mainfrom
backend
Oct 1, 2026
Merged

ariwired merged 2 commits into
mainfrom
backend

Conversation

@ariwired

@ariwired ariwired commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

Closes #1

Required to close this issue

This PR closes #1 only when every item below is checked. Items stay unchecked until the command was actually run.

Tasks

  • Create the backend/ directory. Evidence: backend/ in the file tree of this PR.
  • Configure Python dependency management. Evidence: backend/pyproject.toml and backend/uv.lock.
  • Create the visual_graph package. Evidence: backend/src/visual_graph/ with api, domain, spatial, graph and vision subpackages.
  • Create the application entry point. Evidence: create_app() in main.py, the visual-graph console script and __main__.py.
  • Create the initial test structure. Evidence: backend/tests/ with unit, api and integration folders.
  • Configure basic development dependencies. Evidence: dev group in pyproject.toml (pytest, pytest-cov, Hypothesis, httpx, Ruff, mypy).
  • Verify that the application can be imported and executed locally. Evidence: outputs in the Evidence section below.

Acceptance criteria

Criterion Verified by
The backend can be installed locally uv sync
The visual_graph package can be imported successfully uv run python -c "import visual_graph"
A basic application entry point exists uv run visual-graph, then GET /health/live returns {"status":"ok"}
The test directory is recognized by the test runner uv run pytest collects and passes the tests
Dependencies are reproducible from the project configuration uv sync --locked passes and the Backend CI check is green

Evidence

Install:

Import:

Tests:
<paste the uv run pytest --cov=visual_graph output>

Lint and types:

Entry point:
<paste the curl response from http://127.0.0.1:8000/health/live>

CI: see the Backend CI check on this PR.

What changed

  • Python backend under backend/ using a src layout, managed with uv and a committed uv.lock
  • App factory create_app() with the first endpoint, GET /health/live
  • Settings loaded from the environment with pydantic-settings
  • Tests organized as unit, api and integration, with the integration and inference markers excluded by default
  • Backend CI workflow running Ruff, mypy and pytest on changes to backend/

Design notes

  • The app is created by a factory, not at import time, so tests can import the module without required settings. Uvicorn runs it with the factory option.
  • The domain and spatial packages are reserved as pure Python, with no FastAPI, Neo4j or torch imports, to keep the geometric engine testable in isolation.
  • Neo4j, image handling and the detector are not included. Each is added by the issue that needs it.

Out of scope

Neo4j connection, /health/ready, domain models, object detection and the frontend.

@ariwired ariwired self-assigned this Oct 1, 2026
@ariwired ariwired linked an issue Oct 1, 2026 that may be closed by this pull request
12 tasks done
@ariwired
ariwired merged commit 234576f into main Oct 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: done

Development

Successfully merging this pull request may close these issues.

Initialize backend project structure

1 participant