How lisenhuang/bantera-backend works
Bantera is a .NET REST API for a language-learning platform. Users authenticate, manage profiles and videos, and generate AI practice audio; administrators manage platform operations and inspect generation diagnostics. The API also provides chat and an MCP interface. The graph preserves these documented product branches. Some source excerpts are partial, so unsampled internal call relationships are omitted unless documented in the README or supported by the SOURCE INDEX.
Main entry points: Program.cs REST API routes · AppDbContext.cs PostgreSQL data · GeminiService.cs Dialogue and speech · ChatService.cs Chat service
Components 23
Identity and accounts
- Authentication
BanteraApi/Auth/AuthService.cs - Profile and avatars
BanteraApi/Profile/ProfileService.cs - Account deletion
BanteraApi/Account/AccountDeletionService.cs
Learning content
- Video management
BanteraApi/Videos/VideoService.cs - Object storage
BanteraApi/Storage/R2StorageService.cs
AI audio generation
- Dialogue and speech
BanteraApi/Gemini/GeminiService.cs - Duration planning
BanteraApi/Gemini/HistoricalDialogueDurationPlanner.cs - Word alignment
BanteraApi/RevAi/RevAiAlignmentService.cs - Audio timing
BanteraApi/Gemini/AiAudioTimingService.cs - Pipeline diagnostics
BanteraApi/AiAudioDiagnostics/AiPipelineEventRecorder.cs
Chat and activity
- Chat service
BanteraApi/Chat/ChatService.cs - Realtime chat
BanteraApi/Chat/ChatRealtimeService.cs - Push notifications
BanteraApi/Chat/ChatPushNotificationService.cs - User activity
BanteraApi/Activity/UserActivityRecorder.cs
Admin and integrations
- MCP tools and OAuth
BanteraApi/Mcp/McpEndpoints.cs - Admin operations
BanteraApi/Admin/AdminService.cs - PostgreSQL data
BanteraApi/Database/AppDbContext.cs
Other components
- Platform user
- Administrator
- REST API routes
BanteraApi/Program.cs - Google Gemini
- Rev.ai
- Cloudflare R2
Connections 31
- Platform user → REST API routes: uses
README.md - Administrator → REST API routes: uses
README.md - REST API routes → Authentication: routes auth
README.md - REST API routes → Video management: routes video requests
README.md - REST API routes → Profile and avatars: routes profile requests
BanteraApi/Program.cs - REST API routes → Account deletion: routes deletion
BanteraApi/Program.cs - REST API routes → Dialogue and speech: starts generation
README.md - REST API routes → Chat service: routes chat
BanteraApi/Program.cs - REST API routes → MCP tools and OAuth: routes MCP
- REST API routes → Admin operations: routes admin
README.md - Authentication → PostgreSQL data: reads and writes
BanteraApi/Auth/AuthService.cs - Authentication → Profile and avatars: sets new avatar
BanteraApi/Auth/AuthService.cs - Video management → PostgreSQL data: reads and writes
BanteraApi/Videos/VideoService.cs - Video management → Object storage: stores media
BanteraApi/Videos/VideoService.cs - Object storage → Cloudflare R2: stores objects
BanteraApi/Storage/R2StorageService.cs - Dialogue and speech → Google Gemini: requests dialogue and speech
BanteraApi/Gemini/GeminiService.cs - Dialogue and speech → Duration planning: plans duration
- Dialogue and speech → Word alignment: tries alignment
README.md - Dialogue and speech → Pipeline diagnostics: records events
BanteraApi/Gemini/GeminiService.cs - Word alignment → Rev.ai: requests alignment
BanteraApi/RevAi/RevAiAlignmentService.cs - Audio timing → Google Gemini: requests timing
- Chat service → PostgreSQL data: reads and writes
BanteraApi/Chat/ChatService.cs - Chat service → Realtime chat: publishes updates
BanteraApi/Chat/ChatService.cs - Chat service → Push notifications: sends notifications
BanteraApi/Chat/ChatService.cs - Push notifications → PostgreSQL data: reads push tokens
- User activity → PostgreSQL data: records activity
- MCP tools and OAuth → PostgreSQL data: accesses app data
- Admin operations → PostgreSQL data: manages records
- Pipeline diagnostics → PostgreSQL data: writes events
BanteraApi/AiAudioDiagnostics/AiPipelineEventRecorder.cs - Account deletion → PostgreSQL data: deletes records
BanteraApi/Account/AccountDeletionService.cs - Account deletion → Object storage: deletes user objects
BanteraApi/Account/AccountDeletionService.cs