Skip to content

GoDanceAi/godance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Godance

Multimodal AI aggregator: text, image, video, and audio behind one OpenAI-compatible API. Stripe + Coinbase Commerce billing. Single credit ledger. Drop-in for any OpenAI SDK — point base_url at https://api.godance.ai/v1 and it works.

License: Apache 2.0

What's in this repo

godance/
├── backend/     Java 21 · Spring Boot 3.4 (WebFlux) · PostgreSQL · Redis · Flyway
│               OpenAI-compatible REST API, credit ledger, provider gateway with
│               regional allowlist enforcement, embedded Quartz scheduler.
│
├── app/        Vite · React 18 · TypeScript · Tailwind
│               Chat UI, dashboard, billing surface. Deploys as a static SPA
│               to Cloudflare Pages → app.godance.ai.
│
└── marketing/  Astro 5 · Tailwind
                SSG marketing site → godance.ai. SEO + GEO optimized.

Each subdirectory has its own README with a quickstart.

Design philosophy

  • OpenAI-compatible HTTP contract. Existing OpenAI SDKs work with no code changes — just swap base_url. Routes: /v1/chat/completions, /v1/images/generations, /v1/videos/generations, /v1/audio/speech, /v1/audio/transcriptions, /v1/embeddings, /v1/models.
  • Regional provider allowlist is code, not config. The provider gateway enforces a hardcoded allowlist per region. Some upstream providers (Anthropic, OpenAI, Google Vertex, BFL Flux) cannot be served from Chinese-owned infrastructure under their terms of service — the Alicloud region's allowlist is empty for those providers. Fail-closed, not opt-in.
  • Single credit ledger, append-only. All balance changes go through CreditLedger. The User.credit_balance_cents field is a denormalized cache; the source of truth is SUM(delta_cents).
  • Integer cents everywhere. Money is long cents at every layer. Pricing internally uses microcents (1 ¢ = 10,000 µ¢) for per-1k-token arithmetic that would otherwise round to zero on cheap models. Conversion to display strings only at the boundary.
  • Idempotent webhooks. Stripe and Coinbase webhooks dedupe on the upstream event id, surfacing duplicate deliveries as success without double-crediting.
  • Reactive end-to-end. WebFlux + Netty. SSE streaming for chat completions. Async generation jobs for image / video.

Status

This is the v0.1 codebase from initial implementation. Not yet deployed to production. The full session-by-session build history is visible in the git log.

License

Apache License 2.0. Use it, fork it, embed it. Attribution appreciated, not required.

Contributing

Issues and pull requests welcome. For substantial changes, open a discussion first so we can align on direction before code review.

The regional allowlist (backend/.../AlicloudProviderAllowlist) and the billing / ledger code are the load-bearing safety surfaces — changes there need a test in the same PR.

About

Multimodal AI aggregator with an OpenAI-compatible API. Java/Spring Boot backend + React SPA + Astro marketing site. Stripe + Coinbase Commerce billing, single credit ledger.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors