Initial open-source release (MIT): image2api AI gateway

Full Go backend + Vue 3 frontend, OpenAI-compatible API, multi-provider
account pools, billing/admin, Docker one-command deploy with auto HTTPS.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-25 22:59:04 +08:00
co-authored by Claude Opus 4.8
commit 606caaf047
142 changed files with 33648 additions and 0 deletions
+50
View File
@@ -0,0 +1,50 @@
package main
import (
"context"
"log"
"net/http"
"os"
"os/signal"
"syscall"
"time"
"backend/internal/bootstrap"
)
func main() {
ctx := context.Background()
app, err := bootstrap.NewApp(ctx)
if err != nil {
log.Fatalf("bootstrap app: %v", err)
}
srv := &http.Server{
Addr: app.Config.HTTPAddr,
Handler: app.Engine,
ReadHeaderTimeout: 5 * time.Second,
}
go func() {
log.Printf("backend listening on %s", app.Config.HTTPAddr)
if err := srv.ListenAndServe(); err != nil && err != http.ErrServerClosed {
log.Fatalf("listen and serve: %v", err)
}
}()
stop := make(chan os.Signal, 1)
signal.Notify(stop, syscall.SIGINT, syscall.SIGTERM)
<-stop
shutdownCtx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
if err := srv.Shutdown(shutdownCtx); err != nil {
log.Printf("shutdown http server: %v", err)
}
if err := app.Close(); err != nil {
log.Printf("close app: %v", err)
}
}