How achyantsh/herobrine-ai works
HeroBrine AI turns text, images, PDFs, voice recordings, and Discord messages into user-scoped commitments, then presents them for management in a web dashboard, calendar, and analytics. The central flow is capture → extraction and validation → persistence → product views. The graph also includes authentication, Discord account linking, and reminders. Backend relationships are grounded in sampled code and the source index; frontend product capabilities and some cross-service links are documented in the README, so those links reflect its architecture rather than inspected frontend call sites.
Main entry points: app Web application · main.py FastAPI routes · ai_ingestion_service.py AI ingestion orchestration · message_handler.py Message and attachment handler
Components 27
Web product
- Web application
frontend/app - Commitment views
frontend/app/commitments/page.tsx - Calendar
frontend/app/calendar/page.tsx - Analytics
frontend/app/analytics/page.tsx - Dashboard and reminders
frontend/app/dashboard/page.tsx - AI upload planner
frontend/components/upload/UploadDialog.tsx
Identity and linking
- Supabase auth
- Session handling
frontend/components/auth/AuthProvider.tsx - JWT verification
backend/app/auth/dependencies.py - Discord account linking
frontend/app/api/discord/callback/route.ts - Supabase profiles
Discord capture
- Discord bot
discord_bot/bot.py - Message and attachment handler
discord_bot/handlers/message_handler.py - Backend HTTP client
discord_bot/services/herobrine_api.py
Ingestion and AI
- AI ingestion orchestration
backend/app/services/ai_ingestion_service.py - Image, PDF, voice parsers
backend/app/parsers - Text extraction and prompts
backend/app/ai/extractor.py - Image understanding
backend/app/services/gemini_vision_service.py - Commitment mapping
backend/app/ai/mapper.py
Commitment backend
- FastAPI routes
backend/app/main.py - Internal API protection
backend/app/auth/internal_api.py - Commitment rules
backend/app/services/commitment_service.py - Commitment repository
backend/app/repositories/commitment_repository.py - PostgreSQL commitments
backend/app/models/commitment.py
Other components
- User
- Discord user
- Google Gemini
Connections 31
- User → Web application: uses
- User → Discord bot: mentions
- Web application → Supabase auth: authenticates
- Web application → FastAPI routes: calls API
- Web application → Commitment views: presents
- Web application → Calendar: presents
- Web application → Analytics: presents
- Web application → Dashboard and reminders: presents
- Web application → AI upload planner: captures input
- Session handling → Supabase auth: uses session
- Web application → Discord account linking: starts linking
- Discord account linking → Supabase profiles: updates link
- Discord bot → Message and attachment handler: registers handler
discord_bot/bot.py - Message and attachment handler → Supabase profiles: resolves account
- Message and attachment handler → Backend HTTP client: sends input
discord_bot/handlers/message_handler.py - Backend HTTP client → FastAPI routes: posts ingestion
discord_bot/services/herobrine_api.py - FastAPI routes → Internal API protection: protects internal routes
- FastAPI routes → JWT verification: authenticates users
backend/app/main.py - FastAPI routes → AI ingestion orchestration: routes ingestion
- FastAPI routes → Commitment rules: routes management
- FastAPI routes → AI ingestion orchestration: routes Discord input
- AI ingestion orchestration → Image, PDF, voice parsers: parses files
backend/app/services/ai_ingestion_service.py - AI ingestion orchestration → Text extraction and prompts: extracts text input
backend/app/services/ai_ingestion_service.py - AI ingestion orchestration → Image understanding: processes images
backend/app/services/ai_ingestion_service.py - Text extraction and prompts → Google Gemini: generates extraction
- Image understanding → Google Gemini: analyzes images
backend/app/services/gemini_vision_service.py - AI ingestion orchestration → Commitment mapping: maps results
backend/app/services/ai_ingestion_service.py - AI ingestion orchestration → Commitment rules: persists extracted
backend/app/services/ai_ingestion_service.py - Commitment rules → Commitment repository: delegates persistence
backend/app/services/commitment_service.py - Commitment repository → PostgreSQL commitments: reads and writes
backend/app/repositories/commitment_repository.py - PostgreSQL commitments → FastAPI routes: serves commitment data