How taoshur/gpt_image_for_android works
XG AI Studio is an Android-first AI image generation and editing client with an optional self-hosted account and sync service. Users configure a provider, create or edit images and manage results in the gallery; Agent conversations, favorites and batch operations are additional product workflows. In self-hosted mode, authentication enables server-backed storage and cross-device synchronization, while image jobs can continue server-side. The graph includes the documented Android WebView shell and server capabilities; some frontend-to-service wiring is described by the README but not visible in the sampled excerpts.
Main entry points: app.ts HTTP service · main.tsx Web entry · App.tsx Workspace app · db.ts Local database
Components 24
Client experience
- Web entry
src/main.tsx - Workspace app
src/App.tsx - Workspace home
src/components/WorkspaceHome.tsx
Image workflows
- Task gallery
src/components/TaskGrid.tsx - Image input
src/components/InputBar.tsx - Image providers
src/lib/imageApiShared.ts - Agent workspace
src/components/AgentWorkspace.tsx - Agent API
src/lib/agentApi.ts - Favorites
src/components/FavoriteCollections.tsx
Accounts and sync
- Local database
src/lib/db.ts - Sync engine
src/lib/syncEngine.ts - Auth client
src/lib/authClient.ts - Account storage
src/lib/accountStorage.ts - Server runtime
src/lib/serverRuntime.ts
Self-hosted service
- HTTP service
server/app.ts - Authentication
server/auth.ts - Sync routes
server/sync.ts - Hosted image jobs
server/imageJobs.ts - Server database
server/database.ts - Release routes
server/releases.ts
Android shell
- Native shell
android-app/app/src/main/java/cn/xgbyt/imageplayground/MainActivity.kt - App update
android-app/app/src/main/java/cn/xgbyt/imageplayground/AppUpdateController.kt
Other components
- User
- AI provider
Connections 26
- User → Web entry: opens app
- Web entry → Workspace app: loads
- Workspace app → Workspace home: shows
- Workspace app → Task gallery: shows
- Workspace app → Agent workspace: shows
- Image input → Image providers: requests generation
- Image providers → AI provider: calls provider
- Agent workspace → Agent API: runs conversation
- Task gallery → Local database: reads tasks
- Favorites → Local database: stores collections
- Web entry → Auth client: bootstraps managed mode
- Auth client → HTTP service: authenticates
- Web entry → Account storage: prepares account data
- Account storage → Local database: migrates database
- Sync engine → Local database: reads and commits
- Sync engine → HTTP service: exchanges sync data
- Server runtime → HTTP service: requests service data
- HTTP service → Authentication: registers routes
- HTTP service → Sync routes: registers routes
- HTTP service → Hosted image jobs: hosts jobs
- HTTP service → Server database: opens database
- HTTP service → AI provider: proxies AI requests
- Native shell → Web entry: loads WebView app
- Native shell → App update: exposes update bridge
- App update → Release routes: checks and downloads
- Release routes → Server database: reads release data