Skip to main content

GraphXR Database Proxy - Secure middleware for connecting GraphXR to databases

Project description

GraphXR Database Proxy

License Python Version FastAPI

Language: English | 中文

A secure middleware that connects GraphXR to various backend databases with zero trust architecture.

Features

  • Zero Trust Security: Strict authentication and authorization at the proxy layer
  • Direct Browser Connectivity: REST/GraphQL APIs for efficient data access
  • Multi-Database Support: Spanner Graph, Neo4j, and more
  • Open Source: Fully auditable and customizable
  • Pure Python: Easy to deploy and maintain

⚡ Quick Start (Spanner Graph)

  1. Run the following commands to start graphxr-database-proxy (requires uv, node.js)
git clone https://github.com/Kineviz/graphxr-database-proxy.git
cd graphxr-database-proxy
uv venv
uv pip install -r requirements.txt
npm run dev
  1. Web UI should open automatically in your browser. Or visit http://localhost:8080/.
  2. Click "Create New Project"
  3. Project Name: "Test"
  4. Database Type: "Google Cloud Spanner"
  5. Authentication Type: "Service Account"
  6. Upload the credential file you exported from GCP Console or gcloud CLI. Export Instructions
  7. Select "Instance ID" e.g. "demo"
  8. Select "Database ID" e.g. "cymbal"
  9. Select "Property Graph" e.g. "ECommerceGraph"
  10. Click "Create"
  11. For the new project, under Actions, copy the API URL. e.g. "http://localhost:8080/api/spanner/Test"
  12. Go back to GraphXR's Create Project wizard and paste the API URL into GraphXR for a project with a "Database Proxy" database type.

Adding authentication to the proxy

cp .env.example .env

Edit the .env file and add the following variables:

# Optional: Set a password for the admin interface
ADMIN_PASSWORD=your-admin-password-here

# Optional: Set a secure API key for the proxy API
# You can also generate an API key in the Web UI under Settings.
API_KEY=your-secure-api-key-here

Other ways to start graphxr-database-proxy

Install

# Install from PyPI
pip install graphxr-database-proxy[ui]

# Or from source
git clone https://github.com/Kineviz/graphxr-database-proxy.git
cd graphxr-database-proxy
uv venv
source .venv/bin/activate # or .venv/bin/activate on Windows
uv pip install -e ".[ui]"
uv pip install -r requirements.txt
cd frontend && npm install && npm run build && cd -
pip install -e .[ui]

Configure & Run

Option 1: Web UI (Recommended)

graphxr-proxy --ui

Open http://localhost:9080/admin for configuration

Option 2: Python Code with Service Account JSON

from graphxr_database_proxy import DatabaseProxy

proxy = DatabaseProxy()

service_account_json = {
    "type": "service_account",
    "project_id": "your-gcp-project-id",
    "private_key": "-----BEGIN PRIVATE KEY-----\\n...\\n-----END PRIVATE KEY-----\\n",
    "client_email": "your-service-account@your-gcp-project-id.iam.gserviceaccount.com",
    ...
}

project_id = proxy.add_project(
    project_name="project_name",
    database_type="spanner",
    project_id="gcp-project-id", 
    instance_id="spanner-instance-id",
    database_id="spanner-database-id",
    credentials=service_account_json,  
    graph_name="graph_name"  # Optional
)

proxy.start(
    host="0.0.0.0",     
    port=9080,          
    show_apis=True     
)

Option 3: Python Code with Google Cloud ADC

Your should have set up Google Application Default Credentials (ADC) on the machine running the proxy. See Google Cloud ADC Documentation.

from graphxr_database_proxy import DatabaseProxy
proxy = DatabaseProxy()

google_adc_credentials={
    "type": "google_ADC"
},  
 
project_id = proxy.add_project(
    project_name="project_name",
    database_type="spanner",
    project_id="gcp-project-id", 
    instance_id="spanner-instance-id",
    database_id="spanner-database-id",
    credentials=google_adc_credentials,  
    graph_name="graph_name"  # Optional
)

proxy.start(
    host="0.0.0.0",     
    port=9080,          
    show_apis=True     
)

🐳 Docker

docker run -d -p 9080:9080 \
--name graphxr-database-proxy \
-v ${HOME}/graphxr-database-proxy/config:/app/config \
kineviz/graphxr-database-proxy:latest

You can visit http://localhost:9080/admin for configuration after starting the container.

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🆘 Support


Built with ❤️ by Kineviz

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

graphxr_database_proxy-1.1.0.tar.gz (70.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

graphxr_database_proxy-1.1.0-py3-none-any.whl (46.6 kB view details)

Uploaded Python 3

File details

Details for the file graphxr_database_proxy-1.1.0.tar.gz.

File metadata

  • Download URL: graphxr_database_proxy-1.1.0.tar.gz
  • Upload date:
  • Size: 70.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for graphxr_database_proxy-1.1.0.tar.gz
Algorithm Hash digest
SHA256 5ff3d360d4dab8b91ecb7df0cfef6e15f2bbf81713f6954faa6ebc8c52c17272
MD5 1e912ab7c0fd35e3e977e2e57de471d9
BLAKE2b-256 83eab512aca98b5985dc63122c39a12800cad625f05c1d58189f46c4b5f2677b

See more details on using hashes here.

File details

Details for the file graphxr_database_proxy-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for graphxr_database_proxy-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 50e4f90dd41468e3ff1fc22f0222f5e6e45c7d66ce43878f5eebde02f3076c04
MD5 334eedec2e514556d311ab3c1ab4f6bb
BLAKE2b-256 3f06ff96b042cd5eeead2a83ab6de33a9cf0ff2914d8db070bfc973615c853e9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page