How alaa13/dobby-core works
Dobby is a Kotlin/Spring backend for Discord and web clients: it accepts roast and fact requests, enriches asynchronous roast jobs with PostgreSQL facts, calls OpenAI, and publishes results through Redis for consumers. It also provides Discord OAuth/account support, dashboard data, API-key rate limiting, and JWT-protected live log streaming. The README documents these product flows; source excerpts were not provided, so implementation-level call ownership and finer wiring cannot be verified.
Main entry points: AiRoastService.kt AI roast generation · RoastController.kt Roast endpoint · FactService.kt Fact service · FactController.kt Fact endpoint
Components 21
API and access
- Roast endpoint
src/main/kotlin/com/example/dobby/controller/discord/RoastController.kt - Fact endpoint
src/main/kotlin/com/example/dobby/controller/discord/FactController.kt - API key access
src/main/kotlin/com/example/dobby/security/ApiKeyFilter.kt - Rate limiter
src/main/kotlin/com/example/dobby/service/RateLimitingService.kt - Log stream
src/main/kotlin/com/example/dobby/controller/LogController.kt - JWT access
src/main/kotlin/com/example/dobby/security/JwtAuthenticationFilter.kt
Roast generation
- Roast orchestration
src/main/kotlin/com/example/dobby/service/RoastService.kt - AI roast generation
src/main/kotlin/com/example/dobby/service/AiRoastService.kt - Prompt loading
src/main/kotlin/com/example/dobby/service/PromptLoaderService.kt - OpenAI adapter
src/main/kotlin/com/example/dobby/llm/OpenAiApiAdapter.kt
Accounts and dashboard
- Discord OAuth
src/main/kotlin/com/example/dobby/service/DiscordAuthService.kt - Discord accounts
src/main/kotlin/com/example/dobby/service/DiscordAccountService.kt - Dashboard data
src/main/kotlin/com/example/dobby/service/DashboardService.kt
Persistence and delivery
- Fact service
src/main/kotlin/com/example/dobby/service/FactService.kt - PostgreSQL
- Redis publisher
src/main/kotlin/com/example/dobby/queue/RedisPublisher.kt - Redis Pub/Sub
- Log events
src/main/kotlin/com/example/dobby/logging/LogEmitter.kt
Other components
- Discord bot
- Web dashboard
- OpenAI
Connections 20
- Discord bot → Roast endpoint: submits roast
README.md - Web dashboard → Roast endpoint: submits roast
README.md - Roast endpoint → Roast orchestration: queues job
README.md - Roast orchestration → AI roast generation: generates asynchronously
README.md - AI roast generation → Fact service: fetches context
README.md - Fact service → PostgreSQL: reads facts
README.md - AI roast generation → OpenAI: requests generation
README.md - AI roast generation → Redis publisher: publishes result
README.md - Redis publisher → Redis Pub/Sub: publishes message
README.md - Discord bot → Fact endpoint: stores fact
README.md - Fact endpoint → Fact service: stores fact
README.md - Discord bot → API key access: provides API key
README.md - API key access → Rate limiter: enforces limit
README.md - Web dashboard → Discord OAuth: authenticates
- Discord OAuth → Discord accounts: manages account
- Web dashboard → Dashboard data: views dashboard
- Web dashboard → JWT access: provides JWT
README.md - Web dashboard → Log stream: opens SSE stream
README.md - Log stream → Log events: streams events
- Discord bot → Redis Pub/Sub: subscribes
README.md