Flask REST API (aurora-server)
Overview
The Flask API is the primary backend service handling HTTP requests for cloud operations, user management, and integrations. Container:aurora-serverPort: 5080 (configurable via
FLASK_PORT)Entry Point:
server/main_compute.py:431Process: Gunicorn (production) or Flask dev server
Key Responsibilities
- Cloud Provider Integration: GCP, AWS, Azure, OVH, Scaleway, Tailscale
- OAuth Flows: GitHub, Bitbucket, Slack, PagerDuty, Confluence
- Incident Management: Create, list, update incidents
- User Preferences: Store/retrieve user settings
- Health Checks:
/healthendpoint for monitoring - Knowledge Base: Document upload and management
Blueprint Structure
The Flask app uses modular blueprints organized by domain:server/main_compute.py:195-396
Environment Variables
Dependencies
- postgres (healthy) - Database connection
- weaviate (healthy) - Vector search
- redis (running) - Cache and queue
- vault (healthy) - Secrets access
- seaweedfs-filer (healthy) - Object storage
WebSocket Chatbot (chatbot)
Overview
WebSocket server powering the AI agent interactions with real-time streaming. Container:chatbotPort: 5006
Entry Point:
server/main_chatbot.py:604Process: Python WebSocket server with asyncio
Key Responsibilities
- LangGraph Workflow Execution: Run AI agent with tool calls
- Token Streaming: Stream LLM responses token-by-token
- Tool Execution: Execute cloud operations via agent tools
- Session Management: Track chat sessions per user
- Context Loading: Load historical messages for continuity
- WebSocket Confirmations: Interactive approval for destructive operations
Message Flow
server/main_chatbot.py:217-602
Key Features
Real-Time Streaming
Rate Limiting
Session Isolation
Each session gets dedicated Terraform directories:Celery Workers (celery_worker)
Overview
Background task processing for long-running operations. Container:celery_workerProcess:
celery -A celery_config worker --loglevel=infoConfiguration:
server/celery_config.py
Registered Tasks
server/celery_config.py:46-64
Periodic Tasks (Celery Beat)
| Task | Schedule | Purpose |
|---|---|---|
cleanup-idle-terminal-pods | 10 min | Remove inactive kubectl pods |
cleanup-stale-background-chats | 5 min | Cancel timed-out background sessions |
cleanup-stale-kb-documents | 3 min | Remove failed knowledge base uploads |
run-full-discovery | 1 hour | Scan cloud resources for service graph |
mark-stale-services | 24 hours | Mark inactive services as stale |
server/celery_config.py:66-87
Configuration
PostgreSQL Database
Overview
Primary relational database for structured data. Container:aurora-postgresPort: 5432
Image:
postgres:15-alpineDatabase:
aurora_db
Key Tables
- users: User accounts and preferences
- chat_sessions: Chat history and context
- incidents: Incident tracking and timeline
- incident_thoughts: RCA background analysis thoughts
- credentials: Cloud provider OAuth tokens (references to Vault)
- graph_services: Discovered services for graph visualization
- llm_usage: LLM API cost tracking
Connection Management
Aurora uses a connection pool for efficient database access:Weaviate Vector Database
Overview
Vector database for semantic search over knowledge base documents. Container:weaviatePort: 8080 (HTTP), 50051 (gRPC)
Image:
cr.weaviate.io/semitechnologies/weaviate:1.27.6Module:
text2vec-transformers with all-MiniLM-L6-v2
Usage
Data Stored
- Knowledge Base Documents: User-uploaded documentation
- GitHub Files: Code and documentation from connected repos
- Confluence Pages: Synced wiki content
Redis Cache & Queue
Overview
In-memory data store for caching and message brokering. Container:redisPort: 6379
Image:
redis:7-alpine
Use Cases
- Celery Broker: Task queue for background jobs
- Celery Backend: Store task results
- API Cost Cache: Cache LLM usage for performance
- Cloud Setup Cache: Cache cloud provider resource lists
- Rate Limiting: Track API request counts
Cache Keys
HashiCorp Vault
Overview
Secrets management for sensitive credentials. Container:aurora-vaultPort: 8200
Image:
hashicorp/vault:1.15Storage: File-based with persistent volumes
Configuration
Secret Storage Pattern
server/utils/vault/vault_client.py
SeaweedFS Object Storage
Overview
S3-compatible object storage for files and artifacts. Containers:seaweedfs-master, seaweedfs-volume, seaweedfs-filerPorts: 8333 (S3 API), 8888 (Web UI), 9333 (Master)
Image:
chrislusf/seaweedfs:4.07License: Apache 2.0
S3 API Access
Stored Data
- Terraform State: Session-isolated infrastructure state
- Knowledge Base Files: Uploaded PDFs, docs
- GitHub Archives: Cloned repository content
- Log Files: Captured command outputs
Memgraph Graph Database
Overview
In-memory graph database for service discovery and relationships. Container:aurora-memgraphPort: 7687 (Bolt), 7444 (HTTP)
Image:
memgraph/memgraph-mage:latestUI:
memgraph-lab on port 3001
Data Model
Discovery Tasks
Service discovery runs periodically via Celery Beat:services/discovery/tasks.py
Frontend (Next.js)
Overview
React-based frontend with Server-Side Rendering. Container:frontendPort: 3000
Framework: Next.js 15 with App Router
Entry Point:
client/src/app/page.tsx
Technology Stack
- React 18: Functional components with hooks
- TypeScript: Strict mode enabled
- Tailwind CSS: Utility-first styling
- shadcn/ui: Component library
- Auth.js: Authentication provider
- WebSocket: Real-time chat connection