Skip to content

timeplus-io/timeplus-connector-registry

Repository files navigation

Timeplus Connector Registry

Central registry for Timeplus Custom Table Function (CTF) connectors. Think npm/PyPI for Timeplus data connectors.

Features

  • 📦 Package Management - Publish, version, and distribute connectors
  • 🔍 Discovery - Search and browse connectors by category, tags, and keywords
  • 📥 Easy Installation - Generate ready-to-run SQL for any connector
  • 🏷️ Categorization - Source, Sink, and Bidirectional connectors
  • Verification - Verified publisher badges for trusted connectors

Quick Start

Option 1: Docker Compose (Recommended)

The easiest way to run the registry locally:

# Start the registry API (UI is integrated)
docker-compose up -d

# View logs
docker-compose logs -f api

# Stop services
docker-compose down

# Stop and remove data
docker-compose down -v

Once running:

Option 2: Local Development

If you prefer to run without Docker:

# 1. Install Python dependencies
pip install -e .

# 2. Set up environment variables (copy and edit .env.example)
cp .env.example .env
# By default, it uses an embedded SQLite database (registry.db)

# 3. Start the server
uvicorn registry.main:app --reload

API Documentation

Once running, visit:

Using the API

Register a Publisher

curl -X POST "http://localhost:8000/api/v1/register" \
  -H "Content-Type: application/json" \
  -d '{
    "namespace": "timeplus",
    "display_name": "Timeplus",
    "email": "gang@timeplus.com",
    "password": "Password!"
  }'

Response:

{
  "access_token":"eyJhbGciOiJIUzI1Ni......",
  "token_type":"bearer"}

Login

curl -X POST "http://localhost:8000/api/v1/login" \
  -H "Content-Type: application/json" \
  -d '{
    "namespace": "timeplus",
    "password": "Password!"
  }'

Publish a Connector

# Using the sample connector
curl -X POST "http://localhost:8000/api/v1/connectors" \
  -H "Authorization: Bearer <your-token>" \
  -H "Content-Type: application/x-yaml" \
  --data-binary @samples/kafka-json-reader.yaml

Search Connectors

# Search by keyword
curl "http://localhost:8000/api/v1/connectors?q=kafka"

# Filter by category
curl "http://localhost:8000/api/v1/connectors?category=source"

# Filter by tags
curl "http://localhost:8000/api/v1/connectors?tags=kafka,streaming"

# Combine filters
curl "http://localhost:8000/api/v1/connectors?q=json&category=source&tags=kafka"

Get Connector Details

curl "http://localhost:8000/api/v1/connectors/mycompany/kafka-json-reader"

Get Installation SQL

# Get SQL for latest version
curl "http://localhost:8000/api/v1/connectors/mycompany/kafka-json-reader/sql"

# Get SQL for specific version
curl "http://localhost:8000/api/v1/connectors/mycompany/kafka-json-reader/sql?version=1.0.0"

# Get SQL with custom stream name
curl "http://localhost:8000/api/v1/connectors/mycompany/kafka-json-reader/sql?name=my_kafka_stream"

List Tags and Categories

# List all tags
curl "http://localhost:8000/api/v1/tags"

# Get category statistics
curl "http://localhost:8000/api/v1/categories"

Project Structure

registry/
├── main.py              # FastAPI application entry point
├── config.py            # Configuration settings
├── database.py          # Database connection and session
├── models/              # SQLAlchemy ORM models
├── schemas/             # Pydantic schemas
├── routers/             # API route handlers
├── services/            # Business logic
└── utils/               # Utility functions

Environment Variables

Variable Default Description
DATABASE_URL sqlite+aiosqlite:///./registry.db Database connection string
SECRET_KEY (required) JWT signing key - use a long random string
DEBUG false Enable debug mode
HOST 0.0.0.0 Server bind host
PORT 8000 Server bind port

License

Apache 2.0

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published