A multi-upstream operations hub for self-hosted API services built with sub2api or new-api.
English | 中文
Please read the following carefully before using this project:
| Name | Description |
|---|---|
| An innovation platform for AI resource reuse and intelligent service circulation, improving coordination across compute, model, and application capabilities. | |
| An AI service brand centered on approachable experiences, stable access, and lightweight intelligent tools for reliable everyday usage. | |
| An AI infrastructure platform for multi-model access, request routing, and usage governance, helping teams build more flexible and controllable model invocation workflows. | |
| A stable and efficient API relay provider for mainstream AI coding models including Claude Code, Codex, and Gemini with NanoBanana-series models; supports monthly plans, usage-based billing, high-concurrency calls, invoiced top-ups, dedicated enterprise onboarding, technical support, and a long-term invitation rebate program. | |
| An AI compute gateway for global developers and enterprises, offering one-stop access to ChatGPT, Claude, Gemini, and other major models through transparent official or first-hand channels, with reliable infrastructure built to make every call worthwhile. | |
| An API relay providing stable, high-throughput access to major overseas models including OpenAI, Claude, Gemini, and more through a single OpenAI-compatible endpoint; built for resellers and downstream platforms that need reliable volume and competitive pricing. | |
| An AI service brand for polished intelligent application experiences, focused on premium model access, reliable delivery, and streamlined workflows for creators and teams. | |
| An API service brand focused on stable access and multi-upstream aggregation, designed for high-availability access, resource integration, and consistent service experiences. |
TransitHub is a self-hosted admin and operations hub for managing multiple upstream sites and admin workspaces. It focuses on practical operator workflows: connecting upstream platforms, tracking balances and group multipliers, monitoring dashboard metrics, configuring notifications, and running scheduled group-rate campaigns that can automatically restore original multipliers after an activity ends.
The project is built as a Go backend with a Vue 3 admin frontend, backed by PostgreSQL and Redis.
| Component | Technology |
|---|---|
| Backend | Go 1.25, net/http, pgx |
| Frontend | Vue 3.5, Vite, TypeScript, TailwindCSS, vue-i18n |
| Database | PostgreSQL 16+ |
| Cache / Session | Redis 7+ |
| Deployment | Docker, Docker Compose |
Production compose files live under deploy/.
git clone https://github.com/deviseo/transit-hub.git transit-hub
cd transit-hub
# Edit deploy/docker-compose.prod.yml first:
# - image tag (defaults to deviseo/transithub:latest)
# - database password
# - ADMIN_EMAIL / ADMIN_PASSWORD
# - APP_VERSION if you want a custom version label
docker compose -f deploy/docker-compose.prod.yml up -d
Open:
http://YOUR_SERVER_IP:10621
The production compose file includes:
app: TransitHub application container.postgres: PostgreSQL database.redis: Redis for admin sessions, cache, and scheduled tasks.Persistent data is stored under the repository root data/ directory by default:
data/postgres
data/redis
For local development dependencies only:
docker compose -f deploy/docker-compose.yml up -d
This starts PostgreSQL and Redis on local ports 5432 and 6379.
Because the Dockerfile is stored in deploy/ but expects the repository root as build context, build with:
docker build -f deploy/Dockerfile -t deviseo/transithub:latest .
cd backend
go test ./...
go run ./cmd/api
Important environment variables:
PORT=10621
DATABASE_URL=postgres://postgres:postgres@localhost:5432/transithub?sslmode=disable
REDIS_URL=redis://127.0.0.1:6379/0
ADMIN_EMAIL=admin@example.com
ADMIN_PASSWORD=transithub
ALLOW_PUBLIC_REGISTER=true
APP_VERSION=dev
cd frontend
npm install
npm run dev
Build check:
npm run build
Recommended checks before submitting changes:
cd backend
go test ./...
go vet ./...
go build ./...
cd ../frontend
npm run build
cd ..
docker compose -f deploy/docker-compose.yml config
docker compose -f deploy/docker-compose.prod.yml config
transit-hub/
├── backend/ # Go backend service
│ ├── cmd/api/ # API entrypoint
│ ├── internal/config/ # Runtime configuration
│ ├── internal/database/ # PostgreSQL, Redis, migrations
│ ├── internal/httpserver/ # HTTP server assembly and middleware
│ └── internal/modules/ # Domain modules
│ ├── admin_accounts/
│ ├── auth/
│ ├── dashboard/
│ ├── group_rate_campaigns/
│ ├── group_rates/
│ ├── my_sites/
│ ├── settings/
│ ├── system/
│ └── upstream/
├── frontend/ # Vue 3 admin frontend
│ └── src/modules/ # Feature modules
├── deploy/ # Dockerfile and compose files
├── development-docs/ # Development notes and implementation plans
└── data/ # Local production data directory, ignored by Git
APP_VERSION is only used for display.AGENTS.md, CLAUDE.md, .sisyphus/, local .env files, build output, and runtime data are intentionally ignored by Git.<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=deviseo/transit-hub&type=Date" />
This project is licensed under the GNU Lesser General Public License v3.0 (LGPL-3.0-only). See LICENSE for details.
If TransitHub helps your workflow, consider giving it a star.
$ claude mcp add transit-hub \
-- python -m otcore.mcp_server <graph>