Skip to content

Repository files navigation

Synapse

Code topology modeling system based on Neo4j.

Supported languages

  • Java
  • Go
  • PHP (experimental)

Framework enrichment (best-effort)

  • Spring/Spring Boot: stereotypes, route mappings, DI edges (INJECTS), JPA repository links (PERSISTS)
  • Laravel: route-to-controller mapping attached to Callable.routes

Installation

uv sync

Usage

# Project management
synapse init <project-path>          # Register a project
synapse scan <project-id>            # Scan project code
synapse list-projects                # List active projects
synapse list-projects --include-archived  # Include archived projects

# Project lifecycle
synapse delete <project-id>          # Archive a project (soft delete)
synapse restore <project-id>         # Restore an archived project
synapse purge <project-id>           # Permanently delete an archived project

# Queries
synapse query calls <callable-id>    # Query call chains
synapse query types <type-id>        # Query type hierarchy
synapse query modules <module-id>    # Query module dependencies

# Machine-readable output (for integrations)
synapse query calls <callable-id> --json

Python SDK

from synapse.client import SynapseClient

with SynapseClient() as client:
    projects = client.projects.list_projects()
    # client.query.get_call_chain(...)

HTTP API (optional)

uv sync --group api
uv run synapse serve --host 127.0.0.1 --port 8000

Endpoints:

  • GET /health
  • GET /projects, POST /projects, POST /projects/{project_id}/scan
  • GET /resolve/module|type|callable
  • GET /query/call-chain|type-hierarchy|module-dependencies

Configuration

Synapse uses environment variables with the SYNAPSE_ prefix. For backward compatibility, Neo4j variables also support unprefixed names (e.g., NEO4J_URI), with SYNAPSE_ prefix taking precedence.

Variable Default Description
SYNAPSE_NEO4J_URI neo4j://localhost:7687 Neo4j connection URI
SYNAPSE_NEO4J_USERNAME neo4j Neo4j username
SYNAPSE_NEO4J_PASSWORD (empty) Neo4j password
SYNAPSE_NEO4J_DATABASE neo4j Neo4j database name
SYNAPSE_DEFAULT_PAGE_SIZE 100 Default pagination size
SYNAPSE_DEFAULT_MAX_DEPTH 5 Max depth for graph traversals
SYNAPSE_BATCH_WRITE_SIZE 1000 Batch size for bulk write operations

You can also use a .env file in the project root.

About

Code topology.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages